This content has been marked as final.
Show 2 replies
-
1. Re: @PersistenceContext annotation in an abstract superclass
bill.burke Jul 26, 2006 11:05 PM (in response to bruce3)It is valid.
-
2. Re: @PersistenceContext annotation in an abstract superclass
ejb3workshop Aug 13, 2013 3:46 AM (in response to bruce3)I know this thread goes back quite a while. Yet I am facing the same issue. I have declared and inject a PersistenceContact in an abstract superclass, which is extended by serveral concrete MDBs and SLSBs. However when I deploy this I get the following error :
ObjectName: jboss.j2ee:ear=ABCEJB.ear,jar=ABCEJB.jar,name=BatchJobListener,service=EJB3
State: FAILED
Reason: java.lang.RuntimeException: An exception occurred initialising interceptors for class com.abc.backend.
jobs.BatchJobListener.init
I Depend On:
persistence.units:ear=ABCEJB.ear,jar=ABCEJB.jar,unitName=entityManager
ObjectName: jboss.j2ee:ear=ABCEJB.ear,jar=ABCEJB.jar,name=BinListener,service=EJB3
State: FAILED
Reason: java.lang.RuntimeException: An exception occurred initialising interceptors for class com.thunderhead.backend.
jobs.BinListener.init
I Depend On:
persistence.units:ear=ABCEJB.ear,jar=ABCEJB.jar,unitName=entityManagerany ideas if this is supposed to work. I am aware of the work around to declare an abstract getter in the superclass, and then inject in the concrete subclasses and access the injected context via the getter. It would be nice to to be able to inherit the injected Persistence Context though, which as Bill suggests, seems to be possible.