8 Replies Latest reply on Sep 5, 2014 3:59 AM by Wolf-Dieter Fink

    JNDI Naming Exception

    Venkat Jonnadula Newbie

      I'm getting the below exception when I tried to call EJBs(Version 2.1) in JBoss EAP 6.2. Here my client  and EJBs are the on the same JBoss Instance.

       

      Caused by: javax.naming.NameNotFoundException: jboss/exported/UpsServer/ups-server-ejb-1.0/AuthSession!com.hp.ucs.auth.ejb.session.Auth-- service jboss.naming.context.java.jboss.exported.jboss.exported.UpsServer."ups-server-ejb-1.0"."Auth!com.hp.ucs.auth.ejb.session.AuthHome"

      at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:103)

      at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:197)

      at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:174)

      at org.jboss.naming.remote.protocol.v1.Protocol$1.handleServerMessage(Protocol.java:127) [jboss-remote-naming-1.0.7.Final.jar:1.0.7.Final]

      at org.jboss.naming.remote.protocol.v1.RemoteNamingServerV1$MessageReciever$1.run(RemoteNamingServerV1.java:73) [jboss-remote-naming-1.0.7.Final.jar:1.0.7.Final]

      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_51]

      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_51]

      ... 1 more

       

      My Client Code is:

       

      <bean id="authService"  class="org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean" lazy-init="true">

      <property name="jndiTemplate">

      <ref local="jndiTemplate" />

      </property>

      <property name="jndiName">

      <value>java:global/UpsServer/ups-server-ejb-1.0/AuthSession!com.hp.ucs.auth.ejb.session.AuthLocal</value>

      </property>

      <property name="businessInterface">

      <value>com.hp.ups.common.web.auth.service.AuthService</value>

      </property>

      </bean>

       

      ejb-jar.xml:

      <session id="Session_Auth">

      <description><![CDATA[EJB for User Auth]]></description>

      <display-name>Auth</display-name>

      <ejb-name>Auth</ejb-name>

      <home>com.hp.ucs.auth.ejb.session.AuthHome</home>

      <remote>com.hp.ucs.auth.ejb.session.Auth</remote>

      <local-home>com.hp.ucs.auth.ejb.session.AuthLocalHome</local-home>

      <local>com.hp.ucs.auth.ejb.session.AuthLocal</local>

      <ejb-class>com.hp.ucs.auth.ejb.session.AuthSession</ejb-class>

      <session-type>Stateless</session-type>

      <transaction-type>Container</transaction-type>

      </session>

       

      In Server Log I can see the below JNDI bindings:

       

      10:23:17,328 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-1) JNDI bindings for session bean named Auth in deployment unit subdeployment "ups-server-ejb-1.0.jar" of deployment "UpsServer.ear" are as follows:

      java:global/UpsServer/ups-server-ejb-1.0/Auth!com.hp.ucs.auth.ejb.session.AuthLocal

      java:app/ups-server-ejb-1.0/Auth!com.hp.ucs.auth.ejb.session.AuthLocal

      java:module/Auth!com.hp.ucs.auth.ejb.session.AuthLocal

      java:global/UpsServer/ups-server-ejb-1.0/Auth!com.hp.ucs.auth.ejb.session.Auth

      java:app/ups-server-ejb-1.0/Auth!com.hp.ucs.auth.ejb.session.Auth

      java:module/Auth!com.hp.ucs.auth.ejb.session.Auth

      java:jboss/exported/UpsServer/ups-server-ejb-1.0/Auth!com.hp.ucs.auth.ejb.session.Auth

      java:global/UpsServer/ups-server-ejb-1.0/Auth!com.hp.ucs.auth.ejb.session.AuthLocalHome

      java:app/ups-server-ejb-1.0/Auth!com.hp.ucs.auth.ejb.session.AuthLocalHome

      java:module/Auth!com.hp.ucs.auth.ejb.session.AuthLocalHome

      java:global/UpsServer/ups-server-ejb-1.0/Auth!com.hp.ucs.auth.ejb.session.AuthHome

      java:app/ups-server-ejb-1.0/Auth!com.hp.ucs.auth.ejb.session.AuthHome

      java:module/Auth!com.hp.ucs.auth.ejb.session.AuthHome

      java:jboss/exported/UpsServer/ups-server-ejb-1.0/Auth!com.hp.ucs.auth.ejb.session.AuthHome

       

      Even my standalone-full.xml has the below entry:

      <subsystem xmlns="urn:jboss:domain:naming:1.4">

                  <remote-naming/>

        </subsystem>

       

      I tried all the possibilities of JNDI names, but no luck I ended up with same error.

      Can somebody help me?