0 Replies Latest reply on Apr 10, 2013 10:11 AM by Gary Dux

    Jboss7 IIOP-Client

    Gary Dux Newbie


      Hello together,

      investigating "getting started" for Jboss7 i have an example for an IIOP-Configuration: jboss-as-quickstart-master\jts\application-component-2(https://github.com/jboss-jdf/jboss-as-quickstart)

      there i found an jboss-ejb3.xml with configuration:
      <?xml version="1.0" encoding="UTF-8"?>
      <jboss:ejb-jar xmlns:jboss="http://www.jboss.com/xml/ns/javaee"
                      xmlns="http://java.sun.com/xml/ns/javaee"
                      xmlns:iiop="urn:iiop"
                      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                      xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss-ejb3-2_0.xsd
                         http://java.sun.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss-ejb3-spec-2_0.xsd
                         urn:iiop jboss-ejb-iiop_1_0.xsd"
                      version="3.1"
                      impl-version="2.0">
           <assembly-descriptor>
               <iiop:iiop>
                   <ejb-name>CounterBean</ejb-name>
                   <iiop:binding-name>org/jboss/as/quickstarts/ejb/remote/stateful/CounterBean</iiop:binding-name>
               </iiop:iiop>
           </assembly-descriptor>
      </jboss:ejb-jar>

      And the Code calling this EJB from a Container would be like this:
        @EJB(lookup = "corbaname:iiop:localhost:3628#org/jboss/as/quickstarts/ejb/remote/stateful/CounterBean")
        RemoteCounter counterBean;

      My Question is, how would be the jndi.properies or else for the Client like this?

      public static RemoteCounter lookupRemoteStatefulCounter() throws NamingException {
      final Hashtable jndiProperties = new Hashtable();
      jndiProperties.put(Context.URL_PKG_PREFIXES,"org.jboss.ejb.client.naming");

      //jndiProperties.put(Context.INITIAL_CONTEXT_FACTORY,"org.jboss.naming.remote.client.InitialContextFactory");
      // jndiProperties.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.cosnaming.CNCtxFactory");
      //jndiProperties.put(Context.PROVIDER_URL,"corbaloc::localhost:3528/JBoss/Naming/root");
      // jndiProperties.put(Context.OBJECT_FACTORIES,"org.jboss.tm.iiop.client.IIOPClientUserTransactionObjectFactory");

      final Context context = new InitialContext(jndiProperties);
               String iiopJNDI = "corbaname:iiop:localhost:3528#org/jboss/as/quickstarts/ejb/remote/stateful/CounterBean";

      return (RemoteCounter) context.lookup(iiopJNDI);
      }

      My many attempts do not led to any success.

      I know there is another way to "lookup" an ejb on Jboss7 but i need it on this way. Please do not come with answer from the same sample-collection(f.e. ejb-remote).