[ 
https://issues.apache.org/jira/browse/AMQ-3633?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15176227#comment-15176227
 ] 

David Jencks commented on AMQ-3633:
-----------------------------------

Based on some experiments I'm doing with the activemq web console installed as 
an esa in WAS Liberty (which runs on equinox) I very much doubt this is a 
problem that can be solved in activemq.  The problem appears to be that the jdk 
code is attempting to use a bundle classloader to load it's own classes.  I 
find that adding the relevant package to the boot delegation allows this to 
work.  For me this is done by adding the framework property

org.osgi.framework.bootdelegation=javax.management.remote.rmi

You might need other boot delegation packages as well, so this particular 
setting might not be appropriate everywhere.

Equinox can also have implicit boot delegation, although this seems to have a 
fairly large performance penalty.  I'm not sure which versions of equinox have 
this on or off by default; this might explain the difference in behavior 
between equinox 3.6 and 3.8.  To turn it on (unless otherwise disabled by 
launch code):

osgi.context.bootdelegation=true


> [OSGi] activemq-web-console: exception after restart container
> --------------------------------------------------------------
>
>                 Key: AMQ-3633
>                 URL: https://issues.apache.org/jira/browse/AMQ-3633
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 5.5.0
>         Environment: karaf 2.2.4
>            Reporter: Alexey Markevich
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 5.7.0
>
>
> I installed activemq-web-console feature as described in [1].
> Afer restart container there is exception in console:
> 2011-12-13 14:51:32,906 [.ops4j.pax.web)] INFO  XBeanXmlBeanDefinitionReader  
>  - Loading XML bean definitions from ServletContext resource 
> [/WEB-INF/activemq.xml]
> Exception in thread "JMX Connector Thread 
> [service:jmx:rmi://localhost:44444/jndi/rmi://localhost:1099/karaf-root]" 
> java.lang.RuntimeException: Could not start JMX connector server
>         at 
> org.apache.karaf.management.ConnectorServerFactory$1.run(ConnectorServerFactory.java:234)
> Caused by: java.io.IOException: Cannot bind to URL 
> [rmi://localhost:1099/karaf-root]: javax.naming.CommunicationException [Root 
> exception is java.rmi.ServerException: RemoteException occurred in serve
> r thread; nested exception is:
>         java.rmi.UnmarshalException: error unmarshalling arguments; nested 
> exception is:
>         java.lang.ClassNotFoundException: 
> javax.management.remote.rmi.RMIServerImpl_Stub not found by 
> org.apache.activemq.activemq-web-console [78] (no security manager: RMI class 
> loader disabled)]
>         at 
> javax.management.remote.rmi.RMIConnectorServer.newIOException(RMIConnectorServer.java:804)
>         at 
> javax.management.remote.rmi.RMIConnectorServer.start(RMIConnectorServer.java:417)
>         at 
> org.apache.karaf.management.ConnectorServerFactory$1.run(ConnectorServerFactory.java:232)
> Caused by: javax.naming.CommunicationException [Root exception is 
> java.rmi.ServerException: RemoteException occurred in server thread; nested 
> exception is:
>         java.rmi.UnmarshalException: error unmarshalling arguments; nested 
> exception is:
>         java.lang.ClassNotFoundException: 
> javax.management.remote.rmi.RMIServerImpl_Stub not found by 
> org.apache.activemq.activemq-web-console [78] (no security manager: RMI class 
> loader disabled)]
>         at 
> com.sun.jndi.rmi.registry.RegistryContext.bind(RegistryContext.java:126)
>         at 
> com.sun.jndi.toolkit.url.GenericURLContext.bind(GenericURLContext.java:208)
>         at javax.naming.InitialContext.bind(InitialContext.java:400)
>         at 
> javax.management.remote.rmi.RMIConnectorServer.bind(RMIConnectorServer.java:625)
>         at 
> javax.management.remote.rmi.RMIConnectorServer.start(RMIConnectorServer.java:412)
>         ... 1 more
> Caused by: java.rmi.ServerException: RemoteException occurred in server 
> thread; nested exception is:
>         java.rmi.UnmarshalException: error unmarshalling arguments; nested 
> exception is:
>         java.lang.ClassNotFoundException: 
> javax.management.remote.rmi.RMIServerImpl_Stub not found by 
> org.apache.activemq.activemq-web-console [78] (no security manager: RMI class 
> loader disabled)
>         at 
> sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:400)
>         at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:248)
>         at sun.rmi.transport.Transport$1.run(Transport.java:159)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
>         at 
> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
>         at 
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
>         at 
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
>         at 
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>         at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>         at java.lang.Thread.run(Thread.java:662)
>         at 
> sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
>         at 
> sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
>         at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:359)
>         at sun.rmi.registry.RegistryImpl_Stub.bind(Unknown Source)
>         at 
> com.sun.jndi.rmi.registry.RegistryContext.bind(RegistryContext.java:120)
>         ... 5 more
> Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested 
> exception is:
>         java.lang.ClassNotFoundException: 
> javax.management.remote.rmi.RMIServerImpl_Stub not found by 
> org.apache.activemq.activemq-web-console [78] (no security manager: RMI class 
> loader disabled)
>         at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
>         at 
> sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:390)
>         at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:248)
>         at sun.rmi.transport.Transport$1.run(Transport.java:159)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
>         at 
> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
>         at 
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
>         at 
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
>         at 
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>         at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>         at java.lang.Thread.run(Thread.java:662)
> Caused by: java.lang.ClassNotFoundException: 
> javax.management.remote.rmi.RMIServerImpl_Stub not found by 
> org.apache.activemq.activemq-web-console [78] (no security manager: RMI class 
> loader disabled)
>         at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:373)
>         at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:163)
>         at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:620)
>         at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:247)
>         at 
> sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:197)
>         at 
> java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1574)
>         at 
> java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1495)
>         at 
> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1731)
>         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
>         at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
>         ... 12 more
> 1. http://activemq.apache.org/osgi-integration.html



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to