3 Replies Latest reply on Sep 16, 2013 10:53 PM by hisanobu.okuda

    Custom JNDI name to lookup remote clustered EJB in EAP6

    hisanobu.okuda

      I have a customer who wants to invoke remote clustered ejb and lookup the ejb using a custom JNDI name like "hoge/Hello" instead of a default name like "ejb:/samplebz//SecureHelloBean!sample.Hello?stateful".

       

      I tried <bindings/> setting in naming subsystem, but it does not work for me. Please find the attached samplebz.tar.gz and deploy it as follow:-

       

          <subsystem xmlns="urn:jboss:domain:naming:1.3">
              <bindings>
                  <lookup name="java:jboss/exported/hoge/Hello" lookup="ejb:/samplebz//SecureHelloBean!sample.Hello?stateful"/>
              </bindings>

       

      The attached example can be deployed as follow:-

       

      1. extract it

      2. copy standalone-ha.xml to $JBOSS_HOME/standalone/configuration

      3. deploy samplebz.jar

      4. run eap610

        $ $JBOSS_HOME/bin/standalone.sh -c standalone-ha.xml -Djboss.node.name=node1

      5. add jboss-client.jar and samplebz.jar to CLASSPATH and run the client

        $ java sample.Client610

       

      Then, you would get an error like:-

       

      Exception in thread "main" javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial