4 Replies Latest reply on Feb 14, 2011 3:14 AM by jaikiran

    UNRESOLVED Demands persistence.unit:unitName

    cpt.byte

      When i try to deploy my "little test-application" (name PBWL) i got the following error:

      15:33:56,675 WARN [HDScanner] Failed to process changes
      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.j2ee:ear=PBWL-ear.ear,jar=PBWL-ejb.jar,name=ManagerImpl,service=EJB3
       -> <UNKNOWN jboss.j2ee:ear=PBWL-ear.ear,jar=PBWL-ejb.jar,name=ManagerImpl,service=EJB3>{Described:** UNRESOLVED Demands 'persistence.unit:unitName=PBWL-ear.ear/PBWL-ejb.jar#PBWL' **}
      
      persistence.unit:unitName=PBWL-ear.ear/PBWL-ejb.jar#PBWL
       -> jboss.jca:name=PBWLDatasource,service=DataSourceBinding{Create:** NOT FOUND Depends on 'jboss.jca:name=PBWLDatasource,service=DataSourceBinding' **}
      
      
      *** CONTEXTS IN ERROR: Name -> Error
      
      jboss.jca:name=PBWLDatasource,service=DataSourceBinding -> ** NOT FOUND Depends on 'jboss.jca:name=PBWLDatasource,service=DataSourceBinding' **
      
      <UNKNOWN jboss.j2ee:ear=PBWL-ear.ear,jar=PBWL-ejb.jar,name=ManagerImpl,service=EJB3> -> ** UNRESOLVED Demands 'persistence.unit:unitName=PBWL-ear.ear/PBWL-ejb.jar#PBWL' **
      
      
       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:471)
       at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351)
       at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:165)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:267)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
       at java.lang.Thread.run(Thread.java:636)


      I don't know what i did wrong or better say what i've done. First it worked, then i got exception that a EJB was not found and now i got this error. I already tried to remove the complemte project from deploy and restart a blank server without any success.

      My config: JBoss 5.0.0.GA, JBoss Seam 2.1.1.GA, Eclipse 3.4.1 with JBoss Tools. All on Ubunutu ;)

      Hope someone can help me.


        • 1. Re: UNRESOLVED Demands persistence.unit:unitName
          koombal

          have u found a solution? i am having the same problem...

          thanks

          • 2. Re: UNRESOLVED Demands persistence.unit:unitName
            jaikiran

            koombal,

            Please post more details about your application, the version of JBoss and Java and the error you are running into. As far as the error the original poster is running into is concerned, the datasource doesn't seem to have been deployed.

            • 3. Re: UNRESOLVED Demands persistence.unit:unitName
              asookazian

              I am experiencing this in JBoss 5.1.0.GA running on RHEL and JRE 1.6.0.

               

              There are dozens of instances of output in server.log similar to this:

               

                {code:java}Deployment "<UNKNOWN jboss.j2ee:ear=com.echo.reports.ear-1.6.0-SNAPSHOT.ear,jar=com.echo.dilling.dao-1.6.0-SNAPSHOT.jar,name=EventHibernateDAO,service=EJB3>" is in error due to the following reason(s): ** UNRESOLVED Demands 'persistence.unit:unitName=com.echo.reports.ear-1.6.0-SNAPSHOT.ear/lib/com.echo.billing.domain-1.6.0-SNAPSHOT.jar#billing-persistence-unit' **{code}

               

              Here is the application.xml:

               

               

              {code:java}<?xml version="1.0" encoding="UTF-8"?>

              <application xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd" version="5">

                <description>ECHO BILLING</description>

                <display-name>ECHO BILLING</display-name>

                <module>

                    <ejb>com.echo.cis.ejb.dao-1.6.0-SNAPSHOT.jar</ejb>

                </module>

                <module>

                      <ejb>com.echo.cis.crud.dao-1.6.0-SNAPSHOT.jar</ejb>

                </module>

                <module>

                    <ejb>com.echo.cis.editors-1.6.0-SNAPSHOT.jar</ejb>

                </module> 

                <module>

                  <ejb>com.echo.dilling.services.reports-1.6.0-SNAPSHOT.jar</ejb>

                </module>

                <module>

                  <ejb>com.echo.dilling.dao-1.6.0-SNAPSHOT.jar</ejb>

                </module> 

                <module>

                  <ejb>com.echo.dilling.reports-1.6.0-SNAPSHOT.jar</ejb>

                </module>

                <module>

                  <ejb>com.echo.dilling.reports.services.persistence-1.6.0-SNAPSHOT.jar</ejb>

                </module>

                <module>

                  <ejb>com.echo.dilling.reports.dao.gemini-1.6.0-SNAPSHOT.jar</ejb>

                </module> 

              </application>{code}

               

              Note that I replaced all instance of 'billing' with 'dilling' to workaround/fix problem reported here: http://community.jboss.org/message/586523#586523

               

              After that change, I am seeing this problem.  There is an @PersistenceContext in the hibernate DAO class which specifies the PU.  The PU is in the persistence.xml file in the EAR lib directory.  It is being referenced from a class in the EAR root JAR (EJB).  Why can't it find the PU in the /lib persistence.xml?  This all works fine in 4.2.2.GA.

               

               

              {code:java}

              @Stateless

              public class EventHibernateDAO extends GenericHibernateDAO<Event, Long>

                      implements EventDAO {

               

                  @PersistenceContext(unitName = PersistenceUnits.BILLING_PERSISTENCE_UNIT)

                  private EntityManager entityManager;

               

              ...

              }

              {code}

               

              and yes, I did rename the JARs affected to 'dilling' accordingly in the EAR prior to re-deployment.

               

              Here is the contents of the /meta-inf/MANIFEST.MF for the JAR (com.echo.dilling.dao-1.6.0-SNAPSHOT.jar).  This was generated by Maven 2.0.8 and you can see that the other jar in question is referenced in the Class-Path element below (but it's spelled 'billing' instead of 'dilling'!).  I think I found my problem!

               

               

              {code:java}

              Manifest-Version: 1.0

              Archiver-Version: Plexus Archiver

              Created-By: Apache Maven

              Built-By: asookazian

              Build-Jdk: 1.6.0_23

              Class-Path: com.echo.common.persistence.dao-1.0.14.jar commons-lang-2.

              3.jar com.echo.billing.domain-1.6.0-SNAPSHOT.jar

              {code}

              • 4. UNRESOLVED Demands persistence.unit:unitName
                jaikiran

                Arbi Sookazian wrote:

                 

                There is an @PersistenceContext in the hibernate DAO class which specifies the PU.  The PU is in the persistence.xml file in the EAR lib directory.  It is being referenced from a class in the EAR root JAR (EJB).  Why can't it find the PU in the /lib persistence.xml? 

                I haven't looked at the rest of the details in your post, but a persistence.xml in the lib of a .ear isn't the right place. You'll have to place the persistence.xml in the META-INF of some .jar file for it to be picked up. The entire list of allowed locations is available in the JPA spec.