0 Replies Latest reply on Dec 29, 2007 3:51 PM by sagi mann

    pls help - calling EJB over IIOP

    sagi mann Newbie

      Hi,

      I'm new to Jboss. I've been working with SJSAS up until now, and I'm pulling my hair out on this one:

      I'm trying to simply configure my jboss-web.xml so that my servlet could call an EJB 3.0 stateless session bean. Both web app and ejb are running on JBoss 4.2.2GA ('all' configuration) with JDK 1.5, but not on the same host. For testing, however, I run them both on the same host (localhost).

      My EJB 3.0 is a simple session bean called ejbtest.HelloBean with a remote interface ejbtest.HelloRemote. I've verified that, by default, it is registered in JNDI under:
      (SJSAS): ejbtest.HelloRemote
      (Jboss): ejbtest/HelloBean/remote

      In SJSAS, in order to call the EJB from my web app, I would configure my web app's sun-web.xml like this:

      <ejb-ref>
       <ejb-ref-name>hello</ejb-ref-name>
       <jndi-name>corbaname:iiop:localhost:3700#ejbtest.HelloBean</jndi-name>
      </ejb-ref>
      


      I combed the internet for the JBoss equivalent, and I'm still unable to create a valid jboss-web.xml file!!!
      I already tried the following:

      1. Override the default invoker proxy in my EJB's jboss.xml file, i.e.:
       <invoker-bindings>
       <invoker>
       <invoker-proxy-binding-name>iiop</invoker-proxy-binding-name>
       <jndi-name>ejbtest/HelloBean/remote</jndi-name>
       </invoker>
       </invoker-bindings>
      


      2. use various jndi-name tags in jboss-web.xml, and get various errors:

      corbaname:iiop:localhost:3528#ejbtest/HelloBean/remote
      iiop://localhost:3528/ejbtest/HelloBean/remote
      client error is: NPE
      server error is:
      javax.naming.NamingException: Could not dereference object [Root exception is javax.naming.NameNotFoundException [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]]

      corbaloc::localhost:3528/JBoss/Naming/root/ejbtest/HelloBean/remote
      corbaloc:iiop:localhost:3528/JBoss/Naming/root/ejbtest/HelloBean/remote
      client error is: NPE
      server error is:
      javax.naming.NamingException: Could not dereference object [Root exception is javax.naming.NameNotFoundException: corbaloc:iiop:localhost:3528 not bound]

      corbaname:iiop:localhost:3528/JBossCorbaNaming#ejbtest/HelloBean/remote
      corbaname:iiop:localhost:3528/JBossCorbaNaming/root#ejbtest/HelloBean/remote
      jnp://localhost:1099/ejbtest/HelloBean/remote
      client error is: NPE
      server error is:
      javax.naming.NamingException: Could not dereference object [Root exception is org.omg.CORBA.OBJECT_NOT_EXIST: Server-side Exception: null vmcid: 0x0 minor code: 0 completed: No]

      jnp://localhost:1099/iiop/ejbtest/HelloBean/remote
      client error is: NPE
      server error is:
      javax.naming.NamingException: Could not dereference object [Root exception is javax.naming.NameNotFoundException: iiop not bound]

      jnp://localhost:1099/ejbtest/HelloBean
      client error is: NPE
      server error is:
      java.lang.ClassCastException: org.jnp.interfaces.NamingContext

      No dice.
      I am NOT looking for a solution that involves writing JBoss-specific code in my web app, cuz it won't be portable.

      Any ideas??? It should not be that complex AFAIK.
      thanks in advance...