I'm using a DII client to invoke a method against a co-located DSI servant. The DSI servant attempts to return a SystemException (in the form of an Any) to the client, however the client does not receive the SystemException. Here's a snippet of the DSI code that is returning the SystemException... public void invoke(org.omg.CORBA.ServerRequest request) { ... // I've received a systemException and must put it into an Any for request SystemException sysExcep = ...; org.omg.CORBA.Any exceptionCopy = DUC.CorbaObjectRegistry.getInstance().getOrb ().create_any(); org.omg.CORBA.portable.OutputStream outputStreamForExceptionCopy = exceptionCopy.create_output_stream(); org.omg.CORBA.SystemExceptionHelper.insert(exceptionCopy, sysExcep); // put the exceptionCopy into the request request.set_exception(exceptionCopy); ... } Again, I have a CORBA object reference to an instance of the above DSI servant that invokes a method on the DSI servant (through the CORBA object reference). The code for the DII client that makes this happen AND has a problem: ... org.omg.CORBA.Request req = mObjRef._request("myoperation"); ... // code to specify and populate arguments removed for clarity // code to specify return type removed for clarity // code to specify exception list and types removed for clarity ... // invoke a request against the DSI servant through it's CORBA object reference req.invoke(); ... // the request has completed, we're going to get either a return value or exception if (req.env().exception() != null) { // this means req.env().exception() is non-null and an exception was raised } else { // this means that no exception was raised and req.result().value() should be non-null } The problem that I'm seeing is that after the req.invoke() request completes, both req.env().exception() AND req.result().value() are BOTH null!!! Since I returned a SystemException (in the form of an Any in the DSI servant), the ORB should be providing the DII caller with a SystemException, but it's not. Anyways, since the logic of my code above first checks to see if req.env ().exception() contains a non-null value (which it does not), the ORB executes my else statement and attempts to work with req.result().value() which craps out since that value is null. I did some further investigation by putting JacORB into logging verbosity level 4 and noticed that the code responsible for handling the DII request is interpreting the exception as an ApplicationException within the ReplyReceiver class. (I did not check to see if the ORB originally marshalled the SystemException within the Any from the invoke(request) method properly so this might be the problem.) Anyways, attached is a stack trace from JacORB showing where it's having some problems while attempting to de-marshall the Any containing the SystemException in the DII: [05-06-2007 21:48:48:655] jacorb.org.giop:DEBUG: ServerRequest: reply to myoperation [05-06-2007 21:48:48:655] jacorb.dii.request:DEBUG: ApplicationException org.omg.CORBA.portable.ApplicationException at org.jacorb.orb.ReplyReceiver.getApplicationException (ReplyReceiver.java:390) at org.jacorb.orb.ReplyReceiver.getReply(ReplyReceiver.java:315) at org.jacorb.orb.Delegate.invoke_internal(Delegate.java:1074) at org.jacorb.orb.Delegate.invoke(Delegate.java:939) at org.jacorb.orb.dii.Request._invoke(Request.java:268) at org.jacorb.orb.dii.Request.invoke(Request.java:364) The problem is 100% reproducible for me. If there's any assistance (additional code, more output from the ORB, etc.) that I can provide to help resolve the problem, please feel free to email me. Thanks!
One more critical piece of information for clarification... If the DSI servant and the DII client are NOT co-located, the exception condition described above WILL occur. If the DSI servant and the DII client reside within different processes, everything will execute normally with no exception.
Can you provide a standalone, compilable test case?
Unable to reproduce. Added tests under SHA 7c0319b09b30ec2bd9a2fbddd96acf3a7de13066. Please modify one of the tests and reopen if its still a problem
Corrected commit message - sha : f6489a046c28508a30044b582a489d5bf760f545