2 Replies Latest reply on Feb 16, 2018 9:09 PM by Anup Dey

    help.....jndi local lookup didnot work, remote is ok..

    明欣 陆 Newbie

      the remote ways  like  ejb: .....its ok

       

      but the local ways did not....

      i tested every path like below , still got a error .

      log info:

       

              java:global/ejbtest2/MessageHandlerBean!hello.MessageHandlerBeanLocal

              java:app/ejbtest2/MessageHandlerBean!hello.MessageHandlerBeanLocal

              java:module/MessageHandlerBean!hello.MessageHandlerBeanLocal

              java:global/ejbtest2/MessageHandlerBean!hello.MessageHandlerBeanRemote

              java:app/ejbtest2/MessageHandlerBean!hello.MessageHandlerBeanRemote

              java:module/MessageHandlerBean!hello.MessageHandlerBeanRemote

              java:jboss/exported/ejbtest2/MessageHandlerBean!hello.MessageHandlerBeanRemote

       

       

      error :

           javax.naming.NameNotFoundException: global/ejbtest2/MessageHandlerBean!hello.MessageHandlerBeanLocal -- service jboss.naming.context.java.jboss.exported.global.ejbtest2."MessageHandlerBean!hello.MessageHandlerBeanLocal"

       

      any help  please......thanks..

        • 2. Re: help.....jndi local lookup didnot work, remote is ok..
          Anup Dey Expert

          According to JEE6 standards for EJBs. Four JNDI namespaces are used for portable JNDI lookups:

          1). java:global,

          2). java:module,

          3). java:app,

          4). java:comp

           

          - The java:global JNDI namespace is the portable way of finding remote enterprise beans using JNDI lookups. JNDI addresses are of the following form:

           

          java:global

          java:global[/application name]/module name/enterprise bean name[/interface name]

           

          Application name and module name default to the name of the application and module minus the file extension. Application names are required only if the application is packaged within an EAR. The interface name is required only if the enterprise bean implements more than one business interface.

           

          java:module

           

          The java:module namespace is used to look up local enterprise beans within the same module. JNDI addresses using the java:module namespace are of the following form:

           

          java:module/enterprise bean name/[interface name]

           

          The interface name is required only if the enterprise bean implements more than one business interface.

           

          java:app

           

          The java:app namespace is used to look up local enterprise beans packaged within the same application. That is, the enterprise bean is packaged within an EAR file containing multiple Java EE modules. JNDI addresses using the java:app namespace are of the following form:

           

          java:app[/module name]/enterprise bean name[/interface name]

           

          The module name is optional. The interface name is required only if the enterprise bean implements more than one business interface

           

           

          java:comp

           

          http://jcp.org/en/jsr/detail?id=316 in this link document "3.1.8.2. Portable JNDI Naming Syntax" these namings are described.

          More information on this is mentioned within "javaee_platform-6_0-fr-spec.pdf" in section "EE.5 Resources, Naming, and Injection", subsection "EE.5.2.2 Application Component Environment Namespaces", on page 65.

           

          For more details you can refer to the link JNDI Reference in JBoss community.

          1 of 1 people found this helpful