0 Replies Latest reply on Feb 13, 2003 2:27 AM by persabi

    EJB access from c++ CORBA client

    persabi

      Hi, can anyone please lend any advise on this subject.
      A brief summary follows.

      My environment consists of:

      Linux RH 7.3
      g++ 2.96
      jboss-3.0.4 with integrated tomcat-4.1.12
      Sun JDK 1.4.1_01
      IONA ORBacus ORB OB-4.1.2
      jakarta-ant-1.5
      xdoclet-1.2.0-beta2
      uml2ejb_130
      Poseidon 1.5

      The steps I have taken to get where I am are:

      Create the UML class diagrams using Poseidon.
      Run through UML2EJB to generate the 'Bean' file.
      Modify using Eclipse.
      Use xdoclet to generate EJB interfaces.
      Use ANT to compile EJB components, generate EAR file & deploy to JBoss server.
      Test my simple Stateless EJB via servlet.
      JBoss server has IIOP Jacorb CorbaORBService deployed.
      RMIC my remote interface and home interface to generate IDL files.
      Run IDL-to-C++ compiler from ORBacus to generate the .cpp and .h files.
      Write a very simple C++ CORBA client that locates the remote naming context, resolves the EJB h
      ome, create the bean instance and call a method.
      Compile this client using g++.

      Run the client with the following NameService URL:

      -ORBInitRef NameService=corbaloc::localhost:3528/JBoss/Naming/root

      However, at this stage, I can only get the naming context, which indicates I can connect to the
      Naming Service in JBoss. I presume my COSNaming Name for the EJB is wrong, but I have tried m
      any combinations.

      I get the following error:

      runclient:
      [exec] Resolving naming service: NameService=corbaloc::localhost:3528/JBoss/Naming/root
      [exec] ...
      [exec] Resolved naming service
      [exec] Naming service resolved successfully !
      [exec] Got here...
      [exec] We got an exception: User exception `CosNaming::NamingContext::NotFound'
      [exec] Result: -1 or 129

      From jmx-console, the MBean view indicates the following:

      MBean Name:
      Domain Name: jboss.j2ee
      service: EJB
      jndiName: src.ejb.interop/LoggerService/Home

      The C++ client segment:

      cout << "Naming service resolved successfully !" << endl;
      CosNaming::Name aName;
      aName.length(1);
      aName[0].id = CORBA::string_dup("src.ejb.interop/LoggerService/Home");
      cout << "Got here..." << endl;
      CORBA::Object_var aObj = nc -> resolve(aName);
      cout << "Resolved LoggerService Home interface" << endl;

      If you require more details, pls let me know and I will try to provide. I would really appreci
      ate any help and have been stuck on this for a few days now.

      Regards
      Vance