Skip to main content



      Home
Home » Eclipse Projects » EclipseLink » CDI Entity Listeners - EclipseLink(Entity Listeners and CDI)
CDI Entity Listeners - EclipseLink [message #1700575] Fri, 03 July 2015 18:53 Go to next message
Eclipse UserFriend
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 18:54] by Moderator

Re: CDI Entity Listeners - EclipseLink [message #1700577 is a reply to message #1700575] Fri, 03 July 2015 19:19 Go to previous messageGo to next message
Eclipse UserFriend
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 11:54 Go to previous message
Eclipse UserFriend
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: Mon Jul 07 15:50:20 EDT 2025

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

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

Back to the top