0 Replies Latest reply on Mar 31, 2009 4:08 AM by Daniel Kluge

    Order of the jars in the pom.xml important?

    Daniel Kluge Newbie

      Hi all,

      I want to execute my TestNG-test in the Embedded JBoss with Maven. If I execute it with the TestNG-Plugin it works perfect.
      But if I want to execute it with Surefire-Plugin Maven I get two different errors.

      Here my pom.xml:

      <plugin>
       <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-surefire-plugin</artifactId>
       <version>2.4.3</version>
       <configuration>
       <childDelegation>true</childDelegation>
       <useSystemClassLoader>false</useSystemClassLoader>
       <environmentVariables>
       <KM_ENV>test</KM_ENV>
       </environmentVariables>
       <skipTests>false</skipTests>
       <testFailureIgnore>true</testFailureIgnore>
       <additionalClasspathElements>
       <additionalClasspathElement>${myproject.home}/myproject-ejb/src/test/bootstrap</additionalClasspathElement>
       </additionalClasspathElements>
       <argLine>-Dsun.lang.ClassLoader.allowArraySyntax=true</argLine>
       <useSystemClassLoader>false</useSystemClassLoader>
       </configuration>
      <testResources>
       <testResource>
       <directory>src/test/bootstrap</directory>
       </testResource>
       <testResource>
       <directory>src/test/resources</directory>
       </testResource>
       </testResources>
      <dependencies>
       <dependency>
       <groupId>org.jboss.seam.embedded</groupId>
       <artifactId>jboss-embedded-all</artifactId>
       <version>beta3.SP4</version>
       <scope>test</scope>
       </dependency>
       <dependency>
       <groupId>org.jboss.seam.embedded</groupId>
       <artifactId>jboss-embedded-api</artifactId>
       <version>beta3.SP4</version>
       <scope>test</scope>
       </dependency>
       <dependency>
       <groupId>org.jboss.seam.embedded</groupId>
       <artifactId>thirdparty-all</artifactId>
       <version>beta3.SP4</version>
       <scope>provided</scope>
       </dependency>
       <dependency>
       <groupId>org.jboss.seam.embedded</groupId>
       <artifactId>hibernate-all</artifactId>
       <version>beta3.SP4</version>
       <scope>provided</scope>
       </dependency>
       <dependency>
       <groupId>org.jboss.microcontainer</groupId>
       <artifactId>jboss-deployers-client-spi</artifactId>
       <version>2.0.0.Beta6</version>
       <scope>provided</scope>
       </dependency>
       <dependency>
       <groupId>org.jboss.microcontainer</groupId>
       <artifactId>jboss-deployers-core-spi</artifactId>
       <version>2.0.0.Beta6</version>
       <scope>provided</scope>
       </dependency>
       <dependency>
       <groupId>org.jboss.seam</groupId>
       <artifactId>jboss-seam</artifactId>
       <version>2.1.1.GA</version>
       <scope>provided</scope>
       </dependency>
       <dependency>
       <groupId>org.testng</groupId>
       <artifactId>testng</artifactId>
       <version>5.7</version>
       <scope>test</scope>
       <classifier>jdk15</classifier>
       </dependency>
       <dependency>
       <groupId>org.jboss.el</groupId>
       <artifactId>jboss-el</artifactId>
       <version>2.0.1.GA</version>
       <scope>provided</scope>
       </dependency>
       <dependency>
       <groupId>javax.ejb</groupId>
       <artifactId>ejb-api</artifactId>
       <version>3.0</version>
       <scope>provided</scope>
       </dependency>
       <dependency>
       <groupId>javax.servlet</groupId>
       <artifactId>servlet-api</artifactId>
       <version>2.5</version>
       <scope>provided</scope>
       </dependency>
       <dependency>
       <groupId>javax.el</groupId>
       <artifactId>el-api</artifactId>
       <version>1.0</version>
       <scope>provided</scope>
       </dependency>
       <dependency>
       <groupId>javax.activation</groupId>
       <artifactId>activation</artifactId>
       <version>1.0.2</version>
       <scope>provided</scope>
       </dependency>
       <dependency>
       <groupId>javax.faces</groupId>
       <artifactId>jsf-api</artifactId>
       <version>1.2_09-BETA1</version>
       <scope>provided</scope>
       </dependency>


      With this order dependencies I get the following error on the execution:
      ERROR [org.jboss.embedded.DeploymentScanner] Failed to deploy
      org.jboss.deployers.spi.DeploymentException: Unable to get VirtualFile for url: file:/C:/Projects/MyProject/main/Sourcen_maven/rfo-ejb/target/test-classes/conf/jboss-service.xml
       at org.jboss.embedded.DeploymentGroup.getVirtualFile(DeploymentGroup.java:179)
       at org.jboss.embedded.DeploymentGroup.add(DeploymentGroup.java:165)
       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:597)
       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:597)
       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:262)
       at org.testng.SuiteRunner.run(SuiteRunner.java:191)
       at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:808)
       at org.testng.TestNG.runSuitesLocally(TestNG.java:776)
       at org.testng.TestNG.run(TestNG.java:701)
       at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:62)
       at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:141)
       at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
       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:597)
       at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
       at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
      Caused by: java.net.MalformedURLException: unknown protocol: vfsfile


      But if I changed it to the following order of dependencies I get the error "Unable to bootstrap":

      <dependencies>
       <dependency>
       <groupId>com.gfi.library</groupId>
       <artifactId>authenticator</artifactId>
       <version>1.2.1</version>
       </dependency>
       <dependency>
       <groupId>javax.ejb</groupId>
       <artifactId>ejb-api</artifactId>
       <version>3.0</version>
       <scope>provided</scope>
       </dependency>
       <dependency>
       <groupId>javax.faces</groupId>
       <artifactId>jsf-api</artifactId>
       <version>1.2_09-BETA1</version>
       <scope>provided</scope>
       </dependency>
       <dependency>
       <groupId>org.jboss.seam</groupId>
       <artifactId>jboss-seam</artifactId>
       <version>2.1.1.GA</version>
       <scope>provided</scope>
       </dependency>
       <dependency>
       <groupId>org.jboss.seam.embedded</groupId>
       <artifactId>hibernate-all</artifactId>
       <version>beta3.SP4</version>
       <scope>provided</scope>
       </dependency>
       <dependency>
       <groupId>org.testng</groupId>
       <artifactId>testng</artifactId>
       <version>5.7</version>
       <scope>test</scope>
       <classifier>jdk15</classifier>
       </dependency>
       <dependency>
       <groupId>javax.servlet</groupId>
       <artifactId>servlet-api</artifactId>
       <version>2.5</version>
       <scope>provided</scope>
       </dependency>
       <dependency>
       <groupId>org.jboss.seam.embedded</groupId>
       <artifactId>jboss-embedded-api</artifactId>
       <version>beta3.SP4</version>
       <scope>provided</scope>
       </dependency>
       <dependency>
       <groupId>org.jboss.el</groupId>
       <artifactId>jboss-el</artifactId>
       <version>2.0.1.GA</version>
       <scope>provided</scope>
       </dependency>
       <dependency>
       <groupId>org.jboss.microcontainer</groupId>
       <artifactId>jboss-deployers-client-spi</artifactId>
       <version>2.0.0.Beta6</version>
       <scope>provided</scope>
       </dependency>
       <dependency>
       <groupId>org.jboss.microcontainer</groupId>
       <artifactId>jboss-deployers-core-spi</artifactId>
       <version>2.0.0.Beta6</version>
       <scope>provided</scope>
       </dependency>
       <dependency>
       <groupId>javax.el</groupId>
       <artifactId>el-api</artifactId>
       <version>1.0</version>
       <scope>provided</scope>
       </dependency>
       <dependency>
       <groupId>javax.activation</groupId>
       <artifactId>activation</artifactId>
       <version>1.0.2</version>
       <scope>provided</scope>
       </dependency>
       <dependency>
       <groupId>org.jboss.seam.embedded</groupId>
       <artifactId>thirdparty-all</artifactId>
       <version>beta3.SP4</version>
       <scope>provided</scope>
       </dependency>
       <dependency>
       <groupId>org.jboss.seam.embedded</groupId>
       <artifactId>jboss-embedded-all</artifactId>
       <version>beta3.SP4</version>
       <scope>provided</scope>
       </dependency>
       </dependencies>


      This effect is really sick. Could anybody explain this effect?

      Regards
      Fenixx