users@glassfish.java.net

Re: Problem with EJB Injection within an interceptor

From: Dipl. Ing Torsten Liermann <office_at_liermann.biz>
Date: Fri, 11 Nov 2011 12:41:25 +0100

The interceptor and the injected Ejb are packaged together in one ejb module. But the interceptor is bund on an Ejb that is packaged in a web module. Both modules are packaged in ear.

Thanks for your help.
Torsten
--
Torsten Liermann
Theodolindenplatz 2
81545 München
Marina Vatkina <marina.vatkina_at_oracle.com> schrieb:
How are those 2 classes packaged?
thanks,
-marina
Dipl.-Ing. Torsten Liermann wrote:
> Hi,
>
> implemented an interceptor with one EJB injection like
>
> @Interceptor
> public class CriticalServerModeInterceptor {
>
> 	@EJB
> SynchronizationStatusBean synchronizationStatusBean;
>
> 	......
> ......
> }
> }
>
> On enjecting the EJB the jndi lookup goes failed with an
> EJB not found exception:
>
> javax.naming.NameNotFoundException: No object bound to name java:comp/env/de.zeiss.lehel.interceptors.CriticalServerModeInterceptor/synchronizationStatusBean
>
> The "CDI" used the lookup URL
> java:comp/env/de.zeiss.lehel.interceptors.CriticalServerModeInterceptor/synchronizationStatusBean
>
> But the EJB is registered as java:global/FORUM/ArchiveServer/SynchronizationStatusBean
>
> The glassfish server.log shows for bean registration:
>
> [#|2011-11-10T12:41:30.820+0100|INFO|glassfish3.1.1|javax.enterprise.system.container.ejb.com.sun.ejb.containers|_ThreadID=17;_ThreadName=Thread-2;|Portable JNDI names for EJB SynchronizationStatusBean :
> [java:global/FORUM/ArchiveServer/SynchronizationStatusBean, java:global/XYZ/ArchiveServer/SynchronizationStatusBean!de.zeiss.lehel.service.archivemgr.SynchronizationStatusBean]|#]
>
> What is wrong in our setup?
>
> Thanks for a hint.
> Torsten
>
>
>
>
>
>
>