[jboss-as7-dev] Module classloader can't find JavaSE classes in AS7 testsuite?

Jaikiran Pai jpai at redhat.com
Wed Mar 23 08:02:32 EDT 2011


I'm trying to write a test in testsuite/smoke-tests. The test is pretty 
simple and has a javax.naming.Context import in it. I keep running into 
this CNFE every time I try running it:

17:12:22,623 SEVERE [org.jboss.arquillian.protocol.jmx.JMXTestRunner] 
(pool-31-thread-1) Error in test method: testLocalBindingsOnSLSB: 
java.lang.NoClassDefFoundError: javax/naming/Context
     at java.lang.Class.getDeclaredFields0(Native Method) [:1.6.0_21]
     at java.lang.Class.privateGetDeclaredFields(Class.java:2291) 
[:1.6.0_21]
     at java.lang.Class.getDeclaredFields(Class.java:1743) [:1.6.0_21]
     at 
org.jboss.as.arquillian.service.ArquillianService$TestClassLoaderImpl.isOSGiSubsystemRequired(ArquillianService.java:286)
     at 
org.jboss.as.arquillian.service.ArquillianService$TestClassLoaderImpl.loadTestClass(ArquillianService.java:268)
     at 
org.jboss.arquillian.protocol.jmx.JMXTestRunner.runTestMethodInternal(JMXTestRunner.java:140) 
[arquillian-protocol-jmx-1.0.0.Alpha4.SP9.jar:1.0.0.Alpha4.SP9]
     at 
org.jboss.arquillian.protocol.jmx.JMXTestRunner.runTestMethodEmbedded(JMXTestRunner.java:115) 
[arquillian-protocol-jmx-1.0.0.Alpha4.SP9.jar:1.0.0.Alpha4.SP9]
     at 
org.jboss.as.arquillian.service.ArquillianService$1.runTestMethodEmbedded(ArquillianService.java:126)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
[:1.6.0_21]
     at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
[:1.6.0_21]
     at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
[:1.6.0_21]
     at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_21]
     at 
com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:93) 
[:1.6.0_21]
     at 
com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:27) 
[:1.6.0_21]
     at 
com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:208) 
[:1.6.0_21]
     at 
com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:120) 
[:1.6.0_21]
     at 
com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:262) 
[:1.6.0_21]
     at javax.management.StandardMBean.invoke(StandardMBean.java:391) 
[:1.6.0_21]
     at 
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836) 
[:1.6.0_21]
     at 
com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761) 
[:1.6.0_21]
     at 
javax.management.MBeanServerInvocationHandler.invoke(MBeanServerInvocationHandler.java:288) 
[:1.6.0_21]
     at $Proxy39.runTestMethodEmbedded(Unknown Source)    at 
org.jboss.arquillian.protocol.jmx.JMXMethodExecutor$1.call(JMXMethodExecutor.java:102) 
[arquillian-protocol-jmx-1.0.0.Alpha4.SP9.jar:1.0.0.Alpha4.SP9]
     at 
org.jboss.arquillian.protocol.jmx.JMXMethodExecutor$1.call(JMXMethodExecutor.java:98) 
[arquillian-protocol-jmx-1.0.0.Alpha4.SP9.jar:1.0.0.Alpha4.SP9]
     at 
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) 
[:1.6.0_21]
     at java.util.concurrent.FutureTask.run(FutureTask.java:138) [:1.6.0_21]
     at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) 
[:1.6.0_21]
     at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) 
[:1.6.0_21]
     at java.lang.Thread.run(Thread.java:619) [:1.6.0_21]
Caused by: java.lang.ClassNotFoundException: javax.naming.Context from 
[Module "deployment.dd-based-slsb.jar:main" from Service Module Loader]
     at 
org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:184) [jboss-modules-1.0.0.Beta16.jar:1.0.0.Beta16]
     at 
org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:357) 
[jboss-modules-1.0.0.Beta16.jar:1.0.0.Beta16]
     at 
org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:329) 
[jboss-modules-1.0.0.Beta16.jar:1.0.0.Beta16]
     at 
org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:306) 
[jboss-modules-1.0.0.Beta16.jar:1.0.0.Beta16]
     at 
org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:100) 
[jboss-modules-1.0.0.Beta16.jar:1.0.0.Beta16]
     ... 29 more



Apparently, the module classloader can't find the classes from the Java 
SE runtime jar? By the way, is there a document around how AS7 testsuite 
is integrated with Arquillian and jboss-modules and what are the step 
required to get a test running (it's not straightforward, as I'm seeing 
now)? I keep running into these CNFE/NCDFE issues everytime I write a 
simple test.

-Jaikiran

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-as7-dev/attachments/20110323/236eb488/attachment.html 


More information about the jboss-as7-dev mailing list