Discussion:
[jacorb-developer] RMI and JacORB
Edward Scott
2002-07-10 22:38:02 UTC
Permalink
I am attempting to get a simple example of RMI PortableRemoteObject
implementation accessed as a CORBA object working. I seem to have
generated a suitable stub using the JDK 1.4 rmic.

However, looking at the Java to IDL spec, it appears that I need
implementations of StubDelegate, UtilDelegate and
PortableRemoteObjectDelegate (all from the javax.rmi.CORBA package) that
match JacORB 1.4 since the default Sun implementation fails with a
BAD_PARAM in the PortableRemoteObject.toStub method.

Can anyone tell me if I am correctly interpreting the current situation?
If so has anyone implemented these already either specifically for
JacORB (or generically for a CORBA 2.4+ ORB)?

I am aware that JBoss have implemented the reverse direction e.g. RMI
client to CORBA server.

Regards,

Edward Scott
Michael Rumpf
2002-07-11 18:58:01 UTC
Permalink
Hi,
Post by Edward Scott
I am attempting to get a simple example of RMI PortableRemoteObject
implementation accessed as a CORBA object working. I seem to have
generated a suitable stub using the JDK 1.4 rmic.
However, looking at the Java to IDL spec, it appears that I need
implementations of StubDelegate, UtilDelegate and
PortableRemoteObjectDelegate (all from the javax.rmi.CORBA package) that
match JacORB 1.4 since the default Sun implementation fails with a
BAD_PARAM in the PortableRemoteObject.toStub method.
You need special implementations of those objects to which the call of the
delegate classes will be forwarded. These implementations need to use the
JacORB ORB infrastructure internally to process the incoming calls via the
javax.rmi.* and javax.rmi.CORBA.* interfaces (and via the generated stubs
and ties).
The implementation classes use a similar mechanism as the ORB, i.e. it uses
properties to tell the Sun classes which implementation to instantiate:

javax.rmi.CORBA.PortableRemoteObjectClass=<Your PortableRemoteObject Impl>
javax.rmi.CORBA.StubClass=<Your Stub Impl>
javax.rmi.CORBA.UtilClass=<Your Util Impl>

If you do not set these properties the Sun implementations will always be
used and you will get strange exceptions like the BAD_PARAM exception
because internally the Sun ORB will be used instead of JacORB...
Post by Edward Scott
Can anyone tell me if I am correctly interpreting the current situation?
If so has anyone implemented these already either specifically for
JacORB (or generically for a CORBA 2.4+ ORB)?
You can try OpenORB which has a RMIoverIIOP package that is deployed in many
production environments and has proven to be quite stable
(http://openorb.sf.net)
Post by Edward Scott
I am aware that JBoss have implemented the reverse direction e.g. RMI
client to CORBA server.
Hope this helps,

Michael
Francisco Reverbel
2002-07-12 23:45:02 UTC
Permalink
Post by Edward Scott
I am attempting to get a simple example of RMI PortableRemoteObject
implementation accessed as a CORBA object working. I seem to have
generated a suitable stub using the JDK 1.4 rmic.
Not sure I understood what you want to do. It seems that you want to
have CORBA clients accessing a plain RMI/IIOP server... Is this correct?

In this case you would use JacORB only at the client side. Your CORBA
clients could be implemented with JacORB in the usual way. They should
not use rmic-generated stubs, but plain IDL stubs.

Have you tried generating IDL definitions for the RMI interfaces
implemented by your RMI/IIOP server ('rmic -idl -noValueMethods'),
then generating IDL stubs as usual?

Disclaimer: I believe this should work, but never did it myself. Only
did the opposite thing (RMI/IIOP clients acessing a CORBA server
implemented with JacORB).
Post by Edward Scott
However, looking at the Java to IDL spec, it appears that I need
implementations of StubDelegate, UtilDelegate and
PortableRemoteObjectDelegate (all from the javax.rmi.CORBA package) that
match JacORB 1.4 since the default Sun implementation fails with a
BAD_PARAM in the PortableRemoteObject.toStub method.
This is necessary only if you need/want JacORB to be used at the
server side. An RMI/IIOP server should be accessible to CORBA clients
implemented with JacORB even if the server does not use JacORB at all.

Regards,

Francisco
Post by Edward Scott
Can anyone tell me if I am correctly interpreting the current situation?
If so has anyone implemented these already either specifically for
JacORB (or generically for a CORBA 2.4+ ORB)?
I am aware that JBoss have implemented the reverse direction e.g. RMI
client to CORBA server.
Regards,
Edward Scott
_______________________________________________
http://lists.spline.inf.fu-berlin.de/mailman/listinfo/jacorb-developer
Edward Scott
2002-07-13 00:17:01 UTC
Permalink
Post by Francisco Reverbel
Post by Edward Scott
I am attempting to get a simple example of RMI PortableRemoteObject
implementation accessed as a CORBA object working. I seem to have
generated a suitable stub using the JDK 1.4 rmic.
Not sure I understood what you want to do. It seems that you want to
have CORBA clients accessing a plain RMI/IIOP server... Is this correct?
In this case you would use JacORB only at the client side. Your CORBA
clients could be implemented with JacORB in the usual way. They should
not use rmic-generated stubs, but plain IDL stubs.
While in general you may be correct, unfortunately the situation
requires JacORB and the RMI server to be co-located. The correct
solution in this case appears to be implementing the Delegate classes.
Michael's suggestion of the OpenORB RMIoverIIOP package seems a good
starting point.

Regards,

Edward
Post by Francisco Reverbel
Have you tried generating IDL definitions for the RMI interfaces
implemented by your RMI/IIOP server ('rmic -idl -noValueMethods'),
then generating IDL stubs as usual?
Disclaimer: I believe this should work, but never did it myself. Only
did the opposite thing (RMI/IIOP clients acessing a CORBA server
implemented with JacORB).
Post by Edward Scott
However, looking at the Java to IDL spec, it appears that I need
implementations of StubDelegate, UtilDelegate and
PortableRemoteObjectDelegate (all from the javax.rmi.CORBA package) that
match JacORB 1.4 since the default Sun implementation fails with a
BAD_PARAM in the PortableRemoteObject.toStub method.
This is necessary only if you need/want JacORB to be used at the
server side. An RMI/IIOP server should be accessible to CORBA clients
implemented with JacORB even if the server does not use JacORB at all.
Regards,
Francisco
Post by Edward Scott
Can anyone tell me if I am correctly interpreting the current situation?
If so has anyone implemented these already either specifically for
JacORB (or generically for a CORBA 2.4+ ORB)?
I am aware that JBoss have implemented the reverse direction e.g. RMI
client to CORBA server.
Regards,
Edward Scott
_______________________________________________
http://lists.spline.inf.fu-berlin.de/mailman/listinfo/jacorb-developer
Loading...