JDK-8005310 : Marshal exception is wrong
  • Type: Backport
  • Component: other-libs
  • Sub-Component: corba
  • Affected Version: 7u3
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2012-12-20
  • Updated: 2014-11-19
  • Resolved: 2013-02-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
8 b82Fixed
Investigated this issue a bit to determine the root cause, because this exception is caused by a TypeCode marshalling problem. This is triggered by the invocation of the second operation of the OptUnionInterface i.e. retrieveNVSeq from the java client. The JDK-7199858 bug description infers that the issue is with the union marshalling, but in fact it is the marshalling of the TypeCode for the union, which as I say is initiated by the the struct NV is defined as struct NV { string name; any value; }; if this was defined as struct NV { string name; OptUnion value; } the problem wouldn't occur. In any case the NVseq retrieveNVSeq () operation returns a sequence of NV struct, and these contain an any into which an OptUnion is placed. Because and any is being returned, the TypeCode of the union is contained with the any value. When the type code is being unmarshalled in the invoking client, the copy method of TypeCodeImpl for a union throws an (unwarrented) exception. So the issue is not with the marshalling of an OptUnion value, but with the marshalling of a union TypeCode, which in this scenario is contained within the any value of the NV struct, which are returned by the retrieveNV operation.