I have a no-interface ejb deployed in an ear (MyEar.ear)
@Stateless
@LocalBean
public class MyService{
// stuff
}
The ear is deployed to jboss-6.0.0.Final
I confirmed the JNDI name from the server jmx console:
MyEar/MyService/no-interface
I'm trying to reference this ejb from another ejb in a war (outside the ear) in the same server:
@EJB(mappedName = "MyEar/MyService/no-interface")
private MyService myService;
I'm referencing the ear project from the war project in eclipse, and compilation is successful.
I keep getting a ClassNotFoundException exception when deploying the war:
java.lang.ClassNotFoundException: eg.com.test.MyService
Why is the ejb in the war not seeing the ejb from the other ear?
Edit: I updated to the follwing
remote interface
@Remote
public interface MyServiceRemote{
// stuff
}
ejb
@Stateless
public class MyService implements MyServiceRemote{
// stuff
}
ejb reference in a different application
@EJB(mappedName = "MyEar/MyService/remote")
private MyServiceRemote myService;
I verified the new JNDI name on the server: MyEar/MyService/remote
But i'm still getting the same exception, this time the interface not found:
java.lang.ClassNotFoundException: eg.com.test.MyServiceRemote
Update: I needed to package the Remote Interface with the war, its working correctly now.