8 Replies Latest reply on Dec 29, 2008 10:25 AM by Juan Ignacio Sánchez Lara

    UNRESOLVED Demands datasource at test

    Juan Ignacio Sánchez Lara Apprentice

      I'm following Seam in Action, chapter 14, in order to get jBPM to work. I have already configured both XA datasources (application and jBPM, as said in the book), and I have a trivial process. I can deploy to JBoss 4.2 right. The problem is that I can't run tests. I get this exception:


      org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
      
      *** CONTEXTS MISSING DEPENDENCIES: Name -> Dependency{Required State:Actual State}
      
      persistence.units:unitName=myunit
       -> <UNKNOWN>{Described:** UNRESOLVED Demands 'jboss.jca:name=myunitDatasource,service=DataSourceBinding **}
      
      
      *** CONTEXTS IN ERROR: Name -> Error
      
      <UNKNOWN> -> ** UNRESOLVED Demands 'jboss.jca:name=myunitDatasource,service=DataSourceBinding **
      
      
              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.DeploymentGroup.process(DeploymentGroup.java:128)
              at org.jboss.embedded.Bootstrap.deployResourceBases(Bootstrap.java:289)
              at org.jboss.seam.mock.EmbeddedBootstrap.startAndDeployResources(EmbeddedBootstrap.java:15)
              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(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
              at java.lang.reflect.Method.invoke(Unknown Source)
              at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:604)
              at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:394)
              at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:142)
              at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:79)
              at org.testng.SuiteRunner.privateRun(SuiteRunner.java:261)
              at org.testng.SuiteRunner.run(SuiteRunner.java:190)
              at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:792)
              at org.testng.TestNG.runSuitesLocally(TestNG.java:765)
              at org.testng.TestNG.run(TestNG.java:699)
              at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73)
              at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:122)
      



      I have put both datasource-ds.xml at test-src/META-INF (at the test project), where jboss-tools states me to put them.


      What might I be doing wrong?

        • 1. Re: UNRESOLVED Demands datasource at test
          Juan Ignacio Sánchez Lara Apprentice

          If I copy both datasource files to bootstrap/deploy (which I'm not sure being supposed to do) I get a different error:


          jboss.jca:name=myunitDatasource,service=DataSourceBinding
           -> jboss:service=invoker,type=jrmp{Create:** NOT FOUND **}
           -> jboss:service=invoker,type=jrmp{Start:** NOT FOUND **}
          
          jboss.jca:name=myunitJbpmDatasource,service=DataSourceBinding
           -> jboss:service=invoker,type=jrmp{Start:** NOT FOUND **}
           -> jboss:service=invoker,type=jrmp{Create:** NOT FOUND **}
          

          • 2. Re: UNRESOLVED Demands datasource at test
            Matt Nirgue Newbie

            I'm quite certain that the right location is the bootstrap/deploy folder.


            Just a few question so it's easier for us to help you out: How do you run your tests? Do you use Maven, Ant or the TestNG plugin? Do you use JBoss embedded or do you deploy them on a server?

            • 3. Re: UNRESOLVED Demands datasource at test
              Juan Ignacio Sánchez Lara Apprentice

              Ok, I resign, I'll put them there :)


              I'm running the tests with the TestNG Eclipse plugin, with JBoss embedded.

              • 4. Re: UNRESOLVED Demands datasource at test
                Juan Ignacio Sánchez Lara Apprentice

                FYI this is the whole error trace


                [Parser] Running:
                  C:\workspace\myunit-test\temp-testng-customsuite.xml
                
                FAILED CONFIGURATION: @BeforeSuite startSeam
                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.jca:name=myunitDatasource,service=DataSourceBinding
                 -> jboss:service=invoker,type=jrmp{Create:** NOT FOUND **}
                 -> jboss:service=invoker,type=jrmp{Start:** NOT FOUND **}
                
                jboss.jca:name=myunitJbpmDatasource,service=DataSourceBinding
                 -> jboss:service=invoker,type=jrmp{Create:** NOT FOUND **}
                 -> jboss:service=invoker,type=jrmp{Start:** NOT FOUND **}
                
                
                *** CONTEXTS IN ERROR: Name -> Error
                
                jboss:service=invoker,type=jrmp -> ** 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.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)
                ... Removed 15 stack frames
                SKIPPED CONFIGURATION: @BeforeClass setupClass
                SKIPPED CONFIGURATION: @BeforeMethod begin
                SKIPPED CONFIGURATION: @AfterMethod end
                SKIPPED CONFIGURATION: @AfterClass cleanupClass
                SKIPPED: testPedidoStock
                
                ===============================================
                    es.juanignaciosl.myunit.pedidos.PedidoStockTest
                    Tests run: 1, Failures: 0, Skips: 1
                    Configuration Failures: 1, Skips: 4
                ===============================================
                
                
                ===============================================
                myunit-test
                Total tests run: 1, Failures: 0, Skips: 1
                Configuration Failures: 1, Skips: 5
                ===============================================
                
                



                Thank you in advance

                • 5. Re: UNRESOLVED Demands datasource at test
                  Juan Ignacio Sánchez Lara Apprentice

                  SOLVED. It seem I'd followd the wrong instructions. I'd looked a MySQL example, but Oracle has its own issues. Following the right ones for Oracle datasources at JBoss Server solved the problem.


                  Thank you very much!

                  • 6. Re: UNRESOLVED Demands datasource at test
                    Juan Ignacio Sánchez Lara Apprentice

                    Well, I solved that error, but not the following one:


                    ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to Start: name=persistence.units:unitName=myunit state=Create
                    java.lang.RuntimeException: Specification violation [EJB3 JPA 6.2.1.2] - You have not defined a jta-data-source for a JTA enabled persistence context named: myunit
                            at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:230)
                            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                    ...
                            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)
                    FAILED CONFIGURATION: @BeforeSuite startSeam
                    org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
                    
                    *** CONTEXTS IN ERROR: Name -> Error
                    
                    persistence.units:unitName=myunit -> java.lang.RuntimeException: Specification violation [EJB3 JPA 6.2.1.2] - You have not defined a jta-data-source for a JTA enabled persistence context named: myunit
                    
                    
                            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.DeploymentGroup.process(DeploymentGroup.java:128)
                            at org.jboss.embedded.Bootstrap.deployResourceBases(Bootstrap.java:289)
                            at org.jboss.seam.mock.EmbeddedBootstrap.startAndDeployResources(EmbeddedBootstrap.java:15)
                            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)
                    ... Removed 15 stack frames
                    SKIPPED CONFIGURATION: @BeforeClass setupClass
                    SKIPPED CONFIGURATION: @BeforeMethod begin
                    SKIPPED CONFIGURATION: @AfterMethod end
                    SKIPPED CONFIGURATION: @AfterClass cleanupClass
                    SKIPPED: testPedidoStock
                    
                    ===============================================
                        es.juanignaciosl.myunit.pedidos.PedidoStockTest
                        Tests run: 1, Failures: 0, Skips: 1
                        Configuration Failures: 1, Skips: 4
                    ===============================================
                    
                    
                    ===============================================
                    myunit-test
                    Total tests run: 1, Failures: 0, Skips: 1
                    Configuration Failures: 1, Skips: 5
                    ===============================================
                    



                    I'm following 'Seam in Action', chapter 14, instructions in order to set up two XA datasources. I'm running the TestNG test with Eclipse plugin at Embedded JBoss. My database is Oracle.


                    Persistence unit definition:


                    <?xml version="1.0" encoding="UTF-8"?>
                    <!-- Persistence deployment descriptor for dev profile -->
                    <persistence xmlns="http://java.sun.com/xml/ns/persistence" 
                                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                                 xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" 
                                 version="1.0">
                                 
                       <persistence-unit name="myunit" transaction-type="JTA">
                          <provider>org.hibernate.ejb.HibernatePersistence</provider>
                          <non-jta-data-source>myunitDatasource</non-jta-data-source>
                          <properties>
                             <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle9iDialect"/>
                             <property name="hibernate.hbm2ddl.auto" value="update"/>
                             <property name="hibernate.show_sql" value="true"/>
                             <property name="hibernate.format_sql" value="true"/>
                             <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
                          </properties>
                       </persistence-unit>
                        
                    </persistence>
                    

                    • 7. Re: UNRESOLVED Demands datasource at test
                      Juan Ignacio Sánchez Lara Apprentice

                      If I replace 'non-jta-data-source' with 'jta-data-source' it throws a javax.naming.NameNotFoundException.


                      • 8. Re: UNRESOLVED Demands datasource at test
                        Juan Ignacio Sánchez Lara Apprentice

                        Yet another self reply:


                        <jta-data-source>java:/ymtextilDatasource</jta-data-source>
                        



                        Excuse me for the spam :(