Bug 1036197 - Native HTTP connector fails if org.apache.tomcat.util.Constants.ENABLE_MODELER is set to true
Summary: Native HTTP connector fails if org.apache.tomcat.util.Constants.ENABLE_MODELE...
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Web
Version: 6.1.0,6.2.0,6.1.1,6.2.1
Hardware: All
OS: All
unspecified
high
Target Milestone: DR2
: EAP 6.3.0
Assignee: Rémy Maucherat
QA Contact: Radim Hatlapatka
Russell Dickenson
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-11-29 17:28 UTC by Daniel Bobbert
Modified: 2014-08-06 14:36 UTC (History)
3 users (show)

(edit)
In previous releases of JBoss EAP 6, JBossWeb Coyote's *Protocol classes start() methods constructed an MBean name using the getName() value, which is likely to contain a colon and the MBean object name cannot contain arbitrary colons.

The following error would be reported when JBoss tries to start if `-Dorg.apache.tomcat.util.Constants.ENABLE_MODELER=true` was set:
----
JBWEB003044: Threadpool JMX registration failed: javax.management.MalformedObjectNameException: Invalid character ':' in value part of property
----

This release uses `getJmxName()` rather than `getName()` to correctly construct the name of the MBean.

As a result the exception no longer occurs when `-Dorg.apache.tomcat.util.Constants.ENABLE_MODELER=true` is used, and the modeller is enabled.
Clone Of:
(edit)
Last Closed: 2014-08-06 14:36:21 UTC


Attachments (Terms of Use)

Description Daniel Bobbert 2013-11-29 17:28:30 UTC
Description of problem:
When the system property org.apache.tomcat.util.Constants.ENABLE_MODELER is set to true (in order to enable monitoring of JBossWeb JMX beans) AND the web connector is set to "native", JBossWeb fails to start.

This is caused by a bug in class org.apache.coyote.http11.Http11AprProtocol in method start() where a JMX ObjectName is created using the method getName(). Since the name will usually contain a colon (as in "ip:port"), the resulting JMX ObjectName is invalid, creating an exception that causes the connector to fail.

Proposed Solution: Use getJmxName() instead of getName() to construct the ObjectName (as it is already done in other places of this class).


Version-Release number of selected component (if applicable):
JBossWeb in EAP 6.1 and 6.1.1

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Jean-frederic Clere 2013-12-02 09:47:33 UTC
10:32:15,011 INFO  [org.apache.catalina.core] (MSC service thread 1-4) JBWEB001065: The native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/i386:/lib:/usr/lib
10:32:15,300 INFO  [org.apache.coyote.http11] (MSC service thread 1-4) JBWEB003001: Coyote HTTP/1.1 initializing on : http-/127.0.0.1:8080
10:32:15,304 ERROR [org.apache.coyote.http11] (MSC service thread 1-4) JBWEB003044: Threadpool JMX registration failed: javax.management.MalformedObjectNameException: Invalid character ':' in value part of property
	at javax.management.ObjectName.construct(ObjectName.java:618) [rt.jar:1.7.0_25]
	at javax.management.ObjectName.<init>(ObjectName.java:1382) [rt.jar:1.7.0_25]
	at org.apache.coyote.http11.Http11NioProtocol.start(Http11NioProtocol.java:132) 

Testing with jbossweb 7.4.x
BTW: native isn't in the beta.

Comment 2 Rémy Maucherat 2013-12-02 10:30:26 UTC
I don't know what happened, but NIO and APR were not using the JMX name, which caused the problem. I suppose JMX is not used very often with AS.

Comment 3 Daniel Bobbert 2013-12-04 08:03:10 UTC
We use JMX to monitor the number of http requests, thread pool usage etc. on our production systems. And of course we use the native connectors for performance reasons. I would expect this is a common scenario or are there better ways to monitor the internals of AS?!

Comment 4 Daniel Bobbert 2014-01-04 22:57:34 UTC
The bug also (still) exists in EAP 6.2

Comment 5 Daniel Bobbert 2014-01-04 23:10:53 UTC
Also see bug 1036977 for a fix.

Comment 6 Jean-frederic Clere 2014-03-04 14:06:16 UTC
After checking the repos it is fixed in
EAP6.2 CP01 CP02 CP03 (it is NOT fixed in EAP6.2).
EAPP6.3 from the available release...

Comment 7 Daniel Bobbert 2014-03-31 14:10:03 UTC
I checked back and the bug is still present in EAP 6.2 CP01 (aka EAP 6.2.1).

Both Http11NioProtocol and Http11AprProtocol in jbossweb-7.3.0.Final-redhat-1 still contain the old, unchanged code that uses getName() instead of getJmxName(). And booting the server still throws exactly the same error message.

Comment 8 James Livingston 2014-07-20 23:37:07 UTC
This was fixed in JBossWeb 7.3.1 and 7.4.0 beta 2, and 7.4.0 beta 4 was in DR2.

A quick test by adding -Dorg.apache.tomcat.util.Constants.ENABLE_MODELER=true shows the current 6.3 build working. It may be too late for QA to test, but I'll push the state forward since it's been committed to the code already.

Comment 10 Radim Hatlapatka 2014-07-21 10:00:19 UTC
I have verified that the it works as expected with NIO2, JIO and APR connector using EAP 6.3.0.ER10


Note You need to log in before you can comment on or make changes to this bug.