The following error appeared at Tomcat/OpenEJB startup after upgrading to OpenEJB 3.1.3:
ERROR - Unable to register MBean
java.lang.IllegalStateException: javax.management.MalformedObjectNameException: Invalid character ',' in key part of property
at org.apache.openejb.monitoring.ObjectNameBuilder.build(ObjectNameBuilder.java:59)
at org.apache.openejb.core.mdb.MdbContainer.deploy(MdbContainer.java:169)
at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:599)
at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:450)
at org.apache.openejb.assembler.classic.Assembler.buildContainerSystem(Assembler.java:368)
at org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:280)
at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:125)
at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:60)
at org.apache.openejb.OpenEJB.init(OpenEJB.java:271)
at org.apache.openejb.OpenEJB.init(OpenEJB.java:250)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.openejb.loader.OpenEJBInstance.init(OpenEJBInstance.java:36)
at org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:71)
at org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:53)
at org.apache.openejb.client.LocalInitialContextFactory.getInitialContext(LocalInitialContextFactory.java:42)
...
<proprietary stack trace skipped>
...
Caused by: javax.management.MalformedObjectNameException: Invalid character ',' in key part of property
at javax.management.ObjectName.construct(ObjectName.java:535)
at javax.management.ObjectName.<init>(ObjectName.java:1403)
at org.apache.openejb.monitoring.ObjectNameBuilder.build(ObjectNameBuilder.java:57)
... 70 more
INFO - Created Ejb(deployment-id=InboundXMLQueueHandlerST,InboundXMLQueueHandlerMT, ejb-name=InboundXMLQueueHandlerST,InboundXMLQueueHandlerMT, container=My MDB Container )
The following MDB causes this error:
@MessageDriven(name="InboundXMLQueueHandlerST,InboundXMLQueueHandlerMT")
public class InboundXMLQueueHandler implements MessageListener {
...
because after changing to
@MessageDriven(name="InboundXMLQueueHandlerST")
public class InboundXMLQueueHandler implements MessageListener {
...
error is gone.
As you can see we define two listeners using single class and comma-separated queue names in annotations. This worked flawlessly with 3.1.2 (at least it seemed) but now it gives us the error above (though the error doesn't seem to prevent the deployment of MDBs but JMX monitoring is critical to us).
I am unable to find any example of usage @MessageDriven
annotation with multiple queues (single MDB class, multiple comma-separated queue names) anymore either. Is this a wrong way do it? Is it a documented feature? What changed in 3.1.3 so that JMX can't register MDB anymore?