1 Reply Latest reply on Apr 4, 2008 9:27 PM by Siarhei Dudzin

    Can't start JBoss embedded from a Maven project

    Olivier Thierry Apprentice

      Hi all,


      I try to test Seam components in a Maven project. But I can't start JBoss embedded. I followed instructions in chapter 33.3.1 of Seam documentation, so I added the following dependencies to my project :


      <dependency>
          <groupId>org.jboss.seam.embedded</groupId>
          <artifactId>hibernate-all</artifactId>
          <version>beta3</version>
          <scope>test</scope>
      </dependency>
      <dependency>
          <groupId>org.jboss.seam.embedded</groupId>
          <artifactId>jboss-embedded-all</artifactId>
          <version>beta3</version>
          <scope>test</scope>
          <exclusions>
              <exclusion>
                  <groupId>org.jboss.seam.embedded</groupId>
                  <artifactId>jboss-embedded-api</artifactId>
              </exclusion>
          </exclusions>
      </dependency>
      <dependency>
          <groupId>org.jboss.seam.embedded</groupId>
          <artifactId>thirdparty-all</artifactId>
          <version>beta3</version>
          <scope>test</scope>
      </dependency>
      <dependency>
          <groupId>org.jboss.seam.embedded</groupId>
          <artifactId>jboss-embedded-api</artifactId>
          <version>beta3</version>
          <scope>test</scope>
          <exclusions>
              <exclusion>
                  <groupId>org.jboss.microcontainer</groupId>
                  <artifactId>jboss-deployers-client-spi</artifactId>
              </exclusion>
          </exclusions>
      </dependency>
      <dependency>
          <groupId>javax.faces</groupId>
          <artifactId>jsf-api</artifactId>
          <version>1.2_08</version>
          <scope>test</scope>
      </dependency>
      <dependency>
          <groupId>javax.activation</groupId>
          <artifactId>activation</artifactId>
          <version>1.1</version>
          <scope>test</scope>
      </dependency>
      <dependency>
          <groupId>org.jboss.el</groupId>
          <artifactId>jboss-el</artifactId>
          <version>2.0.1.GA</version>
      </dependency>
      <dependency>
          <groupId>org.jboss.seam</groupId>
          <artifactId>jboss-seam</artifactId>
          <version>2.0.1.GA</version>
      </dependency>



      I had to exclude some JBoss embedded dependencies because some transitive dependencies could not be resolved. I also have dependencies to JBoss jars which contain javax annotations:


      <dependency>
          <groupId>org.jboss</groupId>
          <artifactId>jboss-j2ee</artifactId>
          <version>4.2.0-GA</version>
          <scope>provided</scope>
      </dependency>
      <dependency>
          <groupId>org.jboss</groupId>
          <artifactId>jboss-ejb3x</artifactId>
          <version>4.2.0-GA</version>
          <scope>provided</scope>
      </dependency>
      <dependency>
          <groupId>org.jboss</groupId>
          <artifactId>ejb3-persistence</artifactId>
          <version>4.2.0-GA</version>
          <scope>provided</scope>
      </dependency>



      I then copied the content of bootstrap directory generated by seam-gen to my test resources directory.


      But when running tests, I have the following stack trace wchich I guess is caused by a failure on JBoss embedded startup:


      ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to Parse: name=vfsjar:file:/c:/documents/.m2/repository/fr/xxx/t4/t4-core-core/1.0-SNAPSHOT/t4-core-core-1.0-SNAPSHOT.jar!/ state=Not Installed mode=Manual requiredState=Parse
      org.jboss.deployers.spi.DeploymentException: Error creating managed object for vfsjar:file:/c:/documents/.m2/repository/fr/xxxt4/t4-core-core/1.0-SNAPSHOT/t4-core-core-1.0-SNAPSHOT.jar!/
           at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
           at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:232)
           at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:199)
           at org.jboss.deployment.JBossEjbParsingDeployer.createMetaData(JBossEjbParsingDeployer.java:105)
           at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.deploy(AbstractParsingDeployerWithOutput.java:162)
           at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:169)
           at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:853)
           at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:794)
           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.change(AbstractController.java:622)
           at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:411)
           at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:498)
           at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:506)
           at org.jboss.embedded.DeploymentGroup.process(DeploymentGroup.java:127)
           at org.jboss.embedded.Bootstrap.deployResourceBases(Bootstrap.java:289)
           at org.jboss.seam.mock.EmbeddedBootstrap.startAndDeployResources(EmbeddedBootstrap.java:19)
           at org.jboss.seam.mock.BaseSeamTest.startJbossEmbeddedIfNecessary(BaseSeamTest.java:1041)
           at org.jboss.seam.mock.BaseSeamTest.startSeam(BaseSeamTest.java:935)
           at org.jboss.seam.mock.BaseSeamTest.init(BaseSeamTest.java:923)
           at org.jboss.seam.mock.SeamTest.init(SeamTest.java:42)
           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.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:166)
           at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:103)
           at org.testng.TestRunner.runWorkers(TestRunner.java:689)
           at org.testng.TestRunner.privateRun(TestRunner.java:566)
           at org.testng.TestRunner.run(TestRunner.java:466)
           at org.testng.SuiteRunner.runTest(SuiteRunner.java:301)
           at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:296)
           at org.testng.SuiteRunner.privateRun(SuiteRunner.java:276)
           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:77)
           at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:92)
           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:585)
           at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:334)
           at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:980)
      Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse source: Element {http://java.sun.com/xml/ns/javaee}jboss is not bound as a global element.
           at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:193)
           at org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:153)
           at org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer.parse(SchemaResolverDeployer.java:120)
           at org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer.parse(AbstractVFSParsingDeployer.java:86)
           at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:223)
           ... 51 more
      Caused by: org.jboss.xb.binding.JBossXBRuntimeException: Element {http://java.sun.com/xml/ns/javaee}jboss is not bound as a global element.
           at org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.startElement(SundayContentHandler.java:662)
           at org.jboss.xb.binding.parser.sax.SaxJBossXBParser$DelegatingContentHandler.startElement(SaxJBossXBParser.java:407)
           at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
           at org.apache.xerces.xinclude.XIncludeHandler.startElement(Unknown Source)
           at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
           at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
           at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
           at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
           at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
           at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
           at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
           at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
           at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
           at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:189)
           ... 55 more



      I have absolutely no idea what the problem is. Anyone has an idea what this stack trace means ?


      Thanks in advance


      Olivier