Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » CDI Entity Listeners - EclipseLink(Entity Listeners and CDI)
CDI Entity Listeners - EclipseLink [message #1700575] Fri, 03 July 2015 22:53 Go to next message
srijava srijavakanth is currently offline srijava srijavakanthFriend
Messages: 4
Registered: December 2014
Junior Member
I am trying to do something like

https://wiki.eclipse.org/EclipseLink/Release/2.5/JPA21#CDI_Entity_Listeners

but non of my injections are working.

Does Entity Listener doesn't inject CDI dependencies ?

Do we have to do something different.

public class EntityListener {

    @Inject
  private UserUtility userUtility;

   @PrePersist
   public void prePersist(Object object) {
       logger.log("prepersist", object);
   }

   @PostPersist
   public void postPersist(Object object){
      object.createUser(userUtility.getLoggedInUser())
   }
 }

But my userUtility is always null, I am using userUtility in different places in my project and It is properly injected. Just not in here.

Running this code in Glassfish 4.1 server. Eclipselink version on Glassfish is 2.5.2

Any clues, Please help me.

[Updated on: Fri, 03 July 2015 22:54]

Report message to a moderator

Re: CDI Entity Listeners - EclipseLink [message #1700577 is a reply to message #1700575] Fri, 03 July 2015 23:19 Go to previous messageGo to next message
srijava srijavakanth is currently offline srijava srijavakanthFriend
Messages: 4
Registered: December 2014
Junior Member
Is this really a bug as mentioned in https://github.com/payara/Payara/issues/209

Should be upgrade EclipseLink 2.6 with Glassfish 4.1 server?

Any good resources for upgrading.
Re: CDI Entity Listeners - EclipseLink [message #1700718 is a reply to message #1700575] Mon, 06 July 2015 15:54 Go to previous message
srijava srijavakanth is currently offline srijava srijavakanthFriend
Messages: 4
Registered: December 2014
Junior Member
Any workaround for this issue.

@preupdate and @prepersist are very important for application.

Can you give any workaround for this issue.

Please let me know, if you found different implementation.
Previous Topic:Eclipselink Multitenancy problem
Next Topic:eclipselink issue on weblogic 10.3
Goto Forum:
  


Current Time: Sat Mar 06 18:12:34 GMT 2021

Powered by FUDForum. Page generated in 0.02167 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top