Re: corba-to-ejb

Darren Middleman <[email protected]> Wed, 13 Apr 2005 10:24:07 -0230
Newsgroups gmane.comp.corba.orbacus
Organization IONA | Making Software Work Together TM
Message-ID <[email protected]>
Hi Anoop,

On Mon, Apr 11, 2005 at 07:06:09PM +0530, Anoop Ahamad wrote:
> 
> Dear OB-Users,
> 
> we are trying communication between corba client and ejb server using a sample, which I referred in http://www.javaworld.com/javaworld/jw-03-2002/jw-0329-corba-p2.html
> On the corba client side we are using orabacus and on the Ejb server side it is weblogic 8.1.
> 
> 1. we generated the idl using
> java weblogic.ejbc eai.jar eaiC.jar -idl -idlDirectory ./idl
> 
> 2. we simplified the generated idl as
> 
> #include "orb.idl"
> 
> module javax {
> module ejb {
>   custom valuetype CreateException : ::java::lang::_Exception {
> 
> #pragma ID CreateException "RMI:javax.ejb.CreateException:048A3675A6FD5463:575FB6C03D49AD6A"
> 
> };
> };
> };
> 
> module javax {
> module ejb {
> exception CreateEx {
>     CreateException value;
> };
> };
> };
> 
> module java {
> module rmi {
>   typedef Object Remote;
> 
> };
> };
> 
> module java {
> module io {
>   typedef any Serializable;
> 
> };
> };
> 
> module eai {
>   interface CorbaEai : ::javax::ejb::EJBObject {
>     readonly attribute ::java::util::Collection collection;
> 
>     attribute ::eai::MyType myType;
> 
>     readonly attribute ::java::util::Vector vector;
> 
>     ::java::lang::Integer sumObj( in ::java::lang::Integer arg0,  in ::java::lang::Integer arg1);
>     long sum( in long arg0,  in long arg1);
> 
> #pragma ID CorbaEai "RMI:eai.CorbaEai:0000000000000000"
> 
> 
> };
> };
> 
> module eai {
>   interface CorbaEaiHome : ::javax::ejb::EJBHome {
>     ::eai::CorbaEai create() raises (::javax::ejb::CreateEx);
> 
> #pragma ID CorbaEaiHome "RMI:eai.CorbaEaiHome:0000000000000000"
> 
> };
> };
> 
> module eai {
>   valuetype MyType {
>     public long a;
> 
>     public double b;
> 
> 
> #pragma ID MyType "RMI:eai.MyType:7B8145F0C5E7A58C:D2D18E8718275264"
> 
> };
> };
> 
> 3. Then we tried to compile idl interfaces using orabacus as 
> 
> c:\idl CorbaEai.idl
> 
> but it is giving error as
> 
> CorbaEai.idl:1: orb.idl: No such file or directory
> CorbaEai.idl(5): error: `::java::lang::Exception' undeclared
> CorbaEai.idl(40): error: `::javax::ejb::EJBObject' undeclared
> CorbaEai.idl(41): error: `::java::util::Collection' undeclared
> CorbaEai.idl(43): error: `::eai::MyType' undeclared
> CorbaEai.idl(45): error: `::java::util::Vector' undeclared
> CorbaEai.idl(47): error: `::java::lang::Integer' undeclared
> CorbaEai.idl(58): error: `::javax::ejb::EJBHome' undeclared
> 
> Please help us in this regard.
> 
> Anoop Ahamad

There are a couple of things to watch out for here when trying this demo
using the Orbacus IDL compiler.

  1. The "java weblogic.ejbc" generated IDL files all include the file
     "orb.idl".  If you want to use the Orbacus IDL compiler, these should
     be changed to #include <OB/orb.idl>.

  2. You are not providing any include paths to your IDL command in step 3.
     You should be using the -I option to provide paths to all of the
     include files that you will be needing.  At the very least, you should
     provide the include path to the Orbacus IDL files, located in the idl/
     folder of your installation.  For example:

       C:\idl -I<orbacus install path>\idl\ MyIdlFile.idl

     You will also likely need to provide the path to the additional IDL
     files genereated in step 1 of your description.  

  3. The undeclared errors that you are seeing are likely caused by you not
     including the appropriate declaration files in your main IDL file
     (CorbaEai.idl).  These additional IDL files should have been generated
     along with your main IDL file in step 1 of your desciption.  For
     example, the declaration for ::javax::ejb::EJBHome should be located
     in the file 'javax\ejb\EJBHome.idl' of the idl\ folder you specified
     to the "java weblogic.ejbc" command.  You will need to include this in 
     your combined CorbaEai.idl file using:
       
       #include "javax/ejb/EJBHome.idl"
      
     You should have similarly generated files for all the other types that
     you have undeclared.

There should be no problems using Orbacus to implement this demo.  I was
able to successfully generate, compile, and build this demo application
using the Orbacus IDL compiler.  Keep in mind, however, that this was done
using the instructions provided in the tutorial you sent the link for.  I
have been unable to test your IDL file because it appears you have added
some new features to the basic demo that I do not have access to.

Regards,
Darren

-- 
Darren Middleman, Software Engineer
Team Orbacus - Your CORBA Source
Email: mailto:[email protected]
WWW: http://www.orbacus.com/
_______________________________________________
OB-Users Mailing List - [email protected]
http://mail.ooc.nf.ca/mailman/listinfo/ob-users
Visit our support FAQ before you send a message.
http://www.orbacus.com/faq/support.html