[JBoss JIRA] (AS7-4334) RESTeasy: Cannot configure Jackson ObjectMapper via ContextResolver nor Application.getSingletons()
by Hendy Irawan (JIRA)
Hendy Irawan created AS7-4334:
---------------------------------
Summary: RESTeasy: Cannot configure Jackson ObjectMapper via ContextResolver nor Application.getSingletons()
Key: AS7-4334
URL: https://issues.jboss.org/browse/AS7-4334
Project: Application Server 7
Issue Type: Bug
Components: REST
Affects Versions: 7.1.1.Final
Environment: JBoss AS 7.1.1
Reporter: Hendy Irawan
Assignee: Stuart Douglas
This doesn't work:
{code}
@Provider @Produces(MediaType.APPLICATION_JSON)
public class JacksonContextResolver implements ContextResolver<ObjectMapper> {
private transient Logger log = LoggerFactory.getLogger(JacksonContextResolver.class);
private ObjectMapper objectMapper;
public JacksonContextResolver() throws JsonGenerationException, JsonMappingException, IOException {
log.info("Using my own Jackson ObjectMapper");
objectMapper = new ObjectMapper();
objectMapper.configure(Feature.INDENT_OUTPUT, true);
objectMapper.configure(Feature.WRITE_DATES_AS_TIMESTAMPS, false);
objectMapper.configure(Feature.WRITE_DATE_KEYS_AS_TIMESTAMPS, false);
log.info("Test date: {}", objectMapper.writeValueAsString(new DateTime()));
log.info("Test pretty output: {}", objectMapper
.writeValueAsString(new Article("Launching AksiMata",
"AksiMata : Ada apa di sana?",
"Webapp yang keren dan oke punya.", "Hendy Irawan")));
}
@Override
public ObjectMapper getContext(Class<?> type) {
return objectMapper;
}
}
{code}
The log correctly tests the custom ObjectMapper works fine, however when returning the output, seems like it's still using the "default" ObjectMapper.
This also doesn't work:
{code}
@Override
public Set<Object> getSingletons() {
Set<Object> singletons = new HashSet<Object>(super.getSingletons());
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.configure(Feature.INDENT_OUTPUT, true);
objectMapper.configure(Feature.WRITE_DATES_AS_TIMESTAMPS, false);
objectMapper.configure(Feature.WRITE_DATE_KEYS_AS_TIMESTAMPS, false);
singletons.add(objectMapper);
return singletons;
}
{code}
Sample project to reproduce the issue is at:
https://github.com/soluvas/ear-sample/tarball/resteasy-jackson-bug
Bug is almost similar to #AS7-1408.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 8 months
[JBoss JIRA] (AS7-4043) Expose additional web subsystem metrics
by Brian Stansberry (JIRA)
Brian Stansberry created AS7-4043:
-------------------------------------
Summary: Expose additional web subsystem metrics
Key: AS7-4043
URL: https://issues.jboss.org/browse/AS7-4043
Project: Application Server 7
Issue Type: Feature Request
Components: Web
Reporter: Brian Stansberry
Assignee: Remy Maucherat
A user has requested that some further web subsystem metrics be exposed via the management interface:
"When we run JVM with "-Dorg.apache.tomcat.util.ENABLE_MODELER=true"
option, we can get currentThreadsBusy via JMX.
e.g.
ObjectName poolObjName = new
ObjectName("jboss.web:type=ThreadPool,name=ajp-0.0.0.0-0.0.0.0-8009");
ajpCurrentThreadsBusy = ((Integer) pfServer.getAttribute(poolObjName,
"currentThreadsBusy")).intValue();
It is nice if we could get the information via CLI like:
/subsystem=web/connector=ajp13:read-attribute(name=current-threads-busy)
Additionally, We also would like to get activeSessionCount. We can get
the information via JMX like:
ObjectName sessionObjName = new
ObjectName("jboss.web:type=Manager,path=/tpcw,host=default-host");
activeSessions = ((Long) pfServer.getAttribute(sessionObjName,
"activeSessionCount")).intValue();
And it is nice if we could get the information with CLI like:
/deployment=tpcw.war/subsystem=web/servlet=TPCWServletWithEncoding:read-attribute(name=active-session-count)"
I don't think the active-sessionc-count belongs under the "servlet" resource though, since sessions are not associated with servlets.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 8 months
[JBoss JIRA] (JBRULES-3266) Rule, import with wildcards and variable / patternBinding
by Per Sterner (Created) (JIRA)
Rule, import with wildcards and variable / patternBinding
---------------------------------------------------------
Key: JBRULES-3266
URL: https://issues.jboss.org/browse/JBRULES-3266
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-core (expert)
Affects Versions: 5.3.0.Final
Environment: Windows, Equinox
Reporter: Per Sterner
Assignee: Mark Proctor
I got the exception "java.lang.NoClassDefFoundError: de/pelle7/testpackage/event/myEvent (wrong name: de/pelle7/testpackage/event/MyEvent)" while adding my resources.
I removed the import wildcards and the error disappeard.
Finally I found the problem:
I used the patternBinding 'myEvent' and there is a class called 'MyEvent' and I used an wildcard import where the class 'MyEvent' is located.
My solution is that I replaced all my pattern bindings with the suffix '$' which is more convenient.
Perhaps it would be nice to produce an rule-compilation error. with a line notice.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 8 months
[JBoss JIRA] (AS7-2284) Don't enable web console unless it is populated with data
by Lukáš Petrovický (Created) (JIRA)
Don't enable web console unless it is populated with data
---------------------------------------------------------
Key: AS7-2284
URL: https://issues.jboss.org/browse/AS7-2284
Project: Application Server 7
Issue Type: Enhancement
Components: Console
Affects Versions: 7.1.0.Alpha1
Reporter: Lukáš Petrovický
Assignee: Heiko Braun
Try logging into the web console immediately after the server starts. What you see is... nothing. We're missing all the data - deployments, modules... Basically, the menu on the left side doesn't show anything.
If you refresh the console a little while after that (tens of seconds later), the data are all properly there. What I propose is that, until the data are available, the console be either disabled or with some sort of "Loading, please wait..." dialog preventing users from interacting with the UI.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 8 months