8 Replies Latest reply on Jul 11, 2009 7:05 PM by bonoddr

    Problem running tests in Seam examples using TestNG Eclipse plugin

    tuxzilla
      I imported examples/mail into my eclipse IDE and tried to run its tests. I tried both JDK 5 and 6. The classpath of the test was JRE, default project classpath, [Seam Distribution Home]/bootstrap, and [Seam Distribution Home]/lib/test/*.jar. I was getting the following exceptions. What was I missing here? Thanks.

      ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to Start: name=JMXKernel state=Create
      java.lang.NoSuchMethodError: org.jboss.system.ServiceController.setKernel(Lorg/jboss/kernel/Kernel;)V
              at org.jboss.embedded.adapters.JMXKernel.start(JMXKernel.java:164)
              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.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:56)
              at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:110)
              at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
              at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:214)
              at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:45)
              at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:108)
              at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:69)
              at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:221)
              at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.installAction(KernelControllerContextAction.java:135)
              at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.installAction(KernelControllerContextAction.java:46)
              at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
              at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
              at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
              at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:327)
              at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1309)
              at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:734)
              at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:862)
              at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:784)
              at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:574)
              at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:398)
              at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBean(AbstractKernelDeployer.java:309)
              at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBeans(AbstractKernelDeployer.java:279)
              at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deploy(AbstractKernelDeployer.java:130)
              at org.jboss.kernel.plugins.deployment.xml.BeanXMLDeployer.deploy(BeanXMLDeployer.java:96)
              at org.jboss.embedded.Bootstrap.deployBaseBootstrapUrl(Bootstrap.java:130)
              at org.jboss.embedded.Bootstrap.bootstrapURL(Bootstrap.java:142)
              at org.jboss.embedded.Bootstrap.bootstrap(Bootstrap.java:183)
              at org.jboss.embedded.Bootstrap.bootstrap(Bootstrap.java:195)
              at org.jboss.seam.mock.EmbeddedBootstrap.startAndDeployResources(EmbeddedBootstrap.java:11)
              at org.jboss.seam.mock.AbstractSeamTest.startJbossEmbeddedIfNecessary(AbstractSeamTest.java:1024)
              at org.jboss.seam.mock.AbstractSeamTest.startSeam(AbstractSeamTest.java:915)
              at org.jboss.seam.mock.SeamTest.startSeam(SeamTest.java:58)
              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.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:580)
              at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:398)
              at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:145)
              at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:82)
              at org.testng.SuiteRunner.privateRun(SuiteRunner.java:278)
              at org.testng.SuiteRunner.run(SuiteRunner.java:198)
              at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:823)
              at org.testng.TestNG.runSuitesLocally(TestNG.java:790)
              at org.testng.TestNG.run(TestNG.java:708)
              at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73)
              at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:124)
      ERROR [org.jboss.embedded.DeploymentScanner] Failed to deploy
      org.jboss.deployers.spi.DeploymentException: Error populating deployment vfsfile:/C:/dev/jboss-seam-2.1.1.GA/bootstrap/conf/jboss-service.xml
              at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
              at org.jboss.deployers.structure.spi.helpers.AbstractStructureBuilder.populateContext(AbstractStructureBuilder.java:77)
              at org.jboss.deployers.structure.spi.helpers.AbstractStructuralDeployers.determineStructure(AbstractStructuralDeployers.java:89)
              at org.jboss.deployers.plugins.main.MainDeployerImpl.determineStructure(MainDeployerImpl.java:743)
              at org.jboss.deployers.plugins.main.MainDeployerImpl.addDeployment(MainDeployerImpl.java:280)
              at org.jboss.deployers.plugins.main.MainDeployerImpl.addDeployment(MainDeployerImpl.java:237)
              at org.jboss.embedded.DeploymentGroup.add(DeploymentGroup.java:153)
              at org.jboss.embedded.DeploymentGroup.add(DeploymentGroup.java:166)
              at org.jboss.embedded.DeploymentGroup.addResource(DeploymentGroup.java:326)
              at org.jboss.embedded.DeploymentScanner.start(DeploymentScanner.java:81)
              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.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:56)
              at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:110)
              at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
              at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:214)
              at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:45)
              at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:108)
              at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:69)
              at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:221)
              at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.installAction(KernelControllerContextAction.java:135)
              at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.installAction(KernelControllerContextAction.java:46)
              at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
              at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
              at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
              at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:327)
              at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1309)
              at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:734)
              at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:862)
              at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:784)
              at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:574)
              at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:398)
              at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBean(AbstractKernelDeployer.java:309)
              at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBeans(AbstractKernelDeployer.java:279)
              at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deploy(AbstractKernelDeployer.java:130)
              at org.jboss.kernel.plugins.deployment.xml.BeanXMLDeployer.deploy(BeanXMLDeployer.java:96)
              at org.jboss.embedded.Bootstrap.deployBaseBootstrapUrl(Bootstrap.java:130)
              at org.jboss.embedded.Bootstrap.bootstrapURL(Bootstrap.java:142)
              at org.jboss.embedded.Bootstrap.bootstrap(Bootstrap.java:183)
              at org.jboss.embedded.Bootstrap.bootstrap(Bootstrap.java:195)
              at org.jboss.seam.mock.EmbeddedBootstrap.startAndDeployResources(EmbeddedBootstrap.java:11)
              at org.jboss.seam.mock.AbstractSeamTest.startJbossEmbeddedIfNecessary(AbstractSeamTest.java:1024)
              at org.jboss.seam.mock.AbstractSeamTest.startSeam(AbstractSeamTest.java:915)
              at org.jboss.seam.mock.SeamTest.startSeam(SeamTest.java:58)
              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.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:580)
              at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:398)
              at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:145)
              at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:82)
              at org.testng.SuiteRunner.privateRun(SuiteRunner.java:278)
              at org.testng.SuiteRunner.run(SuiteRunner.java:198)
              at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:823)
              at org.testng.TestNG.runSuitesLocally(TestNG.java:790)
              at org.testng.TestNG.run(TestNG.java:708)
              at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73)
              at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:124)
      Caused by: java.lang.NoSuchMethodError: org.jboss.deployers.spi.structure.ContextInfo.getMetaDataPath()Ljava/util/List;
              at org.jboss.deployers.vfs.plugins.structure.VFSStructureBuilder.applyContextInfo(VFSStructureBuilder.java:93)
              at org.jboss.deployers.structure.spi.helpers.AbstractStructureBuilder.populateContext(AbstractStructureBuilder.java:73)
              ... 59 more
        • 1. Re: Problem running tests in Seam examples using TestNG Eclipse plugin
          matt.nirgue


          Caused by: java.lang.NoSuchMethodError: org.jboss.deployers.spi.structure.ContextInfo.getMetaDataPath()Ljava/util/List;



          either you have a classpath issue or you're missing a jar... I looked through my project and found that this class can be found in the following jar: jboss-embedded-all-beta3.SP3.jar


          Please ensure that you have this jar in your classpath and let us know if this solved your problem


          Regards,


          Matt


          • 2. Re: Problem running tests in Seam examples using TestNG Eclipse plugin
            barakka

            Don't know which version of JDK you are using and if you are using maven, but I had that same error many times with JDK 5 and the solution was always to exclude the jboss-deployers-client-spi library from the classpath. This is a snippet from the maven build file I'm using:


            <dependency>
                           <groupId>org.jboss.seam.embedded</groupId>
                           <artifactId>jboss-embedded-api</artifactId>
                           <version>${embedded.version}</version>
                           <scope>test</scope>
                           <exclusions>
                                <!--  In version beta 3, not excluding this library will make the seam test fail by the error:
                                     java.lang.NoSuchMethodError: org.jboss.deployers.spi.structure.ContextInfo.getMetaDataPath()Ljava/util/List;
                                 -->
                              <exclusion>
                                   <groupId>org.jboss.microcontainer</groupId>
                                     <artifactId>jboss-deployers-client-spi</artifactId>
                              </exclusion>
                            </exclusions>               
                      </dependency>
            



            Hope this will help.


            Best,
            Riccardo.

            • 3. Re: Problem running tests in Seam examples using TestNG Eclipse plugin
              tuxzilla

              I had jboss-embedded-all.jar in the classpath. But I also found out I had a JBoss 4.2 server runtime in the classpath. After I removed the server runtime, the class not found errors disappeared. But I now have this error:


              java.lang.IllegalStateException: Must set application-class using <wicket:web-application /> in components.xml


              I am running tests in Seam's mail example, which has nothing to do with Wicket. I wonder what this error is about?

              • 4. Re: Problem running tests in Seam examples using TestNG Eclipse plugin
                paulmkeogh

                I think this is another class path problem - check to see if you have any wicket JARs on your classpath and if so, remove them to see if the error disappears.

                • 5. Re: Problem running tests in Seam examples using TestNG Eclipse plugin
                  waltc

                  I have a similar but, perhaps, simpler problem.
                  This is in Eclipse 3.4 with the Seam 2.1.1GA



                  [Parser] Running:
                    /home/walt/SeamProjects/ServerReservation/temp-testng-customsuite.xml
                  
                  FAILED CONFIGURATION: @BeforeSuite startSeam
                  java.lang.NoClassDefFoundError: org/jboss/deployers/spi/DeploymentException
                       at java.lang.Class.forName0(Native Method)
                       at java.lang.Class.forName(Class.java:186)
                       at org.jboss.seam.mock.AbstractSeamTest.embeddedJBossAvailable(AbstractSeamTest.java:1034)
                       at org.jboss.seam.mock.AbstractSeamTest.startJbossEmbeddedIfNecessary(AbstractSeamTest.java:1022)
                       at org.jboss.seam.mock.AbstractSeamTest.startSeam(AbstractSeamTest.java:915)
                       at org.jboss.seam.mock.SeamTest.startSeam(SeamTest.java:58)
                  Caused by: java.lang.ClassNotFoundException: org.jboss.deployers.spi.DeploymentException
                       at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
                       at java.security.AccessController.doPrivileged(Native Method)
                       at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
                       at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
                       at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
                       at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
                       at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:336)
                       ... 21 more
                  ... Removed 15 stack frames
                  SKIPPED CONFIGURATION: @BeforeClass setupClass
                  SKIPPED CONFIGURATION: @BeforeMethod begin
                  SKIPPED CONFIGURATION: @AfterMethod end
                  SKIPPED CONFIGURATION: @AfterClass cleanupClass
                  SKIPPED: test_reserve
                  
                  ===============================================
                      com.monster.search.test.ReserveTest
                      Tests run: 1, Failures: 0, Skips: 1
                      Configuration Failures: 1, Skips: 4
                  ===============================================
                  
                  
                  ===============================================
                  ServerReservation
                  Total tests run: 1, Failures: 0, Skips: 1
                  Configuration Failures: 1, Skips: 5
                  ===============================================





                  • 6. Re: Problem running tests in Seam examples using TestNG Eclipse plugin
                    tomtom

                    I solved exactly the same problem with this NoSuchMethodException mentioned in the first post by removing jboss-embedded-api.jar from the classpath of the TestNG-Test (discrepancy between the api and the implementation?). Now, I have a


                    java.lang.RuntimeException: error while reading /WEB-INF/components.xml



                    ...and further down in the stacktrace:


                    Exception setting property org.jboss.seam.core.init.debug on component org.jboss.seam.core.init.  Expression @debug@ evaluated to null
                    



                    I'm looking further into it... .

                    • 7. Re: Problem running tests in Seam examples using TestNG Eclipse plugin
                      tomtom

                      Forget what I said in the last post...that only lead from one error to the next and the next and so on.


                      I finally got my TestNG-Tests running through the eclipse plugin by performing the following steps:



                      • delete all entries from your project->properties->java build path->Libraries

                      • create a new project with seam-gen in another workspace

                      • copy the build-path entries from the new project into your existing project (I did it by hand...probably you could instead copy some metadata-file...)

                      • follow the instructions provided in src/test/readme.txt (should exist in any seam-gen project)

                      • additionally to the jars from the readme, add commons-httpclient.jar and commons-codec-1.3.jar from the projects lib directory to the classpath of your test case



                      This did it for me, I hope it works for you as well.

                      • 8. Re: Problem running tests in Seam examples using TestNG Eclipse plugin
                        bonoddr

                        Tom Hombergs, can you provide me an eclipse template project with some tests working? If you can, please send to bonoddr@yahoo.com.br


                        Thanks :)