Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Please do not post the same question to multiple forums: CarefullyChooseOneForum

Let's continue the discussion in this duplicate thread.
 
Those who dance are thought mad by those who hear not the music. This tiny ad plays the bagpipes:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
    Bookmark Topic Watch Topic
  • New Topic