users@glassfish.java.net

EJB field injection failed in Stateless Session Bean WebServiceProvider

From: <glassfish_at_javadesktop.org>
Date: Sat, 05 Jul 2008 02:31:32 PDT

Hi,

I have a Stateless Session Bean which is a WebServiceProvider. It implements the invoke() from the Provider<Source> interface.
In this Bean I would like to invoke a Local Stateless Session Bean and use the annotation @EJB for the field injection.
By invoking the WebServiceProvider’s service the field injection does not occur and the invoked Local Session Bean is null. The @PostContruct annotated method is not called either.

However if the Bean is a WebService (annotated with @WebService) the field injection works.

My supposition is that in case of the WebServiceProvider the EJB container ONLY invokes the WebServiceProvider’s invoke(). Dependency injection and PostConstruction do not take place. Neither before invoke() nor after it. So the Bean might be not a Bean anymore?

Do you also experience this behaviour and might have a workaround?

Thanks in advance for your help

Best regards,

Binh
[Message sent by forum member 'binhthai' (binhthai)]

http://forums.java.net/jive/thread.jspa?messageID=284504