Hi,
I'm new to JBoss and Eclipse. I've been using NetBeans and GlassFish for
Java EE development.
Now I'm working on a very simple PoC just to see how I can use these
technologies. I have a very simple
JPA project. It contains a persistence xml and a few entities, inherited
from each other.
persistence.xml excrept:
<persistence version="1.0" ...>
<persistence-unit name="HotelPoi" transaction-type="JTA">
...
</persistence-unit>
</persistence>
I have an EJB project too, it contains a stateless session bean. The bean
injects a persistence unit this way:
@PersistenceUnit(name="HotelPoi")
EntityManager em;
I receive the following deploy-time exception:
2010-11-10 12:19:51,656 DEBUG [org.jboss.ejb3.Ejb3Module] Starting failed
jboss.j2ee:service=EJB3,module=HotelPoiFinder.jar
java.lang.RuntimeException: Illegal @PersistenceUnit on
javax.persistence.EntityManager com.edreams.poi.finder.PoiFinder.em
:There is no default persistence unit in this deployment.
at
org.jboss.injection.PersistenceUnitHandler.handleFieldAnnotations(PersistenceUnitHandler.java:247)
at
org.jboss.injection.InjectionUtil.processFieldAnnotations(InjectionUtil.java:137)
at
org.jboss.injection.InjectionUtil.processAnnotations(InjectionUtil.java:174)
I double-checked the ear and it contains the JpaProject in the lib
directory. I placed it in the root dir too and receive the same exception.
I'm using JBoss 4.2.3.GA and Eclipse with the following build id:
20100617-1415
Do you have any ideas how to make this injection work?
Best Regards,
Tamas