Skip to Content
author's profile photo Former Member
Former Member

com.sap.engine.lib.injection.InjectionException

Hello,

I have a generic crud component (an EJB called CrudServiceBean) which has an EntityManager such as attribute and in other project some entities (with JPA).

Project1:

- CrudServiceBean.java

- CrudServiceLocal.java

Project2:

- CeraEmployee.java

- Persistence.xml

Project3:

- App.java

When I try to use some method of CrudServiceBean in App.java I get an exception, u201Ccom.sap.engine.lib.injection.InjectionException: Injection on field entityManager of instance co.com.crystal.util.CrudServiceBean@4e40f180 failed. Could not get a value to be injected from the factoryu201D

But the persistence.xml file (with the persistence unit ) is in the entity project because the generic crud will be used in many entities projects, so how can I use my generic crud component out of the entity project?

Regards

Janeth

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Jun 02, 2008 at 09:30 AM

    Hi Janeth,

    As long as Project1 and Project2 are part of the same EAR, that should be fine.

    Please look into the defaultTrace.trc file for the cause exception that would explain the "Could not get a value to be injected from the factory" thing.

    HTH!

    \-- Vladimir

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.