Problems running Seam tests with TestNG and embedded JBoss

Hi everyone,



we use Teamcity in a Seam project that is developed using IntelliJ IDEA. Seam provides integrated testing based on TestNG and an embedded JBoss that allows to test EJB components. I have set up the required run configuration in IDEA, and when started inside IDEA the tests run fine.

Now, I want to run the tests on the Teamcity server using the shared IDEA run configuration. Anyhow, the tests always fail with an error message. It seems that the JBoss virtual file protocol is the cause for the problems. Have a look at the following extract from the log:

[16:16:21]: [java] [Parser] Running:
[16:16:21]: [java]   /usr/share/TeamCity/buildAgent/temp/buildTmp/testng-suite8551872827228340934.xml
[16:16:21]: [java] All tests (19s)
[16:16:39]: [All tests] ERROR [org.jboss.embedded.DeploymentScanner] Failed to deploy
[16:16:39]: [All tests] org.jboss.deployers.spi.DeploymentException: Unable to get VirtualFile for url: file:/home/teamcity/checkout/sfs-ejb/bootstrap/conf/jboss-service.xml
[16:16:39]: [All tests]      at org.jboss.embedded.DeploymentGroup.getVirtualFile(DeploymentGroup.java:179)
[16:16:39]: [All tests]      at org.jboss.embedded.DeploymentGroup.add(DeploymentGroup.java:165)
[16:16:39]: [All tests]      at org.jboss.embedded.DeploymentGroup.addResource(DeploymentGroup.java:326)
[16:16:39]: [All tests]      at org.jboss.embedded.DeploymentScanner.start(DeploymentScanner.java:81)
[16:16:39]: [All tests]      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[16:16:39]: [All tests]      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[16:16:39]: [All tests]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[16:16:39]: [All tests]      at java.lang.reflect.Method.invoke(Method.java:597)
[16:16:39]: [All tests]      at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:56)
[16:16:39]: [All tests]      at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:110)
[16:16:39]: [All tests]      at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
[16:16:39]: [All tests]      at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:214)
[16:16:39]: [All tests]      at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:45)
[16:16:39]: [All tests]      at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:108)
[16:16:39]: [All tests]      at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:69)
[16:16:39]: [All tests]      at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:221)
[16:16:39]: [All tests]      at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.installAction(KernelControllerContextAction.java:135)
[16:16:39]: [All tests]      at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.installAction(KernelControllerContextAction.java:46)
[16:16:39]: [All tests]      at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
[16:16:39]: [All tests]      at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
[16:16:39]: [All tests]      at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
[16:16:39]: [All tests]      at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:327)
[16:16:39]: [All tests]      at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1309)
[16:16:39]: [All tests]      at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:734)
[16:16:39]: [All tests]      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:862)
[16:16:39]: [All tests]      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:784)
[16:16:39]: [All tests]      at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:574)
[16:16:39]: [All tests]      at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:398)
[16:16:39]: [All tests]      at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBean(AbstractKernelDeployer.java:309)
[16:16:39]: [All tests]      at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBeans(AbstractKernelDeployer.java:279)
[16:16:39]: [All tests]      at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deploy(AbstractKernelDeployer.java:130)
[16:16:39]: [All tests]      at org.jboss.kernel.plugins.deployment.xml.BeanXMLDeployer.deploy(BeanXMLDeployer.java:96)
[16:16:39]: [All tests]      at org.jboss.embedded.Bootstrap.deployBaseBootstrapUrl(Bootstrap.java:130)
[16:16:39]: [All tests]      at org.jboss.embedded.Bootstrap.bootstrapURL(Bootstrap.java:142)
[16:16:39]: [All tests]      at org.jboss.embedded.Bootstrap.bootstrap(Bootstrap.java:183)
[16:16:39]: [All tests]      at org.jboss.embedded.Bootstrap.bootstrap(Bootstrap.java:195)
[16:16:39]: [All tests]      at org.jboss.seam.mock.EmbeddedBootstrap.startAndDeployResources(EmbeddedBootstrap.java:11)
[16:16:40]: [All tests]      at org.jboss.seam.mock.AbstractSeamTest.startJbossEmbeddedIfNecessary(AbstractSeamTest.java:1024)
[16:16:40]: [All tests]      at org.jboss.seam.mock.AbstractSeamTest.startSeam(AbstractSeamTest.java:915)
[16:16:40]: [All tests]      at org.jboss.seam.mock.SeamTest.startSeam(SeamTest.java:58)
[16:16:40]: [All tests]      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[16:16:40]: [All tests]      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[16:16:40]: [All tests]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[16:16:40]: [All tests]      at java.lang.reflect.Method.invoke(Method.java:597)
[16:16:40]: [All tests]      at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:607)
[16:16:40]: [All tests]      at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:417)
[16:16:40]: [All tests]      at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:154)
[16:16:40]: [All tests]      at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:88)
[16:16:40]: [All tests]      at org.testng.SuiteRunner.privateRun(SuiteRunner.java:284)
[16:16:40]: [All tests]      at org.testng.SuiteRunner.run(SuiteRunner.java:204)
[16:16:40]: [All tests]      at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:877)
[16:16:40]: [All tests]      at org.testng.TestNG.runSuitesLocally(TestNG.java:842)
[16:16:40]: [All tests]      at org.testng.TestNG.run(TestNG.java:751)
[16:16:40]: [All tests]      at jetbrains.buildServer.agent.ideaRunner.testng.TestNGLauncher.main(TestNGLauncher.java:14)
[16:16:40]: [All tests]      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[16:16:40]: [All tests]      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[16:16:40]: [All tests]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[16:16:40]: [All tests]      at java.lang.reflect.Method.invoke(Method.java:597)
[16:16:40]: [All tests]      at jetbrains.buildServer.agent.ideaRunner.MainClassLauncher.main(MainClassLauncher.java:52)
[16:16:40]: [All tests] Caused by: java.net.MalformedURLException: unknown protocol: vfsfile
[16:16:40]: [All tests]      at java.net.URL.<init>(URL.java:574)
[16:16:40]: [All tests]      at java.net.URL.<init>(URL.java:464)
[16:16:40]: [All tests]      at java.net.URL.<init>(URL.java:413)
[16:16:40]: [All tests]      at org.jboss.virtual.plugins.context.file.FileHandler.<init>(FileHandler.java:75)
[16:16:40]: [All tests]      at org.jboss.virtual.plugins.context.file.FileHandler.<init>(FileHandler.java:89)
[16:16:40]: [All tests]      at org.jboss.virtual.plugins.context.file.FileSystemContext.createVirtualFileHandler(FileSystemContext.java:253)
[16:16:40]: [All tests]      at org.jboss.virtual.plugins.context.file.FileSystemContext.createVirtualFileHandler(FileSystemContext.java:186)
[16:16:40]: [All tests]      at org.jboss.virtual.plugins.context.file.FileSystemContext.<init>(FileSystemContext.java:150)
[16:16:40]: [All tests]      at org.jboss.virtual.plugins.context.file.FileSystemContext.<init>(FileSystemContext.java:124)
[16:16:40]: [All tests]      at org.jboss.virtual.plugins.context.file.FileSystemContext.<init>(FileSystemContext.java:113)
[16:16:40]: [All tests]      at org.jboss.virtual.plugins.context.file.FileSystemContextFactory.getVFS(FileSystemContextFactory.java:51)
[16:16:40]: [All tests]      at org.jboss.virtual.VFS.getVFS(VFS.java:132)
[16:16:40]: [All tests]      at org.jboss.virtual.VFS.getRoot(VFS.java:146)
[16:16:40]: [All tests]      at org.jboss.embedded.DeploymentGroup.getVirtualFile(DeploymentGroup.java:175)
[16:16:40]: [All tests]      ... 58 more

Has anybody an idea what may be the cause? I have tried several fixes mentioned in different post among JBoss/Seam user groups (i.e. set the protocol handler using a system property) but nothing has fixed the problem so far.

Regards,
Stephan

1 comment
Comment actions Permalink

Probably when you start this run configuration from the IntelliJ IDEA Seam plugin adds some system properties (maybe registers this protocol somehow) and this works in IDEA, but on the agent we do not have this plugin and run configuration fails.
Maybe you can find exact command line which is used to run the tests in the IntelliJ IDEA?

0

Please sign in to leave a comment.