Bookmark Topic Watch Topic
  • New Topic

java.lang.RuntimeException: <injection-target> - error

 
Felix Sima
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Report post to moderator
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 appreciated. Please see the code below:

My JSF managed bean:


The EJB:


MagazinDAO extends BaseDAO:


The application.xml file:


Thanks,
Felix
Use www.jaaava.com - A Google CSE for Java
 
Felix Sima
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi.

I think I have understood the problem. I create the DAO using the "new" operator, in a method of the ejb.
At this point the DI has been already performed.

I must put



as a field of the ejb, not in my DAO.

Best regards,
Felix
Use www.jaaava.com - A Google CSE for Java
 
Felix Sima
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi.

I still have the error. The solution described in the last post, did not solve my problem

Best regards,
Felix
 
Felix Sima
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hello.

Now it finally works

From my tests it seems that the <injection-target> could not be found ... error is launched when



annotation is used outside of a managed component.

I also had an error in my persistence.xml. I used "jdbc/someDS" instead of "java:/someDS". I'm using JBoss 5.0.0.GA application server.
Thank you.

Best regards,
Felix
Use www.jaaava.com - A Google CSE for Java
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please do not post the same question to multiple forums: CarefullyChooseOneForum

Let's continue the discussion in this duplicate thread.
 
    Bookmark Topic Watch Topic
  • New Topic