How to use EJB 3.1 DI in Servlet? (Could not inject session bean by @EJB from web application)?

If you don't deploy your ejb-jar as a lib of your war (i.e. Under WEB-INF/lib), I don't think you'll be able to use the Local interface (and you'll have to package the remote interface in your webapp).

If you don't deploy your ejb-jar as a lib of your war (i.e. Under WEB-INF/lib), I don't think you'll be able to use the Local interface (and you'll have to package the remote interface in your webapp). PS: you don't really need the web.

Xml here.

Thanks. Yes, your right... -------------- glassfish.dev.java. Net/javaee5/ejb/… -- I have an EJB component with a Local interface.

Can I access it from a web component in a different application? No. The EJB specification only requires access to an EJB component's local EJB interface from within the same application in the same JVM.

One option is to package the ejb-jar in the same . Ear as the .war. A second option, if using GlassFish v3, is to package the EJB component directly within the .war.

-- What is about @Remote is it an option for me? – kislo_metal Mar 28 '10 at 22:43 Ok. So as Pascal said.

We need to package remote interface in webapp. We can use Local interface injection in different application. If you need use Local interface you need to include ejb jar in your application.

Current design - package remote interface to webapp – kislo_metal Mar 29 '10 at 0:23.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions