1 Reply Latest reply on Jan 16, 2014 6:16 AM by Wolf-Dieter Fink

    Spring 3 integration with Jboss 7.1, javax.naming.NameNotFoundException

    Ivan Wang Newbie

      I'm recently migrating from Jboss 4 to Jboss 7.1. I've defined below ejb in spring


      <bean id="alertRSLB"
              <property name="jndiName" value="test/testEJB/Test!com.test.TestRemote" />
              <property name="refreshHomeOnConnectFailure" value="true"/>
              <property name="businessInterface" value="com.test.TestService" />
              <property name="jndiTemplate">
                  <ref bean="jndiJBoss"/>


      jndiTemplate is like below

      <bean id="jndiJBoss"
              <property name="environment">
                      <prop key="java.naming.factory.initial">
                      <prop key="java.naming.provider.url">
                      <prop key="jboss.naming.client.ejb.context">
                      <prop key="java.naming.factory.url.pkgs">
                      <prop key="java.naming.security.principal">test</prop>
        <prop key="java.naming.security.credentials">password</prop>


      I build a simple client application, I can look up the TestRemote using jndi name ejb:test/testEJB/Test!com.test.TestRemote successfully.


      However, I got the NameNotFoundException if the "alertRSLB" bean is initialized. I also tried to add the "ejb:"prefix, no luck.

      Not sure it's due to the ejb deployed and invoked in the same AS7 instance. The ejb is defined in a jar, and it's invoked in the war, they're in the same ear. For DEV environment, I have them in the same Jboss. But in PRO, they're in different Jbosses.

      If that's the reason, how to remote invoke the ejb from the same server.