3 Replies Latest reply on Oct 5, 2006 3:13 PM by fbadt

    Entity beans not autodeployed : javax.ejb.EJBException: java

    fbadt

      "all of a sudden" EJB3 CMP entity beans are failing with:

      "javax.ejb.EJBException: java.lang.IllegalArgumentException: Unknown entity: __" when I call em.persist(MyCMPBean) from the session bean. Don't think it matters but... the Session Bean is a Stateless EJB as a webservice. All beans are done with annotations.

      persistence.xml is in the jarfile contained in the ear file and referenced by application.xml as a module. The classes are not explicitly listed however the PU does define "<exclude-unlisted-classes>false</exclude-unlisted-classes>"

      This worked fine until recently and I don't think anything changed (of course something obviously did and I cannot find it)

        • 1. Re: Entity beans not autodeployed : javax.ejb.EJBException:
          alrubinger

          Did you find a solution to this? I'm getting:

          11:57:19,156 INFO [Ejb3Configuration] found EJB3 Entity bean: com.ninem.rx.domain.site.Site


          Great.

          11:57:20,046 INFO [AnnotationBinder] Binding entity from annotated class: com.ninem.rx.domain.site.Site
          11:57:20,046 INFO [EntityBinder] Bind entity com.ninem.rx.domain.site.Site on table site


          Good.

          11:57:20,359 INFO [CollectionBinder] Mapping collection: com.ninem.rx.domain.site.Site.users -> user


          Expected.

          11:57:23,875 WARN [ServiceController] Problem starting service ninem:service=Admin
          javax.ejb.EJBException: java.lang.IllegalArgumentException: Unknown entity: com.ninem.rx.domain.site.Site


          ...why?

          If it matters...I'm injecting my EntityManager via @Resource (It's in JNDI), and this exception occurs in the "start" method of a @Service Bean.

          S,
          ALR

          • 2. Re: Entity beans not autodeployed : javax.ejb.EJBException:
            alrubinger

            In my case, the error was due to a change in the build process. a "persistence.xml" file found its way into the JAR containing one of my services, and therefor this service was injecting the wrong persistence unit, leading to the errors above.

            • 3. Re: Entity beans not autodeployed : javax.ejb.EJBException:
              fbadt

              In our case, someone had deployed both the EAR and the JAR from inside the EAR.