[ajug-members] java.lang.RuntimeException: <injection-target> - error
Pratik Patel
pratik.r.patel at gmail.com
Mon Feb 2 08:18:23 EST 2009
You need to post your persistence.xml. It's likely you haven't set the name
attribute in this file to "persistentUnitJndi" . Also, you likely need to
move the
@PersistenceContext(name = PERSISTENT_UNIT_JNDI_NAME)
into the subclass rather than the BaseDAO class.
On Mon, Feb 2, 2009 at 3:56 AM, Sima Felix <simafe_2000 at yahoo.com> wrote:
> 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
>
>
>
>
> _______________________________________________
> ajug-members mailing list
> ajug-members at ajug.org
> http://www.ajug.org/mailman/listinfo/ajug-members
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.ajug.org/pipermail/ajug-members/attachments/20090202/d9e6172a/attachment.html
More information about the ajug-members
mailing list