[jacorb-developer] jacorb/omniorb marshalling

Phil Mesnier mesnier_p at ociweb.com
Wed Apr 25 19:52:11 CEST 2012


Hi,

On Apr 25, 2012, at 12:42 PM, Noé Casas Manzanares wrote:

> I am trying to encode some CORBA structure into a byte array in Java with JacORB and decode it from C++ using omniORB. I have not succeeded.
> 
> On the Java side I have tried using the "helper" class (generated in the compilation of the IDL) to serialize my CORBA structure to a CDRoutputStream and also by means of CodecFactory (http://article.gmane.org/gmane.comp.corba.jacorb.devel/5193/). Both ways work properly if I deserialize the resulting bytes with JacORB, but in both cases I get a segmentation fault when trying to unmarshall from omniORB using cdrEncapsulationStream.
> 
> Do these approaches (the ones that I have used to serialize with JacORB) generate data that is readable from other ORBs? or am I doing something wrong?
> 

It sounds like you are properly encapsulating the struct into a byte array that you are presumably converting to an octet sequence for transport. I am unfortunately not familiar with omniORB to say anything about it, but you may want to try obtaining TAO, another C++ ORB so you can try a proof of concept using a different implementation. If TAO also crashes, then there may be an issue with JacORB, but if TAO works OK, then it sounds like omniORB may have trouble.

Also, it might be good to double check that C++ and Java sides are both using consistent generated code to represent the struct. If you made any changes on one side without regenerating the other could be a problem. You may have to be sure to clean everything out and rebuild as well, your build system may not have recognized a change.

Have you tried encoding/decoding both in C++ to make sure there isn't a fundamental problem with your c++ code?

--
Phil Mesnier
Principal Software Engineer and Partner,   http://www.ociweb.com
Object Computing, Inc.                     +01.314.579.0066 x225






More information about the jacorb-developer mailing list