0 Replies Latest reply on Sep 14, 2006 9:49 AM by tommaso faccilongo

    looking up from JBoss to a remote application over IIOP

    tommaso faccilongo Newbie

      I have some trouble on porting my applications from Sun One to Jboss .

      My EJB application plays as a client , another application running on a JVM outside of EJB container plays as a server.
      Classes implementing the server application compile with their remote interfaces, building stubs for remote calling over IIOP .
      These classes bind on JNDI.
      JNDI service runs outside the application server, using ?orbd? as supported by JDK.

      Using Sun One , I create initial context with Sun cosnaming properties on both server side (to bind classes) and client side (in EJB to look up remote classes). And it runs.

      Here are code samples

      Server:

      String urlOrbd = "iiop://servername:3800"
      Properties env = new Properties();
      env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtxFactory");
      env.put(Context.PROVIDER_URL, urlOrbd);
      Context initialNamingContext = new InitialContext(env);
      String bindServerClass = ("myService");
      Class myClass = Class.forName("MyServerClass");
      Object obj = myClass.newInstance();
      initialNamingContext.rebind(bindServerClass, obj);


      Client (EJB running in application server container):

      Context ic;
      Object objref;

      Properties env = new Properties();
      String serverUrl = "iiop://servername:3800"
      Properties env = new Properties();
      env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtxFactory");
      env.put(Context.PROVIDER_URL, serverUrl);

      MyServerClassRemInt remote;
      String service = " myService ";
      ic = new InitialContext(env);
      objref = ic.lookup(servizio);

      remote =( MyServerClassRemInt) PortableRemoteObject.narrow(objref, MyServerClassRemInt.class );
      remote.myMethod();



      Now I have to deploy my EJB application on JBoss 4.0.4 GA. Is there someone who can tell me how I have to bind my server classes and lookup for them from my EJB client ?

      I tried using ?com.sun.jndi.cosnaming.CNCtxFactory? initial context property for both binding and lookup and I get a ?NameNotFoundException? on looking up the initial context.

      I tried using ?com.sun.jndi.cosnaming.CNCtxFactory? initial context property for binding and ?org.jnp.interfaces.NamingContextFactory? initial context property for lookup and I get a ?InvalidClassException?, the class I look up for is invalid for deserialization.

      I tried using ?org.jnp.interfaces.NamingContextFactory? initial context property for both binding and lookup and I get a ?InvalidClassException?, the class I look up for is invalid for deserialization.

      I tried using ?org.jnp.interfaces.NamingContextFactory? initial context property for binding and ?com.sun.jndi.cosnaming.CNCtxFactory? initial context property for lookup and I get a ?NameNotFoundException? on looking up the initial context.

      I tried any option about syntax about defining name or looking up for them. It never runs.

      I?ll be glad for any suggestion or reference.
      Thanks