[jboss-user] [EJB 3.0] - Re: @PersistenceContext annotation in an abstract superclass

ejb3workshop do-not-reply at jboss.com
Tue Oct 14 07:28:27 EDT 2008


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 :


anonymous wrote : 
  | ObjectName: jboss.j2ee:ear=ThunderheadEJB.ear,jar=ThunderheadEJB.jar,name=BatchJobListener,service=EJB3
  | 
  |   State: FAILED
  | 
  |   Reason: java.lang.RuntimeException: An exception occurred initialising interceptors for class com.thunderhead.backend.
  | 
  | jobs.BatchJobListener.init
  | 
  |   I Depend On:
  | 
  |     persistence.units:ear=ThunderheadEJB.ear,jar=ThunderheadEJB.jar,unitName=entityManager
  | 
  |  
  | 
  | ObjectName: jboss.j2ee:ear=ThunderheadEJB.ear,jar=ThunderheadEJB.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=ThunderheadEJB.ear,jar=ThunderheadEJB.jar,unitName=entityManager
  | 

any 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.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4182082#4182082

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4182082



More information about the jboss-user mailing list