[ajug-members] java.lang.RuntimeException: <injection-target> - error

Sima Felix simafe_2000 at yahoo.com
Mon Feb 2 03:56:04 EST 2009


Hello.
 
During deploying of my ear I get the following error: 

java.lang.RuntimeException: <injection-target> could not be found: com.javawebwizard.common.persistence.dao.jpa.BaseDAO.persistentUnitJndi 

which really confuses me. I don't know what to check  
Any help would be highly appreaciated. Please see the code below: 

My JSF managed bean: 
public class MagazinBackingBean { 
@EJB 
MagazinFacade facade; 
... 


The EJB: 
@Stateless 
@PersistenceContext(name = BaseDAO.PERSISTENT_UNIT_JNDI_NAME, unitName="magazinPU") 
public class MagazinFacadeBean implements MagazinFacade { 

@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) 
public void inregistreazaMagazin(String cif) throws JWWException { 
MagazinPO magazin = new MagazinPO(); 
magazin.setCif(cif); 
MagazinDAO dao = new MagazinDAO(); 
dao.insert(magazin); 
} 
} 

MagazinDAO extends BaseDAO: 
package com.javawebwizard.common.persistence.dao.jpa; 

public class BaseDAO { 
public static final String PERSISTENT_UNIT_JNDI_NAME = "persistentUnitJndi"; 

@PersistenceContext(name = PERSISTENT_UNIT_JNDI_NAME) 
private EntityManager em; 
... 

The application.xml file: 
<?xml version="1.0" encoding="UTF-8"?> 
<description>Magazin</description> 
<display-name>Magazin</display-name> 
<module> 
<ejb>Magazin-ejb.jar</ejb> 
</module> 
<module> 
<web> 
<web-uri>Magazin-war.war</web-uri> 
<context-root>Magazin</context-root> 
</web> 
</module> 
<module> 
<java>common.jar</java>> <- BaseDao is in here! 
</module> 
</application> 

Thanks, 
Felix 
Use www.jaaava.com - A Google CSE for Java 


      



More information about the ajug-members mailing list