[omniORB] Sequence of valuetype

Björn Hagemeier bjoernh at uni-paderborn.de
Wed Jan 18 11:18:24 GMT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all,

I have the following IDL code which compiles without complaints using
omniORB 4.1.0:

/** BEGIN IDL CODE */
valuetype AbstractAction {

}

typedef sequence<AbstractAction> AbstractActionSeq;

valuetype ActionGroup : AbstractAction {
   public AbstractActionSeq actions;
}

valuetype AbstractJob : ActionGroup {

}

valuetype AbstractTask : AbstractAction {

}

valuetype ExecuteTask : AbstractTask {

}
/** END IDL CODE */

Think of it as a composite pattern to model hierarchical data. The class
hierarchy is more complex than it needs to be at the first sight, but I
stripped down the data I consider unimportant for describing this problem.

In the client I create an ExecuteTask_impl (that's what I called the
implementation type) like this:

ExecuteTask_impl *exTask = new ExecuteTask_impl();
  AbstractActionSeq taskSeq(1); taskSeq.length(1);
taskSeq[0] = exTask;
AbstractJob_impl *job =	new AbstractJob_impl(taskSeq);

The job is passed to the following interface:

/** BEGIN IDL CODE */
  interface SchedulerIf {
    boolean submitJob(in AbstractJob _job);
  };
/** END IDL CODE */

The server causes a BAD_PARAM_ValueFactoryFailure exception in
valueType.cc:630. omniValueType::handleIncompatibleValue is called from
AbstractAction::_NP_unmarshal, which means the server could not
interpret the value (an ExecuteTask) as an AbstractAction, although the
former is derived from the latter.

If I change the client code such that the sequence in the
AbstractJob_impl object is filled with _true_ AbstractActions instead of
derived types, unmarshalling works perfectly.

Is this behavior intended and if so, how can I cleanly work around it?


Regards,

Björn

- --
+----------------------------+-----------------------------------------+
| Björn Hagemeier            | Tel:               +49 (5251)  87 12 69 |
| Otto-Wels-Str. 34          | Mobil:             +49 ( 173) 878 48 77 |
|                            | E-Mail:        bjoernh at uni-paderborn.de |
|                            | Homepage:            www.b-hagemeier.de |
| 33102 Paderborn            | ICQ:                          464 20 23 |
+----------------------------+-----------------------------------------+
| PGP-Key:          1A967704                                           |
| Key Fingerprint:  5FF6 973A 46FC DB6C E9AF  A324 DE2E A874 1A96 7704 |
+----------------------------------------------------------------------+

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDzhXv3i6odBqWdwQRAknDAJ90JjXFLo+c9bo9qcyiHKMxCNXXuACfVntY
pV9c4eON60JuDrLcwjHpfVI=
=r6ue
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bjoernh.vcf
Type: text/x-vcard
Size: 299 bytes
Desc: not available
Url : http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20060118/742c01bd/bjoernh.vcf


More information about the omniORB-list mailing list