• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problems Injecting EJB from Jar to Servlet in War JBoss 7

 
Lukas Kavofil
Greenhorn
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:


@Remote
public interface FooRemote {...

@Stateless
public class FooBean implements FooRemote {.....

.

Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic