Forums Register Login

<injection-target> - error

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
Hi.

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

Best regards,
Felix
+Pie Number of slices to send: Send
Can you please post the modified source code of the bean class and the exact error message.
+Pie Number of slices to send: Send
You have not copied your persistent.xml and data-source.xml
+Pie Number of slices to send: Send
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
Why is the word "abbreviation" so long? And this ad is so short?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1010 times.
Similar Threads
Ejb deployment issue
Learn to deploy EJBs on JBOSS
Problem accessing a servlet in weblogic
java.lang.RuntimeException: <injection-target> - error
java.lang.RuntimeException: <injection-target> - error
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 07:26:13.