1 Reply Latest reply on Nov 18, 2006 5:08 PM by Murilo Tavares

    PersistenceUnit error

    Ralph Michelsen Newbie


      I hope someone can help me. I get the following error on deployment of my bean.ear file on jboss-4.0.4RC1:

      16:53:41,795 WARN [ServiceController] Problem starting service jboss.j2ee:service=EJB3,module=calc
      java.lang.RuntimeException: Field javax.persistence.EntityManager org.jboss.tutorial.stateless.bean
      .CalculatorBean.em @PersistenceUnit in error: EMPTY STRING unitName but there is no deployments in

      I can see, that the error occurs in the JNDI. When the server tries to locate my EntityManager.

      EntityManager em;

      Here is my persistence.xml:

      <persistence xmlns="http://java.sun.com/xml/ns/persistence"
      xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
      <persistence-unit name="manager1" transaction-type="JTA">


      Regards Ralph Michelsen, Denmark

        • 1. Re: PersistenceUnit error
          Murilo Tavares Newbie

          Hi There.
          I was with this same problem, and after many hours, I found out what was wrong, at least, in my case.
          In my case this error ocurred because the EJB jar file was not very fine. I am creating the jar file using the ant "jar" task, and I was inserting the META-INF subdirectory using the "zipfileset" task. Althought I was able to open the jar file and see the META-INF inside it, I got some warnings about it in the Linux command line zip command.
          When I changed the "zipfileset" for the "fileset" task, the problem desapeared. See my ant tasks:

          after (with the conf files properly moved):

          I know this case is very specific, but maybe you should check your JAR file's META-INF integrity.
          Remembering that in my case it was not very clear that it had inconsistency, because graphical Zip programs could read it nicely.