This week's book giveaway is in the Security forum.
We're giving away four copies of Penetration Testing Basics and have Ric Messier on-line!
See this thread for details.
Win a copy of Penetration Testing Basics this week in the Security forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problems Injecting EJB from Jar to Servlet in War JBoss 7

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 {.....


  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic