I had a similar problem using remote EJB, but this was not due to the version of the web application, but from the way my client was browsing the EJB.
Here is what worked for me:
//bean @Stateless(name="xxxxService") @Remote(xxxxRemote.class) public class xxxxService implements xxxxRemote { //interface - note that no annnotation is required public interface xxxxRemote { //in the client @EJB(mappedName="myJndiNameForxxxx") //for a local ejb, you could use 'beanName=' private xxxxRemote xxxx;
For my project (built using Maven), the client is in the webapp, and the EJB is in the EJB project, which is then wrapped in an EAR project. JNDI mapping happens in jboss.xml, which lives in an EJB project (in my project, src / main / resources / META-INF) and looks like this:
<?xml version="1.0" encoding="UTF-8"?> <jboss xmlns:xs="http://www.jboss.org/j2ee/schema" xs:schemaLocation="http://www.jboss.org/j2ee/schema/jboss_5_0.xsd" version="5.0"> <enterprise-beans> <session> <ejb-name>xxxxService</ejb-name> <jndi-name>myJndiNameForxxxx</jndi-name> </session> </enterprise-beans> </jboss>
That's all it takes, and now I can access the EJB from the client. Hope this helps someone.
If you still have problems, you can look in the JMX console to make sure that the JNDI entry is displayed. Look under "jboss"> "service = JNDIview"> "list" and click on the "invoke" button. If your service is deployed correctly, you should see the JNDI name (in my example, myJndiNameForxxxx) in the "ProxyFactory" section.
Mattc source share