Regards, Mohammad
my.blog | my.photoblog | Add your name to SCJP Wall Of Fame
Regards, Mohammad
my.blog | my.photoblog | Add your name to SCJP Wall Of Fame
Regards, Mohammad
my.blog | my.photoblog | Add your name to SCJP Wall Of Fame
Originally posted by Jaikiran Pai:
Since it's Quartz task (which runs asynchronously in its own thread context), i don't think you can do the injection in that class. Try the injection in a servlet and see if it works. If it works, then it will narrow down the possible reasons why it does not work in the quartz task.
Regards, Mohammad
my.blog | my.photoblog | Add your name to SCJP Wall Of Fame
Originally posted by Raf Szczypiorski:
https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html#SessionBeanGlobalJNDINameAssignment
The first sentences state that only remote interfaces get a global JNDI name that you can look up. A global JNDI name corresponds to the mappedName elements of @EJB / @Resource, and you can only inject local interfaces using the name attribute, and only within the same EAR.
To make this work, you need to use ejb-ref or @EJB on the class level of whatever managed resource is using the class you have the lookup code in. This link:
https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html#POJOLocalEJB
has all the necessary steps you need to follow for this to work.
Hope this helps.
Regards, Mohammad
my.blog | my.photoblog | Add your name to SCJP Wall Of Fame
Regards, Mohammad
my.blog | my.photoblog | Add your name to SCJP Wall Of Fame
Originally posted by Raf Szczypiorski:
It's not managed itself, but it is invoked within a context of a managed resource. Something invokes the code in your POJO, doesn't it? It is either an EJB, a servlet, or other managed resource. If it is a Quartz task, doesn't something start up the Quartz service? It is a bean, a ServletContextListener.contextInitialized, whatever. Have you actually tried putting a ejb-local-ref / annotation on the managed resource that is using your POJO, or you just say it won't work?
Regards, Mohammad
my.blog | my.photoblog | Add your name to SCJP Wall Of Fame
Regards, Mohammad
my.blog | my.photoblog | Add your name to SCJP Wall Of Fame
The harder I work, the luckier I get. -Sam Goldwyn So tiny. - this ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|