Discussion:
[omniORB] omniorb, C++ and java question
Jason Stelzer
2007-06-28 20:12:28 UTC
Permalink
Hello,

Sorry that this is slightly off topic.

I am attempting to allow a legacy system talk to an ejb via a C++
library.

We're using Ejb3 and java 5 in jboss 4.0.5 on the server side of
things. I'm planning on using omniorb on the client side.

My problem and question is this. What is the optimal way to create
the IDL for making the calls? Most of the discussion of this topic is
pretty old. I believe that rmic (the idl generator in java) simply
doesn't know about annotations as the idl it generates is essentially
empty. Is there another IDL generator I should be using? Writing the
IDL by hand for the ejb, its parent classes and other objects it uses
seems excessive. I could always create a bean just to support the
client with only methods I strictly need exposed.

Thanks for any insights/advice.

--
J.
Hervin, Paul
2007-06-28 21:35:27 UTC
Permalink
Hi,

There is no problem in writing an IDL, then compiling it with idlj for the java part and compiling it with omniidl for the C++ part.

Regards
Paul

-----Message d'origine-----
De : omniorb-list-***@omniorb-support.com [mailto:omniorb-list-***@omniorb-support.com] De la part de Jason Stelzer
Envoy? : jeudi 28 juin 2007 16:13
? : omniorb-***@omniorb-support.com
Objet : [omniORB] omniorb, C++ and java question

Hello,

Sorry that this is slightly off topic.

I am attempting to allow a legacy system talk to an ejb via a C++ library.

We're using Ejb3 and java 5 in jboss 4.0.5 on the server side of things. I'm planning on using omniorb on the client side.

My problem and question is this. What is the optimal way to create the IDL for making the calls? Most of the discussion of this topic is pretty old. I believe that rmic (the idl generator in java) simply doesn't know about annotations as the idl it generates is essentially empty. Is there another IDL generator I should be using? Writing the IDL by hand for the ejb, its parent classes and other objects it uses seems excessive. I could always create a bean just to support the client with only methods I strictly need exposed.

Thanks for any insights/advice.

--
J.
Jason Stelzer
2007-06-28 21:48:04 UTC
Permalink
Post by Hervin, Paul
Hi,
There is no problem in writing an IDL, then compiling it with idlj
for the java part and compiling it with omniidl for the C++ part.
Regards
Paul
Yes, its looking more and more like I'm going to have to do that. I
was hoping that this approach would work.
http://java.sun.com/j2se/1.4.2/docs/guide/rmi-iiop/interop.html#31647

Once I realized that rmic has no idea about annotations and wrote an
old style ejb, the idl generated became much closer to what I need.
But, there are still a few hopefully minor issues.


java/lang/Exception.idl:17: In declaration of non-custom valuetype
'_Exception', inherited valuetype 'java::lang::Throwable' is custom
java/lang/Throwable.idl:16: (java::lang::Throwable declared here)
javax/ejb/EJBObject.idl:60: Warning: Identifier 'primaryKey' clashes
with CORBA 3 keyword 'primarykey'


I believe this is due to the fact that _Exception should not be
declared like this:
module java {
module lang
{




valuetype
_Exception: ::java::lang::Throwable
{

};
#pragma ID _Exception "RMI:java.lang.Exception:
77E8B62CD7E79AA2:D0FD1F3E1A3B1CC4"



};
};

However, I'm not well versed in corba so this is as much me feeling
my way through the problem and looking up references as anything else.

--
J.
Jason Stelzer
2007-06-28 22:25:56 UTC
Permalink
Post by Jason Stelzer
Post by Hervin, Paul
Hi,
There is no problem in writing an IDL, then compiling it with idlj
for the java part and compiling it with omniidl for the C++ part.
Regards
Paul
Yes, its looking more and more like I'm going to have to do that. I
was hoping that this approach would work.
http://java.sun.com/j2se/1.4.2/docs/guide/rmi-iiop/interop.html#31647
an old style ejb, the idl generated became much closer to what I
need. But, there are still a few hopefully minor issues.
Well, thanks to the mighty power of google and narrowing down the
right questions to ask, here's the 'answer' to my current problems.

Straight from sun:

"Modify the generated IDL files such as the EJBs, helper classes, and
third-party classes corresponding to the application.
The generated IDL files do not compile directly. You need to manually
modify the IDL files for generating a CPP file. The list below
explains the situations when you need to modify the IDL files:"


http://docs.sun.com/source/817-0462-10/dccpp.html

At least it wasn't me doing something wrong. The tools are just broken.

Thanks for the insights.

--
J.
evgeni.rojkov at durr.com ()
2007-06-29 13:28:05 UTC
Permalink
It looks for me you like to use RMI on Java-Side and try to create compatible
IDL for OMNIORB.
I do not have experience with RMI over IIOP, so I could not help you with it.
Here is the way I use:
Step 1: Write IDL
Step 2: Use omniidl to create C++ stubs
Step 3: Use idlj to create Java stubs
Step 4: Use onmiNames as naming service
Regards,
Evgeni



-----Urspr?ngliche Nachricht-----
Von: omniorb-list-***@omniorb-support.com
[mailto:omniorb-list-***@omniorb-support.com] Im Auftrag von Jason Stelzer
Gesendet: Donnerstag, 28. Juni 2007 18:26
An: Jason Stelzer
Cc: omniorb-***@omniorb-support.com
Betreff: Re: [omniORB] omniorb, C++ and java question
Post by Jason Stelzer
Post by Hervin, Paul
Hi,
There is no problem in writing an IDL, then compiling it with idlj
for the java part and compiling it with omniidl for the C++ part.
Regards
Paul
Yes, its looking more and more like I'm going to have to do that. I
was hoping that this approach would work.
http://java.sun.com/j2se/1.4.2/docs/guide/rmi-iiop/interop.html#31647
an old style ejb, the idl generated became much closer to what I
need. But, there are still a few hopefully minor issues.
Well, thanks to the mighty power of google and narrowing down the
right questions to ask, here's the 'answer' to my current problems.

Straight from sun:

"Modify the generated IDL files such as the EJBs, helper classes, and
third-party classes corresponding to the application.
The generated IDL files do not compile directly. You need to manually
modify the IDL files for generating a CPP file. The list below
explains the situations when you need to modify the IDL files:"


http://docs.sun.com/source/817-0462-10/dccpp.html

At least it wasn't me doing something wrong. The tools are just broken.

Thanks for the insights.

--
J.

Loading...