0 Replies Latest reply on May 6, 2008 11:00 AM by Armin V

    EJB3 and CORBA clients

    Armin V Newbie

      Hello,

      could somebody explain me, how to connect a ejb3 bean deployed in jboss-5.0.0.Beta4 from a CORBA client (Java and/or C++) ?

      Here is the bean code:

      Bean Interface:

      package arv;
      
      import java.rmi.RemoteException;
      import javax.ejb.EJBObject;
      
      public interface HelloInterface extends EJBObject
      {
       void helloWorld() throws RemoteException;
      }
      


      Bean Implementation:

      import javax.ejb.Remote;
      import javax.ejb.Stateless;
      
      import org.jboss.ejb3.annotation.IIOP;
      import org.jboss.ejb3.annotation.RemoteBinding;
      import org.jboss.ejb3.annotation.defaults.RemoteBindingDefaults;
      
      import java.rmi.RemoteException;
      
      @Stateless
      @Remote(HelloInterface.class)
      @RemoteBinding(factory=RemoteBindingDefaults.PROXY_FACTORY_IMPLEMENTATION_IOR)
      @IIOP(interfaceRepositorySupported=false)
      public class HelloWorldBean {
      
       public HelloWorldBean() throws Exception {}
      
       public void helloWorld() throws RemoteException {
       System.out.println("Hello");
       }
      
      }
      
      


      I compiled both classes and packaged them in a jar-file HelloWorld.jar.
      I copied the jar file into jboss-5.0.0.Beta4/server/all/deploy and
      got following jboss output:

      
      13:44:02,426 INFO [MCKernelAbstraction] installing bean: jboss.j2ee:jar=HelloWorld.jar,name=HelloWorldBean,service=EJB3 with dependencies:
      13:44:02,457 INFO [MCKernelAbstraction] and demands:
      13:44:02,457 INFO [MCKernelAbstraction] jboss.ejb:service=EJBTimerService
      13:44:02,457 INFO [MCKernelAbstraction] and supplies:
      13:44:06,263 INFO [EJBContainer] STARTED EJB: arv.HelloWorldBean ejbName: HelloWorldBean
      
      


      JNDIView shows following entries:

      java:comp namespace of the component jboss.j2ee:jar=HelloWorld.jar,name=HelloWorldBean,service=EJB3 :
      
       +- UserTransaction (class: org.jboss.ejb3.tx.UserTransactionImpl)
       +- ORB[link -> java:/JBossCorbaORB] (class: javax.naming.LinkRef)
       +- EJBContext (class: javax.ejb.EJBContext)
       +- env (class: org.jnp.interfaces.NamingContext)
       +- TransactionSynchronizationRegistry[link -> java:TransactionSynchronizationRegistry] (class: javax.naming.LinkRef)
      
      


      Thank you very much !