Classloader problem - NoClassDefFoundError - JBoss class ServiceMBean
by Tapan Nanawati
Hi
I want to instantiate my service.
In my service file mbean entry is as follows -
<mbean code="com.integral.jmsx.jndi.jboss.JBossLoader" name="sonic.mq:service=JNDILoader">
<attribute name="JNDIInitClassName">com.integral.jmsx.jndi.JmsJndiInit</attribute>
<depends>jboss:service=Naming</depends>
<depends>jboss.ejb:service=EJBDeployer</depends>
<depends>jboss.jca:service=RARDeployer</depends>
</mbean>
I put some debugs in ServiceCreator and ServiceConfigurator files and I find that jboss files themselves are not in classpath!!
(Please see the following log) What might be happening here.
By the way there is no problem in the code - it is working in some other code branch.
I am trying to port the code to other jboss instance.
The jboss startup shows that all files from jboss.home/lib folder (and many more from my own server instance/lib folder ) have got loaded
Also there are other "service files" which I see have successfully got deployed.
00:28:05,542 -DEBUG [Integral5] Watching new file: file:/E:/cvs_views/jboss-4.0.5/server/integral/deploy/sonicmq-service.xml
00:28:05,548 -DEBUG [Integral5] create step for deployment file:/E:/cvs_views/jboss-4.0.5/server/integral/deploy/sonicmq-service.xml
00:28:05,553 -DEBUG [Integral5] Deploying SAR, create step: url file:/E:/cvs_views/jboss-4.0.5/server/integral/deploy/sonicmq-service.xml
00:28:05,557 -DEBUG [Integral5] Registering service UCL=jmx.loading:UCL=d647d8
MBEANS ARE []
Inside internal install
Before service creator . install
Code in Service Creator!!! com.integral.jmsx.jndi.jboss.JBossLoader
constructor isss org.jboss.system.ServiceCreator$ConstructorInfo@6cef4
00:28:05,594 -DEBUG [Integral5] About to create bean: sonic.mq:service=JNDILoader with code: com.integral.jmsx.jndi.jboss.JBossLoader
javax.management.RuntimeErrorException: instantiating com.integral.jmsx.jndi.jboss.JBossLoader failed: java.lang.NoClassDefFoundError: org/jboss/system/ServiceMBean
at org.jboss.mx.server.MBeanServerImpl.handleInstantiateExceptions(MBeanServerImpl.java:1306)
at org.jboss.mx.server.MBeanServerImpl.instantiate(MBeanServerImpl.java:1237)
at org.jboss.mx.server.MBeanServerImpl.instantiate(MBeanServerImpl.java:286)
at org.jboss.mx.server.MBeanServerImpl.createMBean(MBeanServerImpl.java:344)
at org.jboss.system.ServiceCreator.install(ServiceCreator.java:164)
at org.jboss.system.ServiceConfigurator.internalInstall(ServiceConfigurator.java:452)
at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:172)
at org.jboss.system.ServiceController.install(ServiceController.java:226)
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:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy4.install(Unknown Source)
at org.jboss.deployment.SARDeployer.create(SARDeployer.java:249)
at org.jboss.deployment.MainDeployer.create(MainDeployer.java:969)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:818)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
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:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy6.deploy(Unknown Source)
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:417)
at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy4.start(Unknown Source)
at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
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:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy5.deploy(Unknown Source)
at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:483)
at org.jboss.system.server.ServerImpl.start(ServerImpl.java:363)
at org.jboss.Main.boot(Main.java:200)
at org.jboss.Main$1.run(Main.java:490)
at java.lang.Thread.run(Thread.java:595)
NOTICE
This e-mail message and any attachments, which may contain confidential information, are to be viewed solely by the intended recipient of Integral Development Corp. If the reader of this message is not the intended recipient, you are hereby notified that any use, dissemination, distribution or copying of this communication is strictly prohibited. If you have received this message in error, please immediately notify the sender and delete the mail and all attachments.
18 years, 1 month
[JBoss Portal] - Re: Unable to use WSRP over SSL for self producer
by dkc
Chris:
Thanks for your help - I got it to work :-)
My original post had a typo (my apologies) - I am actually using https://localhost:8443 in jboss-portal.sar/portal-wsrp.sar/default-wsrp.xml.
I think the thing that fixed this for me was to add the following to the JAVA_OPTS in bin/run.conf:
-Dorg.jboss.security.ignoreHttpsHost=true
Also
"chris.laprun(a)jboss.com" wrote : Any reason you're not using 2.6.4 and 4.2.2?
I haven't upgraded to the recommended versions due to time constraints. I have seen some of the WSRP fixes that have occurred in recent versions, and I'll recommend the upgrade to my customer.
Per your recommendations (and for the benefit of others) here's what I did to configure WSRP over SSL:
- Create a keystore and a server certificate. It's important that the cn matches the hostname/domain of the JBoss Portal (for me it was localhost): keytool -alias serverCert -keyalg RSA -validity 730 -keystore server.keystore -dname cn=localhost,o=org,ou=orgunit,l=location,st=state,c=country -keypass password -storepass password
keytool -export -alias serverCert -keystore server.keystore -storepass password -file server.cer
- Copy server.keystore and server.cer to server/default/conf
- Add the following to bin/run.conf:
JAVA_OPTS="$JAVA_OPTS -Djavax.net.ssl.trustStore=/fully/qualified/path/to/server.keystore
| -Djavax.net.ssl.trustStorePassword=password
| -Dorg.jboss.security.ignoreHttpsHost=true"
- Configure another SSL/TLS connector in the Tomcat config file that is used by JBoss Web (at server/default/deploy/jboss-web.deployer/server.xml) We're adding a new connector - leave the existing connector in place:
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
| maxThreads="150" scheme="https" secure="true"
| clientAuth="false" sslProtocol="TLS"
| keystoreFile="/fully/qualified/path/to/server.keystore"
| keystorePass="password" />
- Update server/default/deploy/jboss-portal.sar/portal-wsrp.sar/default-wsrp.xml. Comment-out the "self" wsrp-producer deployment on your non-SSL port, and add the following:
| <deployment>
| <wsrp-producer id="self" expiration-cache="300">
| <endpoint-config>
| <service-description-url>https://localhost:8443/portal-wsrp/ServiceDescriptionService</service-description-url>
| <markup-url>https://localhost:8443/portal-wsrp/MarkupService</markup-url>
| <registration-url>https://localhost:8443/portal-wsrp/RegistrationService</registration-url>
| <portlet-management-url>https://localhost:8443/portal-wsrp/PortletManagementService</portlet-management-url>
| </endpoint-config>
| <registration-data/>
| </wsrp-producer>
| </deployment>
|
- If you need to turn on SSL debugging, add the following to bin/run.conf:
JAVA_OPTS="$JAVA_OPTS -Djavax.net.debug=ssl,handshake"
- (Re)start JBoss. You may have to save and refresh the settings for the "self" WSRP producer from the JBoss Admin WSRP tab.
- Import the server.cer certificate into your browser's authorities to inform your browser that the server certificate is trusted.
- You should be able to access JBoss over SSL at https://localhost:8443/portal
Dan
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4136759#4136759
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4136759
18 years, 1 month