<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
Hello, I have a minor problem with a custom box type in omniORB 4.1.<div><br class="webkit-block-placeholder"></div><div>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.</div><div><br class="webkit-block-placeholder"></div><div>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</div><div><br class="webkit-block-placeholder"></div><div>CORBA::ValueFactoryBase_var vf = new PojoFactory();</div><div>CORBA::String_var repIdV = ...-&gt;id();</div><div>orb-&gt;register_value_factory(repIdV.in(), vf.in());</div><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><div>However, I'm somewhat confused by the generated code and the user docs. Section 13.4 of the user guide says this:</div><div><br><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Palatino" size="3" style="font: 11.0px Palatino">With normal valuetypes, omniidl generates factory classes (with names ending</font><font face="Helvetica" size="3" style="font: 12.0px Helvetica"> </font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Courier" size="3" style="font: 11.0px Courier">_init</font><font face="Palatino" size="3" style="font: 11.0px Palatino">) as required by the C++ mapping specif</font><font face="Helvetica" size="3" style="font: 12.0px Helvetica">i</font><font face="Palatino" size="3" style="font: 11.0px Palatino">cation. The application is respon- </font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Palatino" size="3" style="font: 11.0px Palatino">sible for registering the factories with the ORB. </font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Palatino" size="3" style="font: 11.0px Palatino">Unfortunately, the C++ mapping makes no mention of factories for value boxes. </font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Palatino" size="3" style="font: 11.0px Palatino">In omniORB, factories for value boxes are automatically registered with the ORB, </font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Palatino" size="3" style="font: 11.0px Palatino">and there are no application-visible factory classes generated for them. Some other</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Palatino" size="3" style="font: 11.0px Palatino">CORBA implementations generate application visible factories, and the applica- </font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Palatino" size="3" style="font: 11.0px Palatino">tion</font><font face="Helvetica" size="3" style="font: 12.0px Helvetica"> </font><font face="Palatino" size="3" style="font: 11.0px Palatino"><i>does</i></font><font face="Helvetica" size="3" style="font: 12.0px Helvetica"> </font><font face="Palatino" size="3" style="font: 11.0px Palatino">have to register the factories with the ORB.</font><font face="Helvetica" size="3" style="font: 12.0px Helvetica"> </font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><br class="webkit-block-placeholder"></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">So, to me, that says I should not need to explicitly register the VF but when I trace things it appears otherwise:</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><div>omniORB: LocateRequest to remote: key&lt;8960097511.Servant..lms..LmsCorbaBean..remote.....p&gt;</div><div>omniORB: Invoke 'getLmsData' on remote: key&lt;8960097511.Servant..lms..LmsCorbaBean..remote.....p&gt;</div><div>omniORB: No value factory for 'RMI:com.hmsonline.lms.common.AddressResults:43D80F328F139FE0:00000000013240E2'.</div><div>omniORB: throw MARSHAL from valueType.cc:547 (YES,MARSHAL_NoValueFactory)</div><div><br class="webkit-block-placeholder"></div><div>There does appear to be an AddressResults_init class defined, but I can't instantiate it.</div><div><br class="webkit-block-placeholder"></div><div><div>Lms.cpp:100: error: cannot allocate an object of type `com::hmsonline::lms::common::AddressResults_init'</div><div>Lms.cpp:100: error:   because the following virtual functions are abstract:</div><div>/usr/include/omniORB4/CORBA_ValueBase.h:210: error:  virtual CORBA::ValueBase* CORBA::ValueFactoryBase::create_for_unmarshal()</div><div>./AddressResults.hh:233: error:  virtual com::hmsonline::lms::common::AddressResults* com::hmsonline::lms::common::AddressResults_init::create()</div><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><div>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? </div><div><br class="webkit-block-placeholder"></div><div>Any advice is greatly appreciated.</div></div></div> <div> <span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div>--</div><div>J.</div><br class="Apple-interchange-newline"></span></span> </div><br></div></body></html>