[omniORB] Value box factory question

Jason Stelzer jstelzer at healthmarketscience.com
Fri Jul 27 11:41:33 BST 2007


Hello, I have a minor problem with a custom box type in omniORB 4.1.

I've an application that is written in java returning a simple pojo  
with some attributes set. Its serializable and is returning fine. The  
IDL generates correct looking C++ stubs.

The problem is this. The C++ client throws an exception when it tries  
to unmarshall the return value. I believe this is because I need to  
register the value factory with the orb. I'd imagine this would go  
something like

CORBA::ValueFactoryBase_var vf = new PojoFactory();
CORBA::String_var repIdV = ...->id();
orb->register_value_factory(repIdV.in(), vf.in());


However, I'm somewhat confused by the generated code and the user  
docs. Section 13.4 of the user guide says this:

With normal valuetypes, omniidl generates factory classes (with names  
ending
_init) as required by the C++ mapping specification. The application  
is respon-
sible for registering the factories with the ORB.
Unfortunately, the C++ mapping makes no mention of factories for  
value boxes.
In omniORB, factories for value boxes are automatically registered  
with the ORB,
and there are no application-visible factory classes generated for  
them. Some other
CORBA implementations generate application visible factories, and the  
applica-
tion does have to register the factories with the ORB.

So, to me, that says I should not need to explicitly register the VF  
but when I trace things it appears otherwise:
omniORB: LocateRequest to remote:  
key<8960097511.Servant..lms..LmsCorbaBean..remote.....p>
omniORB: Invoke 'getLmsData' on remote:  
key<8960097511.Servant..lms..LmsCorbaBean..remote.....p>
omniORB: No value factory for  
'RMI:com.hmsonline.lms.common.AddressResults: 
43D80F328F139FE0:00000000013240E2'.
omniORB: throw MARSHAL from valueType.cc:547  
(YES,MARSHAL_NoValueFactory)

There does appear to be an AddressResults_init class defined, but I  
can't instantiate it.

Lms.cpp:100: error: cannot allocate an object of type  
`com::hmsonline::lms::common::AddressResults_init'
Lms.cpp:100: error:   because the following virtual functions are  
abstract:
/usr/include/omniORB4/CORBA_ValueBase.h:210: error:  virtual  
CORBA::ValueBase* CORBA::ValueFactoryBase::create_for_unmarshal()
./AddressResults.hh:233: error:  virtual  
com::hmsonline::lms::common::AddressResults*  
com::hmsonline::lms::common::AddressResults_init::create()


So, would it appear that the IDL is incorrect or do I simply need a  
tip as to how value factories are to be registered in omniorb?

Any advice is greatly appreciated.
--
J.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20070727/3ec0da48/attachment.htm


More information about the omniORB-list mailing list