Issue 3267: How to create marshalel data of java.lang.Throwable instance? (java-rtf) Source: Fujitsu (Mr. Masayoshi Shimamura, shima.masa(at)jp.fujitsu.com) Nature: Uncategorized Issue Severity: Summary: I don't understand that how to create marshaled data of java.lang.Throwable instance to set it to context_data in UnknownExceptionInfo. In CORBA 2.3.1, section "13.6.7 Object Service Context" on 13-25 page says: UnknownExceptionInfo identifies a CDR encapsulation of a marshaled instance of a java.lang.throwable or one of its subclasses as described in Java to IDL Language Mapping, Section 1.4.8.1, "Mapping of UnknownExceptionInfo Service Context," on page 1-32. In Java to IDL Language Mapping specification revised by RTF (ptc/99-03-09), section "28.4.8.1 Mapping of UnknownExceptionInfo Service Context" on page 28-32 says: CORBA UNKNOWN exceptions whose GIOP Reply message includes an UnknownExceptionInfo service context containing a marshaled instance of java.lang.Throwable or one of its subclasses are mapped to RMI exceptions according to the type of the object contained in the service context, as shown in follows: ------------------------------------------------------------------- UnknownExceptionInfo RMI Exception ------------------------------------------------------------------- java.lang.Error java.rmi.ServerError java.rmi.RemoteException java.rmi.ServerException java.lang.RuntimeException java.rmi.ServerRuntimeException(JDK 1.1) java.lang.RuntimeException(Java 2) ------------------------------------------------------------------- It seems to me that these specifications above are not clear. How to create the context_data from java.lang.Throwable instance? I guess the context_data should be created by one of following two ways. Which way is correct? Or is there any other correct way? 1. A instance of java.lang.Throwable or its subclasses should be serialized by Java language specific serialization function and then should be set to the context_data as sequence of octet. 2. A instance of java.lang.Throwable or its subclasses should be marshaled as CORBA Value type data and then should be set to the context_data as sequence of octet. Resolution: see revised text below Revised Text: Add the following sentence to the end of section 1.4.7: "The Java exception is marshaled using the rules for CDR marshaling of value types as defined by the GIOP specification, applied in conjunction with the rules for mapping RMI/IDL value types to IDL as defined in section 1.3.5 of this specification." Actions taken: February 1, 2000: received issue May 24, 2001: closed issue Discussion: Section 1.4.7 states that "All other Java exceptions are marshaled as CORBA UNKNOWN system exceptions whose GIOP Reply message includes an UnknownExceptionInfo service context containing the marshaled Java exception thrown by the server implementation." The phrase "marshaled Java exception" should be clarified to avoid possible confusion as to how this marshaling is done. End of Annotations:===== Date: Tue, 01 Feb 2000 22:33:09 +0900 From: Masayoshi Shimamura To: issues@omg.org Subject: How to create marshalel data of java.lang.Throwable instance? Message-Id: <3896E095366.D6C0SHIMA@margaux> MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver 1.24 Content-Type: text/plain; charset=US-ASCII X-UIDL: :8Be9aQcd9#',e9n^]!! I don't understand that how to create marshaled data of java.lang.Throwable instance to set it to context_data in UnknownExceptionInfo. In CORBA 2.3.1, section "13.6.7 Object Service Context" on 13-25 page says: UnknownExceptionInfo identifies a CDR encapsulation of a marshaled instance of a java.lang.throwable or one of its subclasses as described in Java to IDL Language Mapping, Section 1.4.8.1, "Mapping of UnknownExceptionInfo Service Context," on page 1-32. In Java to IDL Language Mapping specification revised by RTF (ptc/99-03-09), section "28.4.8.1 Mapping of UnknownExceptionInfo Service Context" on page 28-32 says: CORBA UNKNOWN exceptions whose GIOP Reply message includes an UnknownExceptionInfo service context containing a marshaled instance of java.lang.Throwable or one of its subclasses are mapped to RMI exceptions according to the type of the object contained in the service context, as shown in follows: ------------------------------------------------------------------- UnknownExceptionInfo RMI Exception ------------------------------------------------------------------- java.lang.Error java.rmi.ServerError java.rmi.RemoteException java.rmi.ServerException java.lang.RuntimeException java.rmi.ServerRuntimeException(JDK 1.1) java.lang.RuntimeException(Java 2) ------------------------------------------------------------------- It seems to me that these specifications above are not clear. How to create the context_data from java.lang.Throwable instance? I guess the context_data should be created by one of following two ways. Which way is correct? Or is there any other correct way? 1. A instance of java.lang.Throwable or its subclasses should be serialized by Java language specific serialization function and then should be set to the context_data as sequence of octet. 2. A instance of java.lang.Throwable or its subclasses should be marshaled as CORBA Value type data and then should be set to the context_data as sequence of octet. Regards, -- Masayoshi SHIMAMURA TEL:+81-45-476-4581 FAX:+81-45-476-4726 Planning Department I, Strategic Planning Division, Strategy and Planning Group, FUJITSU LIMITED E-mail: shima@rp.open.cs.fujitsu.co.jp Date: Mon, 01 May 2000 21:51:49 +0100 From: Simon Nash Organization: IBM X-Mailer: Mozilla 4.72 [en] (Windows NT 5.0; I) X-Accept-Language: en MIME-Version: 1.0 To: shima@rp.open.cs.fujitsu.co.jp CC: java2idl-rtf@omg.org, java-rtf@omg.org Subject: Re: issue 3267 -- Java RTF issue References: <4.1.20000207152756.00b9f920@emerald.omg.org> Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=iso-8859-1 X-UIDL: _?B!!_Y+e9i8$e9[J\d9 Shimamura-san, The Throwable object must be marshaled according to the rules stated in the Java to IDL mapping specification. These are described in section 1.3.7 "Mapping RMI/IDL Exceptions." The Java class is mapped to an IDL valuetype according to the rules given in this section, and the valuetype is marshalled as stated in chapter 15 of the CORBA spec. To clarify this, I suggest the following modification to section 13.6.7: UnknownExceptionInfo identifies a CDR encapsulation of a marshaled instance of a java.lang.Throwable or one of its subclasses, encoded using the marshaled form of the IDL valuetype resulting from the mapping described in Java to IDL Language Mapping, Section 1.3.7 "Mapping RMI/IDL Exceptions," on page 1-21. The use of this service context by the Java to IDL mapping is described in Java to IDL Language Mapping, Section 1.4.8.1, Service Contex,t on page 1-32. and the addition of the following text at the end of section 1.4.8.1: The marshaled instance is encoded using the marshaled form of the IDL valuetype resulting from the mapping described in section 1.3.7 "Mapping RMI/IDL Exceptions," on page 1-21. Simon Juergen Boldt wrote: > > This is issue # 3267 > > How to create marshalel data of java.lang.Throwable instance? > > I don't understand that how to create marshaled data of > java.lang.Throwable instance to set it to context_data in > UnknownExceptionInfo. > > In CORBA 2.3.1, section "13.6.7 Object Service Context" on 13-25 page > says: > > UnknownExceptionInfo identifies a CDR encapsulation of a marshaled instance > of a java.lang.throwable or one of its subclasses as described in Java > to IDL Language Mapping, Section 1.4.8.1, "Mapping of UnknownExceptionInfo > Service Context," on page 1-32. > > In Java to IDL Language Mapping specification revised by RTF > (ptc/99-03-09), section "28.4.8.1 Mapping of UnknownExceptionInfo > Service Context" on page 28-32 says: > > CORBA UNKNOWN exceptions whose GIOP Reply message includes an > UnknownExceptionInfo service context containing a marshaled > instance of java.lang.Throwable or one of its subclasses are mapped > to RMI exceptions according to the type of the object contained in > the service context, as shown in follows: > ------------------------------------------------------------------- > UnknownExceptionInfo RMI Exception > ------------------------------------------------------------------- > java.lang.Error java.rmi.ServerError > java.rmi.RemoteException java.rmi.ServerException > java.lang.RuntimeException java.rmi.ServerRuntimeException(JDK 1.1) > java.lang.RuntimeException(Java 2) > ------------------------------------------------------------------- > > It seems to me that these specifications above are not clear. How to > create the context_data from java.lang.Throwable instance? I guess the > context_data should be created by one of following two ways. Which way > is correct? Or is there any other correct way? > > 1. A instance of java.lang.Throwable or its subclasses should be > serialized by Java language specific serialization function and then > should be set to the context_data as sequence of octet. > > 2. A instance of java.lang.Throwable or its subclasses should be > marshaled as CORBA Value type data and then should be set to the > context_data as sequence of octet. > > ================================================================ > > Juergen Boldt > Senior Member of Technical Staff > > Object Management Group Tel. +1-781 444 0404 ext. 132 > 250 First Avenue, Suite 201 Fax: +1-781 444 0320 > Needham, MA 02494, USA Email: juergen@omg.org > > > ================================================================ -- Simon C Nash, Technology Architect, IBM Java Technology Centre Tel. +44-1962-815156 Fax +44-1962-818999 Hursley, England Internet: nash@hursley.ibm.com Lotus Notes: Simon Nash@ibmgb Date: Thu, 11 May 2000 19:16:04 +0900 From: Masayoshi Shimamura To: Simon Nash Cc: java2idl-rtf@omg.org, java-rtf@omg.org, jfh@fs.fujitsu.com, lucky@fjh.se.fujitsu.co.jp Subject: Re: issue 3267 -- Java RTF issue In-Reply-To: <390DEE65.B6DFB403@hursley.ibm.com> References: <4.1.20000207152756.00b9f920@emerald.omg.org> <390DEE65.B6DFB403@hursley.ibm.com> Message-Id: <391A88642B2.C63ASHIMA@margaux> MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver 1.24 Content-Type: text/plain; charset=US-ASCII X-UIDL: 8hOe9>n$!!ReB!!$AIe9 Dear Mr. Simon Nash, On Mon, 01 May 2000 21:51:49 +0100 Simon Nash wrote: ... > The Throwable object must be marshaled according to the rules stated in > the Java to IDL mapping specification. These are described in section 1.3.7 > "Mapping RMI/IDL Exceptions." The Java class is mapped to an IDL valuetype > according to the rules given in this section, and the valuetype is marshalled > as stated in chapter 15 of the CORBA spec. > > To clarify this, I suggest the following modification to section 13.6.7: ... > and the addition of the following text at the end of section 1.4.8.1: Your suggestion seems appropriate. My question was resolved by the answer. Thank you. Regards, -- Masayoshi Shimamura TEL:+81-45-476-4581 FAX:+81-45-476-4726 E-mail: shima@rp.open.cs.fujitsu.co.jp FUJITSU LIMITED Date: Thu, 02 Nov 2000 10:37:59 -0500 From: Mary Leland X-Mailer: Mozilla 4.75 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 To: Juergen Boldt , Java RTF , java2idl-rtf@omg.org Subject: Issue 3267 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii X-UIDL: c@N!!Q$Oe9Nm=!!%V]d9 Issue 3267: "How to create marshalel data of java.lang.Throwable instance?" is listed under the IDL to Java RTF Open Issues. But it seems from the issue and discussion that it is actually a Java to IDL issue. Could it be re-classified? Thanks, -- Mary Date: Sun, 12 Nov 2000 13:04:11 +0000 From: Simon Nash Organization: IBM X-Mailer: Mozilla 4.72 [en] (Windows NT 5.0; I) X-Accept-Language: en MIME-Version: 1.0 To: java2idl-rtf@omg.org Subject: Issue 3267 proposed resolution Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii X-UIDL: X`%e9W~!e9=o6e9b2""! I will place the following proposed resolution for issue 3267 in vote 2 of the Java to IDL RTF unless I hear otherwise by close of business Wednesday. Discussion: Section 1.4.7 states that "All other Java exceptions are marshaled as CORBA UNKNOWN system exceptions whose GIOP Reply message includes an UnknownExceptionInfo service context containing the marshaled Java exception thrown by the server implementation." The phrase "marshaled Java exception" should be clarified to avoid possible confusion as to how this marshaling is done. Proposed Resolution: Add the following sentence to the end of section 1.4.7: "The Java exception is marshaled using the rules for CDR marshaling of value types as defined by the GIOP specification, applied in conjunction with the rules for mapping RMI/IDL value types to IDL as defined in section 1.3.5 of this specification." Simon -- Simon C Nash, Technology Architect, IBM Java Technology Centre Tel. +44-1962-815156 Fax +44-1962-818999 Hursley, England Internet: nash@hursley.ibm.com Lotus Notes: Simon Nash@ibmgb