1 Reply Latest reply on Nov 25, 2015 3:28 AM by Kamran Ahmed

    java.lang.NoClassDefFoundError: oracle/sql/ORAData during Arquillian Test execution

    Kamran Ahmed Newbie

      Hi,

       

      I am new to Arquillian, just have basic understanding on its usage.

      I am stuck with one problem during test execution, i have tried a lot but could not get through.

      The problem i am facing is somehow similar to Re: Arquillian Persistence questions and a possible bug in 1.0.0.Alpha5 on an Oracle database .

       

      But unfortunately it has not been answered yet.

      Let me explain the problem in details.

       

      We have following hierarchy of archives as deployment unit.

           xyz-main.ear

        1. lib/<all third party jars>
        2. xyz-main-lib.jar/<contains some singleton EJB timer services which executes on scheduled time>
        3. xyz-dao-lib.jar[used by item#2]
        4. common-lib.jar/<Few common classes to be used by other modules> [used by item#2]

       

      Code base pom.xml hierarchy:
      <project>
          ...
        <modules>
            <module>source</module><!-- xyz-main-lib.jar -->
            <module>ear</module><!-- xyz-main.ear -->
            <module>test</module><!-- Contains Integration Tests of  xyz-main-lib.jar -->
        </modules>
          ...
      </project>

       

      arquillian.xml, test pom.xml fragment and dataset being used are attached.

       

      We are using Oracle 11g as Database and Arquillian Persistence Extension for DB-Unit functionalities.

      We had a requirement to persist some entities before test execution, so we decided to use arquillian-persistence-extension but stuck with 'nvarchar2' datatype.

       

      Code fragment for Test Case:

       

      @Deployment

      public static EnterpriseArchive createDeployment() {

       

            EnterpriseArchive mainEar= ShrinkWrap.create(ZipImporter.class, "xyz-main.ear")

                    .importFrom(new File(System.getenv("APP_HOME") + "/main-project/ear/target/xyz-main.ear"))

                    .as(EnterpriseArchive.class);

       

            final JavaArchive integrationTestArchive = ShrinkWrap.create(JavaArchive.class, "tests.jar");

            integrationTestArchive.addClasses(TestClassName.class);

            integrationTestArchive.addAsManifestResource(new File(Thread.currentThread().getContextClassLoader().getResource("persistence.xml").getFile()), "resources/persistence.xml");

            mainEar.addAsModule(integrationTestArchive);

       

          return mainEar;

        }

       

        @Test

        @UsingDataSet("dataset.xml")

        @Transactional

        @Cleanup(phase = TestExecutionPhase.BEFORE, strategy = CleanupStrategy.USED_ROWS_ONLY)

      public void verifyData(){

          // Verification of persisted object

      }

       

      Problem:

       

      We have 'NVARCHAR2' for Arabic Data e.g. AR_DESC in dataset.xml .

      If <property name="datatypeFactory">org.dbunit.dataset.datatype.DefaultDataTypeFactory</property> is being used in arquillian.xml and there is no column in dataset.xml of type NVARCHAR2, the record will get persisted easily with some warning as given below.

       

      (1111, 'NVARCHAR2') not recognized and will be ignored. See FAQ for more information.

      Potential problem found: The configured data type factory 'class org.dbunit.dataset.datatype.DefaultDataTypeFactory' might cause problems with the current database 'Oracle' (e.g. some datatypes may not be supported properly). In rare cases you might see this message because the list of supported database products is incomplete (list=[derby]). If so please request a java-class update via the forums.If you are using your own IDataTypeFactory extending DefaultDataTypeFactory, ensure that you override getValidDbProducts() to specify the supported database products.

       

      When we update 'datatypeFactory' to org.dbunit.ext.oracle.Oracle10DataTypeFactory it starts throwing a different exception which is sort of annoying for us.

      Provided that ojdbc6.jar is available in ear's lib folder as well as in jboss module.

       

      12:12:16,607 WARN  [org.jboss.modules] (pool-1-thread-1) Failed to define class org.dbunit.ext.oracle.OracleSdoGeometry in Module "deployment.arquillian-service:main" from Service Module Loader: java.lang.LinkageError: Failed to link org/dbunit/ext/oracle/OracleSdoGeometry (Module "deployment.arquillian-service:main" from Service Module Loader)

        at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:407) [jboss-modules.jar:1.2.0.CR1]

        at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:254) [jboss-modules.jar:1.2.0.CR1]

        at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:73) [jboss-modules.jar:1.2.0.CR1]

        at org.jboss.modules.Module.loadModuleClass(Module.java:518) [jboss-modules.jar:1.2.0.CR1]

        at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:182) [jboss-modules.jar:1.2.0.CR1]

        at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.2.0.CR1]

        at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.2.0.CR1]

        at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.2.0.CR1]

        at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [jboss-modules.jar:1.2.0.CR1]

        at org.dbunit.ext.oracle.OracleSdoGeometryDataType.<init>(OracleSdoGeometryDataType.java:143) [arquillian-service:]

        at org.dbunit.ext.oracle.OracleDataTypeFactory.<clinit>(OracleDataTypeFactory.java:57) [arquillian-service:]

        at java.lang.Class.forName0(Native Method) [rt.jar:1.7.0_45]

        at java.lang.Class.forName(Class.java:190) [rt.jar:1.7.0_45]

        at org.jboss.arquillian.persistence.core.configuration.ConfigurationTypeConverter.convert(ConfigurationTypeConverter.java:191) [arquillian-service:]

        at org.jboss.arquillian.persistence.core.configuration.ConfigurationImporter.createConfiguration(ConfigurationImporter.java:153) [arquillian-service:]

        at org.jboss.arquillian.persistence.core.configuration.ConfigurationImporter.createFrom(ConfigurationImporter.java:105) [arquillian-service:]

        at org.jboss.arquillian.persistence.core.configuration.ConfigurationImporter.loadFromPropertyFile(ConfigurationImporter.java:80) [arquillian-service:]

        at org.jboss.arquillian.persistence.dbunit.configuration.DBUnitConfigurationRemoteProducer.configure(DBUnitConfigurationRemoteProducer.java:43) [arquillian-service:]

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_45]

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_45]

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_45]

        at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_45]

        at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94) [arquillian-service:]

        at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99) [arquillian-service:]

        at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81) [arquillian-service:]

        at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145) [arquillian-service:]

        at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:116) [arquillian-service:]

        at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67) [arquillian-service:]

        at org.jboss.arquillian.persistence.core.lifecycle.PersistenceTestTrigger.beforeClass(PersistenceTestTrigger.java:99) [arquillian-service:]

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_45]

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_45]

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_45]

        at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_45]

        at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94) [arquillian-service:]

        at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99) [arquillian-service:]

        at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81) [arquillian-service:]

        at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:92) [arquillian-service:]

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_45]

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_45]

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_45]

        at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_45]

        at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94) [arquillian-service:]

        at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88) [arquillian-service:]

        at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:73) [arquillian-service:]

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_45]

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_45]

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_45]

        at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_45]

        at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94) [arquillian-service:]

        at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88) [arquillian-service:]

        at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145) [arquillian-service:]

        at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:116) [arquillian-service:]

        at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.beforeClass(EventTestRunnerAdaptor.java:87) [arquillian-service:]

        at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:201) [arquillian-service:]

        at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:422) [arquillian-service:]

        at org.jboss.arquillian.junit.Arquillian.access$200(Arquillian.java:54) [arquillian-service:]

        at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:218) [arquillian-service:]

        at org.junit.runners.ParentRunner.run(ParentRunner.java:309) [arquillian-service:]

        at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:166) [arquillian-service:]

        at org.junit.runner.JUnitCore.run(JUnitCore.java:160) [arquillian-service:]

        at org.junit.runner.JUnitCore.run(JUnitCore.java:138) [arquillian-service:]

        at org.jboss.arquillian.junit.container.JUnitTestRunner.execute(JUnitTestRunner.java:66) [arquillian-service:]

        at org.jboss.arquillian.protocol.jmx.JMXTestRunner.doRunTestMethod(JMXTestRunner.java:180) [arquillian-service:]

        at org.jboss.arquillian.protocol.jmx.JMXTestRunner.runTestMethodInternal(JMXTestRunner.java:162) [arquillian-service:]

        at org.jboss.arquillian.protocol.jmx.JMXTestRunner.runTestMethod(JMXTestRunner.java:120) [arquillian-service:]

        at org.jboss.as.arquillian.service.ArquillianService$ExtendedJMXTestRunner.runTestMethod(ArquillianService.java:214) [arquillian-service:]

        at org.jboss.arquillian.protocol.jmx.JMXTestRunner.runTestMethod(JMXTestRunner.java:137) [arquillian-service:]

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_45]

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_45]

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_45]

        at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_45]

        at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:75) [rt.jar:1.7.0_45]

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_45]

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_45]

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_45]

        at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_45]

        at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:279) [rt.jar:1.7.0_45]

        at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:112) [rt.jar:1.7.0_45]

        at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:46) [rt.jar:1.7.0_45]

        at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:237) [rt.jar:1.7.0_45]

        at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:138) [rt.jar:1.7.0_45]

        at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:252) [rt.jar:1.7.0_45]

        at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) [rt.jar:1.7.0_45]

        at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) [rt.jar:1.7.0_45]

        at org.jboss.as.jmx.PluggableMBeanServerImpl$TcclMBeanServer.invoke(PluggableMBeanServerImpl.java:527)

        at org.jboss.as.jmx.PluggableMBeanServerImpl.invoke(PluggableMBeanServerImpl.java:263)

        at org.jboss.remotingjmx.protocol.v2.ServerProxy$InvokeHandler.handle(ServerProxy.java:915)

        at org.jboss.remotingjmx.protocol.v2.ServerCommon$MessageReciever$1.run(ServerCommon.java:152)

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_45]

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_45]

        at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_45]

      Caused by: java.lang.NoClassDefFoundError: oracle/sql/ORAData

        at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.7.0_45]

        at java.lang.ClassLoader.defineClass(ClassLoader.java:800) [rt.jar:1.7.0_45]

        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) [rt.jar:1.7.0_45]

        at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:338) [jboss-modules.jar:1.2.0.CR1]

        at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:402) [jboss-modules.jar:1.2.0.CR1]

        ... 90 more

      Caused by: java.lang.ClassNotFoundException: oracle.sql.ORAData from [Module "deployment.arquillian-service:main" from Service Module Loader]

        at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) [jboss-modules.jar:1.2.0.CR1]

        at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.2.0.CR1]

        at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.2.0.CR1]

        at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.2.0.CR1]

        at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [jboss-modules.jar:1.2.0.CR1]

        ... 95 more

       

       

      12:12:16,622 SEVERE [org.jboss.arquillian.protocol.jmx.JMXTestRunner] (pool-1-thread-1) Failed: com.TestClass.testMethodName:

      java.lang.NoClassDefFoundError: org/dbunit/ext/oracle/OracleSdoGeometry

        at org.dbunit.ext.oracle.OracleSdoGeometryDataType.<init>(OracleSdoGeometryDataType.java:143) [arquillian-service:]

        at org.dbunit.ext.oracle.OracleDataTypeFactory.<clinit>(OracleDataTypeFactory.java:57) [arquillian-service:]

        at java.lang.Class.forName0(Native Method) [rt.jar:1.7.0_45]

        at java.lang.Class.forName(Class.java:190) [rt.jar:1.7.0_45]

        at org.jboss.arquillian.persistence.core.configuration.ConfigurationTypeConverter.convert(ConfigurationTypeConverter.java:191) [arquillian-service:]

        at org.jboss.arquillian.persistence.core.configuration.ConfigurationImporter.createConfiguration(ConfigurationImporter.java:153) [arquillian-service:]

        at org.jboss.arquillian.persistence.core.configuration.ConfigurationImporter.createFrom(ConfigurationImporter.java:105) [arquillian-service:]

        at org.jboss.arquillian.persistence.core.configuration.ConfigurationImporter.loadFromPropertyFile(ConfigurationImporter.java:80) [arquillian-service:]

        at org.jboss.arquillian.persistence.dbunit.configuration.DBUnitConfigurationRemoteProducer.configure(DBUnitConfigurationRemoteProducer.java:43) [arquillian-service:]

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_45]

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_45]

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_45]

        at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_45]

        at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94) [arquillian-service:]

        at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99) [arquillian-service:]

        at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81) [arquillian-service:]

        at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145) [arquillian-service:]

        at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:116) [arquillian-service:]

        at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67) [arquillian-service:]

        at org.jboss.arquillian.persistence.core.lifecycle.PersistenceTestTrigger.beforeClass(PersistenceTestTrigger.java:99) [arquillian-service:]

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_45]

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_45]

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_45]

        at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_45]

        at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94) [arquillian-service:]

        at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99) [arquillian-service:]

        at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81) [arquillian-service:]

        at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:92) [arquillian-service:]

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_45]

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_45]

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_45]

        at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_45]

        at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94) [arquillian-service:]

        at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88) [arquillian-service:]

        at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:73) [arquillian-service:]

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_45]

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_45]

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_45]

        at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_45]

        at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94) [arquillian-service:]

        at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88) [arquillian-service:]

        at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145) [arquillian-service:]

        at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:116) [arquillian-service:]

        at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.beforeClass(EventTestRunnerAdaptor.java:87) [arquillian-service:]

        at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:201) [arquillian-service:]

        at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:422) [arquillian-service:]

        at org.jboss.arquillian.junit.Arquillian.access$200(Arquillian.java:54) [arquillian-service:]

        at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:218) [arquillian-service:]

        at org.junit.runners.ParentRunner.run(ParentRunner.java:309) [arquillian-service:]

        at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:166) [arquillian-service:]

        at org.junit.runner.JUnitCore.run(JUnitCore.java:160) [arquillian-service:]

        at org.junit.runner.JUnitCore.run(JUnitCore.java:138) [arquillian-service:]

        at org.jboss.arquillian.junit.container.JUnitTestRunner.execute(JUnitTestRunner.java:66) [arquillian-service:]

        at org.jboss.arquillian.protocol.jmx.JMXTestRunner.doRunTestMethod(JMXTestRunner.java:180) [arquillian-service:]

        at org.jboss.arquillian.protocol.jmx.JMXTestRunner.runTestMethodInternal(JMXTestRunner.java:162) [arquillian-service:]

        at org.jboss.arquillian.protocol.jmx.JMXTestRunner.runTestMethod(JMXTestRunner.java:120) [arquillian-service:]

        at org.jboss.as.arquillian.service.ArquillianService$ExtendedJMXTestRunner.runTestMethod(ArquillianService.java:214) [arquillian-service:]

        at org.jboss.arquillian.protocol.jmx.JMXTestRunner.runTestMethod(JMXTestRunner.java:137) [arquillian-service:]

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_45]

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_45]

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_45]

        at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_45]

        at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:75) [rt.jar:1.7.0_45]

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_45]

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_45]

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_45]

        at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_45]

        at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:279) [rt.jar:1.7.0_45]

        at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:112) [rt.jar:1.7.0_45]

        at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:46) [rt.jar:1.7.0_45]

        at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:237) [rt.jar:1.7.0_45]

        at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:138) [rt.jar:1.7.0_45]

        at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:252) [rt.jar:1.7.0_45]

        at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) [rt.jar:1.7.0_45]

        at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) [rt.jar:1.7.0_45]

        at org.jboss.as.jmx.PluggableMBeanServerImpl$TcclMBeanServer.invoke(PluggableMBeanServerImpl.java:527)

        at org.jboss.as.jmx.PluggableMBeanServerImpl.invoke(PluggableMBeanServerImpl.java:263)

        at org.jboss.remotingjmx.protocol.v2.ServerProxy$InvokeHandler.handle(ServerProxy.java:915)

        at org.jboss.remotingjmx.protocol.v2.ServerCommon$MessageReciever$1.run(ServerCommon.java:152)

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_45]

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_45]

        at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_45]

      Caused by: java.lang.ClassNotFoundException: org.dbunit.ext.oracle.OracleSdoGeometry from [Module "deployment.arquillian-service:main" from Service Module Loader]

        at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) [jboss-modules.jar:1.2.0.CR1]

        at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.2.0.CR1]

        at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.2.0.CR1]

        at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.2.0.CR1]

        at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [jboss-modules.jar:1.2.0.CR1]

        ... 82 more

       

       

       

      Please help me to get rid of this problem, let me know if you need more information.

        • 1. Re: java.lang.NoClassDefFoundError: oracle/sql/ORAData during Arquillian Test execution
          Kamran Ahmed Newbie

          This issue has been resolved.

           

           

          Actual problem was in project structure itself.

           

           

          Following were the issue:

           

           

          1. We were having Test as a module
          2. During Test execution we were building .ear file and were adding Test module jar in .ear
          3. Test module requiring multiple libraries those need to be added as dependencies of Test module jar(we were not providing those dependencies during making jar using ShrinkWrap APIs)

           

           

          What we did:

           

           

          1. We used test folder inside EJBs lib module
          2. As a Test configuration we created dummy war and added all dependencies in in including EJBs module jar

           

           

          Here is the sample for what we did in Test Class.

           

            

           

              public static Archive<?> prepareDeploymentArtifact() {

            

              JavaArchive oracleDriver = ShrinkWrap.create(JavaArchive.class, "oracleDriver.jar");

              oracleDriver.merge(Maven.resolver().resolve("com.oracle:ojdbc6:11.2.0.3").withoutTransitivity()

                     .asSingle(JavaArchive.class));

            

              JavaArchive commons = ShrinkWrap.create(JavaArchive.class, "custom-commons-util.jar");

              commons.merge(Maven.resolver().resolve("com.xyx:custom-common-lib:1.0").withoutTransitivity()

                     .asSingle(JavaArchive.class));

            

            

              JavaArchive mqClient = ShrinkWrap.create(JavaArchive.class, "mq-client.jar");

              mqClient.merge(Maven.resolver().resolve("com.ibm.mq:com.ibm.mq.allclient:8.0").withoutTransitivity()

                     .asSingle(JavaArchive.class));

            

              JavaArchive jms = ShrinkWrap.create(JavaArchive.class, "jms.jar");

              jms.merge(Maven.resolver().resolve("javax.jms:javax.jms-api:2.0").withoutTransitivity()

                     .asSingle(JavaArchive.class));

            

              return ShrinkWrap

                     .create(WebArchive.class, "Dummy.war")

                     .addClasses(EJB_To_Be_Tested.class, All_Classes_used_by_EJB.class)

                     .addAsResource(

                             new File(Thread.currentThread().getContextClassLoader().getResource("config.properties")

                                     .getFile()), "resources/config.properties")

                     .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml").addAsLibraries(oracleDriver)

                     .addAsLibraries(commons).addAsLibraries(mqClient).addAsLibraries(jms);

              }