Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problems Injecting EJB from Jar to Servlet in War JBoss 7  RSS feed

Lukas Kavofil
Posts: 7
Eclipse IDE Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi. I have a problem I just cant specify for JBoss to inject the Stateless bean found in deployed jar on the server ( ejbexample.FooRemote) to the servlet which is to be deployed in different war file.

I use norma annotation @EJB and even tried @EJB(mappedName="ejbexample.FooRemote") with no result. Still I have either problems deploying the app or running the servlert with this dependency injection.

This works if I have the whole ejbexample package in the WEB-INF/classes of the war file.

I use a remote client written in POJO to access the bean via JNDI lookup and therefore I know that the app si deployed and running correctly.

Of course I have ejbexample package also in war file in order to have FooRemote interface, but I dont have FooBean there.

How shold I tell the container to find the correct EJB to inject ?

EDIT: To provide you with more accurate information here are annotations for FooRemote and FooBean:

public interface FooRemote {...

public class FooBean implements FooRemote {.....


With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!