6 Replies Latest reply on Aug 25, 2012 3:46 PM by Darko Krizic

    TestNG fails with ClassNotFoundException on JBoss 7.1.1.Final

    Darko Krizic Newbie

      Hi,

       

       

      I have a smal test project with an Interface

       

       

      {code}

      package com.prodyna.demo.calculator;

       

      import javax.ejb.Local;

       

      @Local

      public interface Calculator {

       

        public abstract int add(int a, int b);

       

      }

       

       

      {code}

       

      and an implementation

       

       

      {code}

      package com.prodyna.demo.calculator;

       

      import javax.ejb.LocalBean;

      import javax.ejb.Stateless;

       

      import org.slf4j.Logger;

      import org.slf4j.LoggerFactory;

       

      @Stateless

      @LocalBean

      public class CalculatorBean implements Calculator {

       

                private Logger log = LoggerFactory.getLogger( getClass() );

       

                @Override

                public int add( int a, int b ) {

                          log.info("Calculating " + a + "+" + b );

                          return a + b;

                }

      }

      {code}

       

      testing with

       

       

      {code}

      package com.prodyna.demo.calculator;

       

      import static org.junit.Assert.assertEquals;

       

      import javax.inject.Inject;

       

      import org.jboss.arquillian.container.test.api.Deployment;

      import org.jboss.arquillian.testng.Arquillian;

      import org.jboss.shrinkwrap.api.Archive;

      import org.jboss.shrinkwrap.api.ShrinkWrap;

      import org.jboss.shrinkwrap.api.asset.EmptyAsset;

      import org.jboss.shrinkwrap.api.spec.JavaArchive;

      import org.testng.annotations.Test;

       

      // @RunWith(Arquillian.class)

      public class CalculatorBeanTest extends Arquillian {

       

        @Deployment

                public static Archive<?> createDeployment() {

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

                          jar.addClass(Calculator.class);

                          jar.addClass(CalculatorBean.class);

                          jar.addClass(CalculatorBeanTest.class);

                          jar.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");

                          return jar;

                }

       

        @Inject

                private Calculator calculator;

       

        @Test

                public void add1() {

                          assertEquals(10, calculator.add(2, 8));

                }

       

      }

       

      {code}

       

      With JUnit everything works (arquillian-junit-container, junit), but not by switching to TestNG (arquillian-testng-container, tstng), some imports changed. The Exception is:

       

       

      {code}

      00:19:59,590 INFO  [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-4) Starting Coyote HTTP/1.1 on http--127.0.0.1-8080

      00:19:59,897 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-1) JBAS015012: Started FileSystemDeploymentService for directory /Users/dkrizic/Runtime/jboss/standalone/deployments

      00:19:59,905 INFO  [org.jboss.as.remoting] (MSC service thread 1-7) JBAS017100: Listening on /127.0.0.1:9999

      00:19:59,906 INFO  [org.jboss.as.remoting] (MSC service thread 1-2) JBAS017100: Listening on /127.0.0.1:4447

      00:20:00,074 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-5) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]

      00:20:00,093 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:9990

      00:20:00,094 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015874: JBoss AS 7.1.1.Final "Brontes" started in 2934ms - Started 133 of 208 services (74 services are passive or on-demand)

      00:20:18,733 INFO  [org.jboss.as.repository] (management-handler-thread - 1) JBAS014900: Content added at location /Users/dkrizic/Runtime/jboss/standalone/data/content/85/d5c8a22f34ce48a235a2d61f3714ff7b68553c/content

      00:20:18,755 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-6) JBAS015876: Starting deployment of "arquillian-service"

      00:20:19,305 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-8) JBAS018567: Deployment "deployment.arquillian-service" is using a private module ("org.jboss.as.jmx:main") which may be changed or removed in future versions without notice.

      00:20:19,306 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-8) JBAS018567: Deployment "deployment.arquillian-service" is using a private module ("org.jboss.as.server:main") which may be changed or removed in future versions without notice.

      00:20:19,307 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-8) JBAS018567: Deployment "deployment.arquillian-service" is using a private module ("org.jboss.as.osgi:main") which may be changed or removed in future versions without notice.

      00:20:19,309 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-8) JBAS018567: Deployment "deployment.arquillian-service" is using a private module ("org.jboss.jandex:main") which may be changed or removed in future versions without notice.

      00:20:19,310 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-8) JBAS018567: Deployment "deployment.arquillian-service" is using a private module ("org.jboss.osgi.framework:main") which may be changed or removed in future versions without notice.

      00:20:19,438 INFO  [org.jboss.as.server] (management-handler-thread - 1) JBAS018559: Deployed "arquillian-service"

      00:20:19,982 INFO  [org.jboss.as.repository] (management-handler-thread - 2) JBAS014900: Content added at location /Users/dkrizic/Runtime/jboss/standalone/data/content/80/52405ad4245f9de40b281a5e4d0dffc86b518a/content

      00:20:19,989 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015876: Starting deployment of "test.jar"

      00:20:20,074 INFO  [org.jboss.weld.deployer] (MSC service thread 1-7) JBAS016002: Processing weld deployment test.jar

      00:20:20,083 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-7) JNDI bindings for session bean named CalculatorBean in deployment unit deployment "test.jar" are as follows:

       

       

                java:global/test/CalculatorBean!com.prodyna.demo.calculator.Calculator

                java:app/test/CalculatorBean!com.prodyna.demo.calculator.Calculator

                java:module/CalculatorBean!com.prodyna.demo.calculator.Calculator

                java:global/test/CalculatorBean!com.prodyna.demo.calculator.CalculatorBean

                java:app/test/CalculatorBean!com.prodyna.demo.calculator.CalculatorBean

                java:module/CalculatorBean!com.prodyna.demo.calculator.CalculatorBean

       

       

      00:20:20,189 INFO  [org.jboss.weld.deployer] (MSC service thread 1-7) JBAS016005: Starting Services for CDI deployment: test.jar

      00:20:20,274 INFO  [org.jboss.weld.Version] (MSC service thread 1-7) WELD-000900 1.1.5 (AS71)

      00:20:20,293 INFO  [org.jboss.weld.deployer] (MSC service thread 1-4) JBAS016008: Starting weld service for deployment test.jar

      00:20:20,333 INFO  [org.jboss.as.arquillian] (MSC service thread 1-7) Arquillian deployment detected: ArquillianConfig[service=jboss.arquillian.config."test.jar",unit=test.jar,tests=[com.prodyna.demo.calculator.CalculatorBeanTest]]

      00:20:20,848 INFO  [org.jboss.as.server] (management-handler-thread - 2) JBAS018559: Deployed "test.jar"

      00:20:21,118 SEVERE [org.jboss.arquillian.protocol.jmx.JMXTestRunner] (pool-4-thread-1) Failed: com.prodyna.demo.calculator.CalculatorBeanTest.add1: org.testng.TestNGException: java.lang.ClassNotFoundException: com.prodyna.demo.calculator.CalculatorBeanTest from [Module "deployment.arquillian-service:main" from Service Module Loader]

                at org.testng.internal.XmlMethodSelector.checkMethod(XmlMethodSelector.java:252) [arquillian-service:]

                at org.testng.internal.XmlMethodSelector.setXmlClasses(XmlMethodSelector.java:263) [arquillian-service:]

                at org.testng.TestRunner.initRunInfo(TestRunner.java:378) [arquillian-service:]

                at org.testng.TestRunner.init(TestRunner.java:230) [arquillian-service:]

                at org.testng.TestRunner.init(TestRunner.java:205) [arquillian-service:]

                at org.testng.TestRunner.<init>(TestRunner.java:153) [arquillian-service:]

                at org.testng.SuiteRunner$DefaultTestRunnerFactory.newTestRunner(SuiteRunner.java:522) [arquillian-service:]

                at org.testng.SuiteRunner.init(SuiteRunner.java:157) [arquillian-service:]

                at org.testng.SuiteRunner.<init>(SuiteRunner.java:111) [arquillian-service:]

                at org.testng.TestNG.createSuiteRunner(TestNG.java:1272) [arquillian-service:]

                at org.testng.TestNG.createSuiteRunners(TestNG.java:1259) [arquillian-service:]

                at org.testng.TestNG.runSuitesLocally(TestNG.java:1113) [arquillian-service:]

                at org.testng.TestNG.run(TestNG.java:1030) [arquillian-service:]

                at org.jboss.arquillian.testng.container.TestNGTestRunner.execute(TestNGTestRunner.java:53) [arquillian-service:]

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

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

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

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

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

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

                at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_06]

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

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

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

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

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

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

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

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

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

                at org.jboss.remotingjmx.protocol.v1.ServerProxy$InvokeHandler.handle(ServerProxy.java:1034)

                at org.jboss.remotingjmx.protocol.v1.ServerProxy$MessageReciever$1.run(ServerProxy.java:215)

                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_06]

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

                at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_06]

      Caused by: java.lang.ClassNotFoundException: com.prodyna.demo.calculator.CalculatorBeanTest from [Module "deployment.arquillian-service:main" from Service Module Loader]

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

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

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

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

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

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

                at java.lang.Class.forName(Class.java:186) [rt.jar:1.7.0_06]

                at org.testng.internal.XmlMethodSelector.checkMethod(XmlMethodSelector.java:245) [arquillian-service:]

                ... 34 more

       

       

      00:20:21,305 INFO  [org.jboss.weld.deployer] (MSC service thread 1-2) JBAS016009: Stopping weld service for deployment test.jar

      00:20:21,331 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015877: Stopped deployment test.jar in 37ms

      00:20:21,360 INFO  [org.jboss.as.repository] (management-handler-thread - 4) JBAS014901: Content removed from location /Users/dkrizic/Runtime/jboss/standalone/data/content/80/52405ad4245f9de40b281a5e4d0dffc86b518a/content

      00:20:21,361 INFO  [org.jboss.as.server] (management-handler-thread - 4) JBAS018558: Undeployed "test.jar"

      00:20:21,439 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015877: Stopped deployment arquillian-service in 4ms

      00:20:21,453 INFO  [org.jboss.as.repository] (management-handler-thread - 1) JBAS014901: Content removed from location /Users/dkrizic/Runtime/jboss/standalone/data/content/85/d5c8a22f34ce48a235a2d61f3714ff7b68553c/content

      00:20:21,455 INFO  [org.jboss.as.server] (management-handler-thread - 1) JBAS018558: Undeployed "arquillian-service"

       

      I am confused and have no more ideas what might be the reason.

      {code}

        • 1. Re: TestNG fails with ClassNotFoundException on JBoss 7.1.1.Final
          Jean-Pierre RIO Newbie

          Darko,

          You're using :

           

          import static org.junit.Assert.assertEquals;

           

          instead of :

           

          import static org.testng.Assert.assertEquals;

          • 2. Re: TestNG fails with ClassNotFoundException on JBoss 7.1.1.Final
            Darko Krizic Newbie

            Jean-Pierre,

             

            you are right, but that makes no difference. This is a left-over of the JUnit-Code. I changed it locally and it does make no difference, because the code is not reached so far, the problem occurs before.

             

            Regards,

             

            Darko

            • 3. Re: TestNG fails with ClassNotFoundException on JBoss 7.1.1.Final
              Jean-Pierre RIO Newbie

              You're right. I can reproduce the problem with a command line 'mvn test'. But, FYI, the test is ok when run from within Eclipse. I'll dig a little bit more later.

              • 4. Re: TestNG fails with ClassNotFoundException on JBoss 7.1.1.Final
                Darko Krizic Newbie

                I have this error in any case:

                 

                • mvn install
                • TestNG Plugin for Eclipse

                 

                It only works for @RunAsClient. For some reason the test class is not packaged to the JBoss, also when I try to add it explictly.

                • 5. Re: TestNG fails with ClassNotFoundException on JBoss 7.1.1.Final
                  Jean-Pierre RIO Newbie

                  Darko,

                  My lastest tests :

                   

                  - with testng-6.7 : it works for me with testng plugin in Eclipse but not with mvn test

                  - with testng-6.5.2 : it works in both case.

                   

                  My config :

                  - eclipse (JBoss Developer Studio Version: 5.0.0.Beta3)

                  - java version "1.6.0_24"

                  - embedded maven (3.0.2) or external (3.0.3) (same behaviour)

                   

                  My logs :

                   

                  DEBUG org.jboss.logging | Logging Provider: org.jboss.logging.Log4jLoggerProvider

                  DEBUG org.jboss.as.arquillian.protocol.jmx.JMXProtocolPackager | Generating: arquillian-service

                  DEBUG org.jboss.as.arquillian.protocol.jmx.JMXProtocolPackager | Merging archive: arquillian-testenricher-initialcontext.jar: 3 assets

                  DEBUG org.jboss.as.arquillian.protocol.jmx.JMXProtocolPackager | Merging archive: arquillian-testenricher-cdi.jar: 18 assets

                  DEBUG org.jboss.as.arquillian.protocol.jmx.JMXProtocolPackager | Merging archive: arquillian-testenricher-msc.jar: 7 assets

                  DEBUG org.jboss.as.arquillian.protocol.jmx.JMXProtocolPackager | Merging archive: arquillian-testenricher-osgi.jar: 9 assets

                  DEBUG org.jboss.as.arquillian.protocol.jmx.JMXProtocolPackager | Merging archive: arquillian-testenricher-resource.jar: 10 assets

                  DEBUG org.jboss.as.arquillian.protocol.jmx.JMXProtocolPackager | Merging archive: arquillian-core.jar: 492 assets

                  DEBUG org.jboss.as.arquillian.protocol.jmx.JMXProtocolPackager | Merging archive: arquillian-testenricher-ejb.jar: 10 assets

                  DEBUG org.jboss.as.arquillian.protocol.jmx.JMXProtocolPackager | Merging archive: arquillian-testng.jar: 608 assets

                  DEBUG org.jboss.as.arquillian.protocol.jmx.JMXProtocolPackager | Loadable extensions: [org.jboss.arquillian.testenricher.ejb.container.EJBEnricherRemoteExtension, org.jboss.arquillian.testenricher.cdi.container.CDIEnricherRemoteExtension, org.jboss.arquillian.testenricher.resource.container.ResourceEnricherRemoteExtension, org.jboss.arquillian.testenricher.initialcontext.container.InitialContextRemoteExtension, org.jboss.as.arquillian.service.JMXProtocolEndpointExtension, org.jboss.arquillian.container.test.impl.ContainerTestRemoteExtension, org.jboss.arquillian.testenricher.msc.MSCEnricherRemoteExtension, org.jboss.arquillian.testenricher.osgi.OSGiEnricherRemoteExtension, org.jboss.as.arquillian.service.InContainerManagementClientExtension]

                  DEBUG org.jboss.as.arquillian.protocol.jmx.JMXProtocolPackager | Add dependencies: org.jboss.modules,deployment.arquillian-service,org.jboss.msc

                  INFO org.jboss.as.arquillian.protocol.jmx.ArquillianServiceDeployer | Deploy arquillian service: arquillian-service: 1189 assets

                  INFO org.xnio | XNIO Version 3.0.3.GA

                  INFO org.xnio.nio | XNIO NIO Implementation Version 3.0.3.GA

                  INFO org.jboss.remoting | JBoss Remoting version 3.2.2.GA

                  DEBUG org.xnio.nio | Started channel thread 'Remoting "management-client" read-1', selector sun.nio.ch.EPollSelectorImpl@35e6e3

                  DEBUG org.xnio.nio | Started channel thread 'Remoting "management-client" write-1', selector sun.nio.ch.EPollSelectorImpl@c9630a

                  DEBUG org.xnio.nio | Started channel thread 'Remoting "endpoint" read-1', selector sun.nio.ch.EPollSelectorImpl@1cf662f

                  DEBUG org.xnio.nio | Started channel thread 'Remoting "endpoint" write-1', selector sun.nio.ch.EPollSelectorImpl@1f1f38e

                  DEBUG org.jboss.remotingjmx.VersionedConectionFactory | Available version (Versions  0x01)

                  DEBUG org.jboss.remotingjmx.VersionedConectionFactory | Calling a stable server

                  PASSED: add1

                   

                   

                  ===============================================

                      Default test

                      Tests run: 1, Failures: 0, Skips: 0

                  ===============================================

                   

                   

                  INFO org.jboss.as.arquillian.protocol.jmx.ArquillianServiceDeployer | Undeploy arquillian service: arquillian-service: 1190 assets

                  [TestNG] Time taken by org.testng.reporters.EmailableReporter@25d2b2: 3 ms

                  [TestNG] Time taken by org.testng.reporters.XMLReporter@1ebd75b: 7 ms

                  [TestNG] Time taken by org.testng.reporters.JUnitReportReporter@109fd93: 1 ms

                  [TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter@1df8b99: 5 ms

                  [TestNG] Time taken by [TestListenerAdapter] Passed:0 Failed:0 Skipped:0]: 0 ms

                  • 6. Re: TestNG fails with ClassNotFoundException on JBoss 7.1.1.Final
                    Darko Krizic Newbie

                    I changed from TestNG 6.7 to 6.5.2 as suggested.

                     

                    When running from Eclipse (TestNG Plugin) I receive the following output:

                     

                    [TestNG] Running:

                      /private/var/folders/kk/66wcvd9s6_v275jjt4j4ggh80000gn/T/testng-eclipse--2109988404/testng-customsuite.xml

                     

                    log4j:WARN No appenders could be found for logger (org.jboss.logging).

                    log4j:WARN Please initialize the log4j system properly.

                    Aug 25, 2012 9:40:13 PM org.jboss.arquillian.protocol.jmx.JMXMethodExecutor invoke

                    SEVERE: Failed: com.prodyna.demo.calculator.CalculatorBeanTest.add1

                    org.testng.TestNGException: java.lang.ClassNotFoundException: com.prodyna.demo.calculator.CalculatorBeanTest from [Module "deployment.arquillian-service:main" from Service Module Loader]

                              at org.testng.internal.XmlMethodSelector.checkMethod(XmlMethodSelector.java:252)

                              at org.testng.internal.XmlMethodSelector.setXmlClasses(XmlMethodSelector.java:263)

                              at org.testng.TestRunner.initRunInfo(TestRunner.java:378)

                              at org.testng.TestRunner.init(TestRunner.java:230)

                              at org.testng.TestRunner.init(TestRunner.java:205)

                              at org.testng.TestRunner.<init>(TestRunner.java:153)

                              at org.testng.SuiteRunner$DefaultTestRunnerFactory.newTestRunner(SuiteRunner.java:522)

                              at org.testng.SuiteRunner.init(SuiteRunner.java:157)

                              at org.testng.SuiteRunner.<init>(SuiteRunner.java:111)

                              at org.testng.TestNG.createSuiteRunner(TestNG.java:1272)

                              at org.testng.TestNG.createSuiteRunners(TestNG.java:1259)

                              at org.testng.TestNG.runSuitesLocally(TestNG.java:1113)

                              at org.testng.TestNG.run(TestNG.java:1030)

                              at org.jboss.arquillian.testng.container.TestNGTestRunner.execute(TestNGTestRunner.java:53)

                              at org.jboss.arquillian.protocol.jmx.JMXTestRunner.runTestMethodInternal(JMXTestRunner.java:129)

                              at org.jboss.arquillian.protocol.jmx.JMXTestRunner.runTestMethod(JMXTestRunner.java:108)

                              at org.jboss.as.arquillian.service.ArquillianService$ExtendedJMXTestRunner.runTestMethod(ArquillianService.java:226)

                              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:601)

                              at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:111)

                              at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:45)

                              at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:235)

                              at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:138)

                              at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:250)

                              at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)

                              at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:791)

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

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

                              at org.jboss.remotingjmx.protocol.v1.ServerProxy$InvokeHandler.handle(ServerProxy.java:1034)

                              at org.jboss.remotingjmx.protocol.v1.ServerProxy$MessageReciever$1.run(ServerProxy.java:215)

                              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)

                              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

                              at java.lang.Thread.run(Thread.java:722)

                    Caused by: java.lang.ClassNotFoundException: com.prodyna.demo.calculator.CalculatorBeanTest from [Module "deployment.arquillian-service:main" from Service Module Loader]

                              at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)

                              at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)

                              at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)

                              at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)

                              at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)

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

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

                              at org.testng.internal.XmlMethodSelector.checkMethod(XmlMethodSelector.java:245)

                              ... 34 more

                    FAILED: add1

                    org.testng.TestNGException: java.lang.ClassNotFoundException: com.prodyna.demo.calculator.CalculatorBeanTest from [Module "deployment.arquillian-service:main" from Service Module Loader]

                              at org.testng.internal.XmlMethodSelector.checkMethod(XmlMethodSelector.java:252)

                              at org.testng.internal.XmlMethodSelector.setXmlClasses(XmlMethodSelector.java:263)

                              at org.testng.TestRunner.initRunInfo(TestRunner.java:378)

                              at org.testng.TestRunner.init(TestRunner.java:230)

                              at org.testng.TestRunner.init(TestRunner.java:205)

                              at org.testng.TestRunner.<init>(TestRunner.java:153)

                              at org.testng.SuiteRunner$DefaultTestRunnerFactory.newTestRunner(SuiteRunner.java:522)

                              at org.testng.SuiteRunner.init(SuiteRunner.java:157)

                              at org.testng.SuiteRunner.<init>(SuiteRunner.java:111)

                              at org.testng.TestNG.createSuiteRunner(TestNG.java:1272)

                              at org.testng.TestNG.createSuiteRunners(TestNG.java:1259)

                              at org.testng.TestNG.runSuitesLocally(TestNG.java:1113)

                              at org.testng.TestNG.run(TestNG.java:1030)

                              at org.jboss.arquillian.testng.container.TestNGTestRunner.execute(TestNGTestRunner.java:53)

                              at org.jboss.arquillian.protocol.jmx.JMXTestRunner.runTestMethodInternal(JMXTestRunner.java:129)

                              at org.jboss.arquillian.protocol.jmx.JMXTestRunner.runTestMethod(JMXTestRunner.java:108)

                              at org.jboss.as.arquillian.service.ArquillianService$ExtendedJMXTestRunner.runTestMethod(ArquillianService.java:226)

                              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:601)

                              at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:111)

                              at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:45)

                              at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:235)

                              at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:138)

                              at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:250)

                              at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)

                              at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:791)

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

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

                              at org.jboss.remotingjmx.protocol.v1.ServerProxy$InvokeHandler.handle(ServerProxy.java:1034)

                              at org.jboss.remotingjmx.protocol.v1.ServerProxy$MessageReciever$1.run(ServerProxy.java:215)

                              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)

                              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

                              at java.lang.Thread.run(Thread.java:722)

                    Caused by: java.lang.ClassNotFoundException: com.prodyna.demo.calculator.CalculatorBeanTest from [Module "deployment.arquillian-service:main" from Service Module Loader]

                              at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)

                              at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)

                              at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)

                              at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)

                              at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)

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

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

                              at org.testng.internal.XmlMethodSelector.checkMethod(XmlMethodSelector.java:245)

                              ... 34 more

                     

                     

                    ===============================================

                        Default test

                        Tests run: 1, Failures: 1, Skips: 0

                    ===============================================

                     

                     

                    ===============================================

                    Default suite

                    Total tests run: 1, Failures: 1, Skips: 0

                    ===============================================

                     

                    [TestNG] Time taken by [FailedReporter passed=0 failed=0 skipped=0]: 5 ms

                    [TestNG] Time taken by org.testng.reporters.EmailableReporter@2e5bbd6: 5 ms

                    [TestNG] Time taken by org.testng.reporters.JUnitReportReporter@a210b5b: 8 ms

                    [TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter@37eb2c1b: 17 ms

                    [TestNG] Time taken by org.testng.reporters.jq.Main@398825b3: 34 ms

                    [TestNG] Time taken by org.testng.reporters.XMLReporter@8f0c85e: 15 ms

                     

                    Fail!

                     

                    Now running "mvn test" gives the following output:

                     

                    [INFO] Scanning for projects...

                    [INFO]                                                                        

                    [INFO] ------------------------------------------------------------------------

                    [INFO] Building demo-calculator 0.0.1-SNAPSHOT

                    [INFO] ------------------------------------------------------------------------

                    [INFO]

                    [INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ demo-calculator ---

                    [INFO] Using 'UTF-8' encoding to copy filtered resources.

                    [INFO] Copying 0 resource

                    [INFO]

                    [INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ demo-calculator ---

                    [INFO] Nothing to compile - all classes are up to date

                    [INFO]

                    [INFO] --- maven-resources-plugin:2.4.3:testResources (default-testResources) @ demo-calculator ---

                    [INFO] Using 'UTF-8' encoding to copy filtered resources.

                    [INFO] Copying 0 resource

                    [INFO]

                    [INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ demo-calculator ---

                    [INFO] Nothing to compile - all classes are up to date

                    [INFO]

                    [INFO] --- maven-surefire-plugin:2.12:test (default-test) @ demo-calculator ---

                    [INFO] Surefire report directory: /Users/dkrizic/Documents/workspace2/demo-calculator/target/surefire-reports

                     

                     

                    -------------------------------------------------------

                    T E S T S

                    -------------------------------------------------------

                    Running com.prodyna.demo.calculator.CalculatorBeanTest

                    Configuring TestNG with: org.apache.maven.surefire.testng.conf.TestNGMapConfigurator@79a5b7b4

                    log4j:WARN No appenders could be found for logger (org.jboss.logging).

                    log4j:WARN Please initialize the log4j system properly.

                    Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.718 sec

                     

                     

                    Results :

                     

                     

                    Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

                     

                     

                    [INFO]

                    [INFO] --- maven-jar-plugin:2.3.1:jar (default-jar) @ demo-calculator ---

                    [INFO]

                    [INFO] --- maven-install-plugin:2.3.1:install (default-install) @ demo-calculator ---

                    [INFO] Installing /Users/dkrizic/Documents/workspace2/demo-calculator/target/demo-calculator.jar to /Users/dkrizic/.m2/repository/com/prodyna/demo/demo-calculator/0.0.1-SNAPSHOT/demo-calculator-0.0.1-SNAPSHOT.jar

                    [INFO] Installing /Users/dkrizic/Documents/workspace2/demo-calculator/pom.xml to /Users/dkrizic/.m2/repository/com/prodyna/demo/demo-calculator/0.0.1-SNAPSHOT/demo-calculator-0.0.1-SNAPSHOT.pom

                    [INFO] ------------------------------------------------------------------------

                    [INFO] BUILD SUCCESS

                    [INFO] ------------------------------------------------------------------------

                    [INFO] Total time: 8.104s

                    [INFO] Finished at: Sat Aug 25 21:41:29 CEST 2012

                    [INFO] Final Memory: 16M/225M

                    [INFO] ------------------------------------------------------------------------

                     

                    It seems to work.

                     

                    I am confused. How can we dig into this? Would it make sense to try to downgrade TestNG Plugin?

                     

                    Regards,

                     

                    Darko