|   | J2SE 1.4.x と 5.0 の間での CORBA 機能の変更点 | J2SE のドキュメントの目次 | 
JavaTM 2 Platform Standard Edition (J2SE) の今回のリリースでは、CORBA、Java IDL、および Java RMI-IIOP テクノロジに対して次のような機能拡張が行われました。
org.omg.CORBA.SystemException 応答を整列化するとき、次のように定義されている ExceptionDetailMessage (つまり、ServiceContext with ServiceId 14) を追加します。
    /**
     * CORBA formal/02-06-01: 13.7.1:
     * ExceptionDetailMessage identifies a CDR encapsulation of a wstring,
     * encoded using GIOP 1.2 with a TCS-W of UTF-16.  This service context
     * may be sent on Reply messages with a reply_status of SYSTEM_EXCEPTION
     * or USER_EXCEPTION. The usage of this service context is defined
     * by language mappings. 
     *
     * IDL/Java: ptc/02-01-22: 1.15.2: 
     * When a System Exception is marshaled, its GIOP Reply message shall
     * include an associated ExceptionDetailMessage service context. The
     * callee's stack trace is often very valuable debugging information but
     * may contain sensitive or unwanted information. The wstring within the
     * service context will therefore contain additional information relating
     * to the exception, for example the result of calling either
     * printStackTrace(PrintWriter) or getMessage() on the exception. When
     * unmarshaling a System Exception on the client side, the wstring from
     * any ExceptionDetailMessage service context shall become the Java error
     * message in the unmarshaled exception object.
     */
J2SE 5.0 ORB は、org.omg.CORBA.SystemException 応答を非整列化するとき、SystemException コンストラクタの message 引数として ExceptionDetailMessage の内容を指定して SystemException を構築します。
注: メッセージの内容は変更になることがあります。J2SE 5.0 では、メッセージにサーバ側のスタックトレースが入っています。次のコード例は、サーバ側で生成された例外に対するクライアント側のスタックトレースです (注: 詳細は状況に応じて変化する)。例外のメッセージにあるサーバ側のスタックトレースに注目してください。
org.omg.CORBA.FREE_MEM: ----------BEGIN server-side stack trace---------- org.omg.CORBA.FREE_MEM: idlIConnect vmcid: 0x0 minor code: 0 completed: No at corba.exceptiondetailsc.idlIServantConnect.raise_system_exception(idlIServantConnect.java:23) at corba.exceptiondetailsc._idlIImplBase._invoke(_idlIImplBase.java:42) at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:647) at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:190) at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1653) at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1513) at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:895) at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:172) at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:668) at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.dispatch(SocketOrChannelConnectionImpl.java:375) at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.read(SocketOrChannelConnectionImpl.java:284) at com.sun.corba.ee.impl.transport.ReaderThreadImpl.doWork(ReaderThreadImpl.java:73) at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:382) ----------END server-side stack trace---------- vmcid: 0x0 minor code: 0 completed: No at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:274) at com.sun.corba.ee.impl.protocol.giopmsgheaders.MessageBase.getSystemException(MessageBase.java:791) at com.sun.corba.ee.impl.protocol.giopmsgheaders.ReplyMessage_1_2.getSystemException(ReplyMessage_1_2.java:97) at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.getSystemExceptionReply(CorbaMessageMediatorImpl.java:546) at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.processResponse(CorbaClientRequestDispatcherImpl.java:407) at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.marshalingComplete(CorbaClientRequestDispatcherImpl.java:303) at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.invoke(CorbaClientDelegateImpl.java:132) at org.omg.CORBA.portable.ObjectImpl._invoke(ObjectImpl.java:457) at corba.exceptiondetailsc._idlIStub.raise_system_exception(_idlIStub.java:20) at corba.exceptiondetailsc.Client.main(Client.java:87) ------------------------------------------------------------------------------
Java IDL と Java RMI-IIOP が CORBA 仕様にどのように準拠しているかについては、「J2SE 5.0 での CORBA サポートの公式仕様」を参照してください。
| Copyright © 2004 Sun Microsystems, Inc. All Rights Reserved. |   Java ソフトウェア |