0 Replies Latest reply on Jul 29, 2013 1:31 PM by Jeremy Whiting

    Class not found

    Jeremy Whiting Expert

      Hi,

      I am getting a CNFE for weblogic.rmi.extensions.DisconnectListener when running Arquillian.

      My configuration is setup to use Weblogic 12.1 remote container adapter.

       

      arquillian-wls-remote-12.1:1.0.0.Alpha2

       

      This is the profile configuration for maven

       

      <id>arq-weblogic-remote</id>

                  <dependencies>

                      <dependency>

                          <groupId>org.jboss.arquillian.container</groupId>

                          <artifactId>arquillian-wls-remote-12.1</artifactId>

                          <version>1.0.0.Alpha2</version>

                          <scope>test</scope>

                      </dependency>

                  </dependencies>

                  <build>

                      <plugins>

                          <plugin>

                              <groupId>org.apache.maven.plugins</groupId>

                              <artifactId>maven-surefire-plugin</artifactId>

                          </plugin>

                      </plugins>

                  </build>

       

      and this is the arquillian config

       

      <container qualifier="wls">

              <configuration>

                      <property name="adminUrl">t3://acme.com:7001</property>

                      <property name="adminUserName">duff</property>

                      <property name="adminPassword">beer</property>

                      <property name="wlsHome">/tmp/wls/wlserver_12.1</property>

                      <property name="target">AdminServer</property>

              </configuration>

      </container>

       

      When running the unit test I have on the command line I get this error.

       

      java.lang.NoClassDefFoundError: weblogic/rmi/extensions/DisconnectListener

          at java.lang.ClassLoader.defineClass1(Native Method)

          at java.lang.ClassLoader.defineClass(ClassLoader.java:792)

          at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)

          at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)

          at java.net.URLClassLoader.access$100(URLClassLoader.java:71)

          at java.net.URLClassLoader$1.run(URLClassLoader.java:361)

          at java.net.URLClassLoader$1.run(URLClassLoader.java:355)

          at java.security.AccessController.doPrivileged(Native Method)

          at java.net.URLClassLoader.findClass(URLClassLoader.java:354)

          at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

          at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

          at org.jboss.arquillian.container.wls.WebLogicJMXLibClassLoader.loadClass(WebLogicJMXLibClassLoader.java:60)

          at java.lang.Class.forName0(Native Method)

          at java.lang.Class.forName(Class.java:270)

          at javax.management.remote.JMXConnectorFactory.getProvider(JMXConnectorFactory.java:517)

          at javax.management.remote.JMXConnectorFactory.getProvider(JMXConnectorFactory.java:427)

          at javax.management.remote.JMXConnectorFactory.newJMXConnector(JMXConnectorFactory.java:328)

          at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:267)

          at org.jboss.arquillian.container.wls.WebLogicJMXClient.createConnection(WebLogicJMXClient.java:480)

          at org.jboss.arquillian.container.wls.WebLogicJMXClient.&lt;init&gt;(WebLogicJMXClient.java:290)

          at org.jboss.arquillian.container.wls.remote_12_1.WebLogicContainer.start(WebLogicContainer.java:58)

          at org.jboss.arquillian.container.impl.ContainerImpl.start(ContainerImpl.java:199)

          at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController$8.perform(ContainerLifecycleController.java:163)

          at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController$8.perform(ContainerLifecycleController.java:157)

          at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController.forContainer(ContainerLifecycleController.java:255)

          at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController.startContainer(ContainerLifecycleController.java:156)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:606)

          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

          at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)

          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)

          at org.jboss.arquillian.container.impl.client.ContainerDeploymentContextHandler.createContainerContext(ContainerDeploymentContextHandler.java:57)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:606)

          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

          at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)

          at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)

          at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)

          at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController$2.perform(ContainerLifecycleController.java:77)

          at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController$2.perform(ContainerLifecycleController.java:70)

          at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController.forEachSuiteContainer(ContainerLifecycleController.java:221)

          at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController.startSuiteContainers(ContainerLifecycleController.java:69)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:606)

          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

          at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)

          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)

          at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)

          at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)

          at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)

          at org.jboss.arquillian.container.test.impl.client.ContainerEventController.execute(ContainerEventController.java:86)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:606)

          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

          at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)

          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)

          at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:60)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:606)

          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

          at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)

          at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)

          at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.beforeSuite(EventTestRunnerAdaptor.java:68)

          at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:97)

          at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)

          at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123)

          at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:606)

          at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)

          at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)

          at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)

          at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:107)

          at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:68)

      Caused by: java.lang.ClassNotFoundException: weblogic.rmi.extensions.DisconnectListener

          at java.net.URLClassLoader$1.run(URLClassLoader.java:366)

          at java.net.URLClassLoader$1.run(URLClassLoader.java:355)

          at java.security.AccessController.doPrivileged(Native Method)

          at java.net.URLClassLoader.findClass(URLClassLoader.java:354)

          at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

          at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

          at org.jboss.arquillian.container.wls.WebLogicJMXLibClassLoader.loadClass(WebLogicJMXLibClassLoader.java:60)

          ... 88 more

      Caused by: java.lang.ClassNotFoundException: weblogic.rmi.extensions.DisconnectListener

          at java.net.URLClassLoader$1.run(URLClassLoader.java:366)

          at java.net.URLClassLoader$1.run(URLClassLoader.java:355)

          at java.security.AccessController.doPrivileged(Native Method)

          at java.net.URLClassLoader.findClass(URLClassLoader.java:354)

          at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

          at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

          at org.jboss.arquillian.container.wls.WebLogicJMXLibClassLoader.loadClass(WebLogicJMXLibClassLoader.java:60)

          ... 88 more

       

      The classpath at runtime for the jvm process  is this:

       

      surefire.test.class.path = /tmp/somewhere/EntityAssociationTest/target/test-classes:/tmp/somewhere/EntityAssociationTest/target/classes:/home/someone/.m2/repository/org/jboss/arquillian/junit/arquillian-junit-container/1.1.0.Final/arquillian-junit-container-1.1.0.Final.jar:/home/someone/.m2/repository/org/jboss/arquillian/junit/arquillian-junit-core/1.1.0.Final/arquillian-junit-core-1.1.0.Final.jar:/home/someone/.m2/repository/org/jboss/arquillian/test/arquillian-test-api/1.1.0.Final/arquillian-test-api-1.1.0.Final.jar:/home/someone/.m2/repository/org/jboss/arquillian/core/arquillian-core-api/1.1.0.Final/arquillian-core-api-1.1.0.Final.jar:/home/someone/.m2/repository/org/jboss/arquillian/test/arquillian-test-spi/1.1.0.Final/arquillian-test-spi-1.1.0.Final.jar:/home/someone/.m2/repository/org/jboss/arquillian/core/arquillian-core-spi/1.1.0.Final/arquillian-core-spi-1.1.0.Final.jar:/home/someone/.m2/repository/org/jboss/arquillian/container/arquillian-container-test-api/1.1.0.Final/arquillian-container-test-api-1.1.0.Final.jar:/home/someone/.m2/repository/org/jboss/shrinkwrap/shrinkwrap-api/1.1.2/shrinkwrap-api-1.1.2.jar:/home/someone/.m2/repository/org/jboss/arquillian/container/arquillian-container-test-spi/1.1.0.Final/arquillian-container-test-spi-1.1.0.Final.jar:/home/someone/.m2/repository/org/jboss/arquillian/core/arquillian-core-impl-base/1.1.0.Final/arquillian-core-impl-base-1.1.0.Final.jar:/home/someone/.m2/repository/org/jboss/arquillian/test/arquillian-test-impl-base/1.1.0.Final/arquillian-test-impl-base-1.1.0.Final.jar:/home/someone/.m2/repository/org/jboss/arquillian/container/arquillian-container-impl-base/1.1.0.Final/arquillian-container-impl-base-1.1.0.Final.jar:/home/someone/.m2/repository/org/jboss/arquillian/config/arquillian-config-api/1.1.0.Final/arquillian-config-api-1.1.0.Final.jar:/home/someone/.m2/repository/org/jboss/arquillian/config/arquillian-config-impl-base/1.1.0.Final/arquillian-config-impl-base-1.1.0.Final.jar:/home/someone/.m2/repository/org/jboss/shrinkwrap/descriptors/shrinkwrap-descriptors-spi/2.0.0-alpha-3/shrinkwrap-descriptors-spi-2.0.0-alpha-3.jar:/home/someone/.m2/repository/org/jboss/arquillian/container/arquillian-container-test-impl-base/1.1.0.Final/arquillian-container-test-impl-base-1.1.0.Final.jar:/home/someone/.m2/repository/org/jboss/shrinkwrap/shrinkwrap-impl-base/1.1.2/shrinkwrap-impl-base-1.1.2.jar:/home/someone/.m2/repository/org/jboss/shrinkwrap/shrinkwrap-spi/1.1.2/shrinkwrap-spi-1.1.2.jar:/home/someone/.m2/repository/org/jboss/spec/javax/ejb/jboss-ejb-api_3.1_spec/1.0.1.Final/jboss-ejb-api_3.1_spec-1.0.1.Final.jar:/home/someone/.m2/repository/org/hibernate/javax/persistence/hibernate-jpa-2.0-api/1.0.1.Final/hibernate-jpa-2.0-api-1.0.1.Final.jar:/home/someone/.m2/repository/org/jboss/spec/javax/annotation/jboss-annotations-api_1.1_spec/1.0.1.Final/jboss-annotations-api_1.1_spec-1.0.1.Final.jar:/home/someone/.m2/repository/junit/junit/4.10/junit-4.10.jar:/home/someone/.m2/repository/org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1.jar:/home/someone/.m2/repository/org/jboss/arquillian/container/arquillian-wls-remote-12.1/1.0.0.Alpha2/arquillian-wls-remote-12.1-1.0.0.Alpha2.jar:/home/someone/.m2/repository/org/jboss/arquillian/container/arquillian-wls-common/1.0.0.Alpha2/arquillian-wls-common-1.0.0.Alpha2.jar:/home/someone/.m2/repository/org/jboss/arquillian/container/arquillian-container-spi/1.1.0.Final/arquillian-container-spi-1.1.0.Final.jar:/home/someone/.m2/repository/org/jboss/shrinkwrap/descriptors/shrinkwrap-descriptors-api-base/2.0.0-alpha-3/shrinkwrap-descriptors-api-base-2.0.0-alpha-3.jar:/home/someone/.m2/repository/org/jboss/arquillian/protocol/arquillian-protocol-servlet/1.1.0.Final/arquillian-protocol-servlet-1.1.0.Final.jar:/home/someone/.m2/repository/org/jboss/arquillian/testenricher/arquillian-testenricher-cdi/1.1.0.Final/arquillian-testenricher-cdi-1.1.0.Final.jar:/home/someone/.m2/repository/org/jboss/arquillian/testenricher/arquillian-testenricher-resource/1.1.0.Final/arquillian-testenricher-resource-1.1.0.Final.jar:/home/someone/.m2/repository/org/jboss/arquillian/testenricher/arquillian-testenricher-ejb/1.1.0.Final/arquillian-testenricher-ejb-1.1.0.Final.jar:/home/someone/.m2/repository/org/jboss/arquillian/testenricher/arquillian-testenricher-initialcontext/1.1.0.Final/arquillian-testenricher-initialcontext-1.1.0.Final.jar:

       

      which is missing the weblogic.jar

       

      But running the test using a debugger the CommonWebLogicConfiguration.weblogicJarPath builds a path that is found on the system.

       

      /tmp/wls/wlserver_12.1/server/lib/weblogic.jar

       

      Is there something I should be adding to the configuration to add the path to the jvm when surefire starts the test ?

       

      Regards,

      Jeremy