4 Replies Latest reply on Jan 5, 2009 4:07 AM by jaikiran

    JBoss 5 deployement problem

    hatem1982

      Hi all,
      I am trying to deploy JEE application using JBOSS 5 GA. Under JBoss 4.x.x the application works fine but under JBoss 5 GA I get the following error in the server log:



      *** CONTEXTS MISSING DEPENDENCIES: Name -> Dependency{Required State:Actual State}
      
      jboss.j2ee:jar=StudProject.jar,name=JPQLManager,service=EJB3
       -> <UNKNOWN jboss.j2ee:jar=StudProject.jar,name=JPQLManager,service=EJB3>{Described:** UNRESOLVED Demands 'persistence.unit:unitName=#StudProject' **}
      
      jboss.j2ee:jar=StudProject.jar,name=NativeSqlManager,service=EJB3
       -> <UNKNOWN jboss.j2ee:jar=StudProject.jar,name=NativeSqlManager,service=EJB3>{Described:** UNRESOLVED Demands 'persistence.unit:unitName=#StudProject' **}
      
      persistence.unit:unitName=#StudProject
       -> jboss.jca:name=studProjectDS
       ,service=DataSourceBinding{Create:** NOT FOUND Depends on 'jboss.jca:name=studProjectDS
       ,service=DataSourceBinding' **}
      
      
      *** CONTEXTS IN ERROR: Name -> Error
      
      jboss.jca:name=studProjectDS
       ,service=DataSourceBinding -> ** NOT FOUND Depends on 'jboss.jca:name=studProjectDS
       ,service=DataSourceBinding' **
      
      <UNKNOWN jboss.j2ee:jar=StudProject.jar,name=NativeSqlManager,service=EJB3> -> ** UNRESOLVED Demands 'persistence.unit:unitName=#StudProject' **
      
      <UNKNOWN jboss.j2ee:jar=StudProject.jar,name=JPQLManager,service=EJB3> -> ** UNRESOLVED Demands 'persistence.unit:unitName=#StudProject' **
      
      
       at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:863)
       at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:665)
       at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:293)
       at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)
       at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
       at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
       at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
       at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
       at java.lang.Thread.run(Thread.java:619)
      


      I searched the forum and found the same problem in another thread (using another JBoss version) and tried all the sugessted solutions but I still have the same problem.

      Thanks in advance for any help

      Hatem

        • 1. Re: JBoss 5 deployement problem
          jaikiran

           

          ervice=DataSourceBinding{Create:** NOT FOUND Depends on 'jboss.jca:name=studProjectDS
          ,service=DataSourceBinding' **}




          Have you deployed the datasource (the -ds.xml) which configures your studProjectDS?

          • 2. Re: JBoss 5 deployement problem
            hatem1982

            Hi Jaikiran,
            I made sure that I have my datasource in the deployment directory. And I also checked that the deployed jar includes the persistence.xml file which uses the datasource, but I still have the same problem.

            Here is my -ds.xml:

            <?xml version="1.0" encoding="UTF-8"?>
            
            
            <datasources>
             <local-tx-datasource>
             <jndi-name>studProjectDS</jndi-name>
             <connection-url>jdbc:postgresql://localhost:5432/Studproject</connection-url>
             <driver-class>org.postgresql.Driver</driver-class>
             <user-name>postgres</user-name>
             <password>admin</password>
             <!-- the minimum size of the connection pool -->
             <min-pool-size>1</min-pool-size>
             <!-- The maximum connections in a pool/sub-pool -->
             <max-pool-size>100</max-pool-size>
             </local-tx-datasource>
            </datasources>
            


            And here is the persistence.xml:

            <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="StudProject">
             <jta-data-source>java:studProjectDS
             </jta-data-source>
             <properties>
             <property name="hibernate.hbm2ddl.auto" value="update" />
            
             <property name="hibernate.show_sql" value="true"/>
            
             </properties>
             </persistence-unit>
            </persistence>
            


            Any suggestions are appreciated.

            Hatem

            PS: Sorry for the late reply I was on a vacation

            • 3. Re: JBoss 5 deployement problem
              jaikiran

               

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


              persistence.unit:unitName=#StudProject
               -> jboss.jca:name=studProjectDS
               ,service=DataSourceBinding{Create:** NOT FOUND Depends on 'jboss.jca:name=studProjectDS
               ,service=DataSourceBinding' **}
              


              Looks like a bug in the persistence.xml parsing. The newline (and maybe even the leading and trailing space) doesn't seem to be trimmed while parsing the jta-data-source element.

              Change the persistence.xml to:

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




              • 4. Re: JBoss 5 deployement problem
                jaikiran

                 

                "jaikiran" wrote:

                Looks like a bug in the persistence.xml parsing. The newline (and maybe even the leading and trailing space) doesn't seem to be trimmed while parsing the jta-data-source element.

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



                The change that i mentioned should work. But i don't think its a bug in parsing. I just read the persistence xsd http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd

                <xsd:element name="jta-data-source" type="xsd:string"
                 minOccurs="0">
                


                The type is defined as xsd:string which allows newlines, leading and trailing space etc... So i think, the parser which converts this xml should let the newlines remain as is. It's upto the user to specify the correct value.