5 Replies Latest reply on Feb 18, 2008 9:10 AM by Olivier Thierry

    CONTEXTS MISSING DEPENDENCIES with SeamTest

    Olivier Thierry Apprentice

      Hi,

      I try to use JBoss embedded to test Seam components in a Maven project. I use Maven 2.0.4, Seam 2.0.1.GA and JBoss embedded beta3. I use JDK 5.0.11.

      I have this stack trace on JBoss embedded bootstrap :

      org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
      *** CONTEXTS MISSING DEPENDENCIES: Name -> Dependency{Required State:Actual State}
      jboss.jdbc:datasource=jdbc/t4Seam,service=metadata
       -> jboss.jdbc:service=metadata{Start:** NOT FOUND **}
       -> jboss.jdbc:service=metadata{Create:** NOT FOUND **}
      *** CONTEXTS IN ERROR: Name -> Error
      jboss.jdbc:service=metadata -> ** NOT FOUND **
      
       at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:576)
       at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:559)
       at org.jboss.embedded.Bootstrap.bootstrapURL(Bootstrap.java:149)
       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.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)


      It looks like it can't find my datasource file. I put yet the following ds.xml file in "deploy" directory.

      <?xml version="1.0" encoding="UTF-8"?>
      <!-- JBoss Server DataSource -->
      <datasources>
       <local-tx-datasource>
       <jndi-name>jdbc/t4Seam</jndi-name>
       <connection-url>jdbc:mysql://localhost:3306/test</connection-url>
       <driver-class>com.mysql.jdbc.Driver</driver-class>
       <user-name>T4</user-name>
       <password>T4</password>
       <metadata>
       <type-mapping>mySQL</type-mapping>
       </metadata>
       </local-tx-datasource>
      </datasources>


      I have absolutely no idea what happens. Anyone could help me ?

        • 1. Re: CONTEXTS MISSING DEPENDENCIES with SeamTest
          Olivier Thierry Apprentice

          Forgot to say that I got JBoss embedded bootstrap files from Seam 2.0.1.GA distribution. I just added my t4Seam-ds-xml.file in deploy directory.

          • 2. Re: CONTEXTS MISSING DEPENDENCIES with SeamTest
            Olivier Thierry Apprentice

            Well, it looks like my datasource is well initialized. I set the log level to DEBUG and I can see these lines in the logs :

            INFO [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=jdbc/t4Seam' to JNDI name 'java:jdbc/t4Seam'
            DEBUG [jboss.resource.adapter.jdbc.remote.WrapperDataSourceService] Started jboss.jca:service=DataSourceBinding,name=jdbc/t4Seam
            DEBUG [org.jboss.system.ServiceCreator] About to create bean: jboss.jdbc:service=metadata,datasource=jdbc/t4Seam with code: org.jboss.ejb.plugins.cmp.jdbc.metadata.DataSourceMetaData
            DEBUG [org.jboss.system.ServiceCreator] Created mbean: jboss.jdbc:service=metadata,datasource=jdbc/t4Seam
            DEBUG [org.jboss.system.ServiceConfigurator] MetadataLibrary set to jboss.jdbc:service=metadata in jboss.jdbc:service=metadata,datasource=jdbc/t4Seam
            DEBUG [org.jboss.system.ServiceConfigurator] TypeMapping set to mySQL in jboss.jdbc:service=metadata,datasource=jdbc/t4Seam
            DEBUG [org.jboss.system.ServiceController] Creating service jboss.jdbc:service=metadata,datasource=jdbc/t4Seam
            DEBUG [org.jboss.system.ServiceController] Waiting in create of jboss.jdbc:service=metadata,datasource=jdbc/t4Seam on jboss.jdbc:service=metadata
            DEBUG [org.jboss.system.ServiceController] starting service jboss.jdbc:service=metadata,datasource=jdbc/t4Seam
            DEBUG [org.jboss.system.ServiceController] Waiting in start of jboss.jdbc:service=metadata,datasource=jdbc/t4Seam on
            DEBUG [org.jboss.deployers.plugins.deployers.DeployersImpl] Fully Deployed vfsfile:/C:/Documents/t4Seam/core/target/test-classes/deploy/t4Seam-ds.xml


            So what could cause this error ?

            • 3. Re: CONTEXTS MISSING DEPENDENCIES with SeamTest
              Olivier Thierry Apprentice

              Well, it looks like the tag is not supported in *-ds.xml files ! I removed it and I have no more the error ! I understood that JBoss embedded is a JBoss 5 server, used to work with JBoss 4.2, but what is the equivalent now ?

              • 5. Re: CONTEXTS MISSING DEPENDENCIES with SeamTest
                Olivier Thierry Apprentice

                I was talking about the "metadata" tag that should be used to set the type mapping for Java persistance. If you use it in a datasource XML file, it fails as I showed at the beginning of this topic ;) I used to configure my datasource this way with JBoss 4.2, so has something changed about this with JBoss 5 ?