<html>
    <head>
      <base href="http://www.jacorb.org/bugzilla/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:nguyenq@stladvantage.com" title="Quynh <nguyenq@stladvantage.com>"> <span class="fn">Quynh</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Unexpected exception on local calls interceptions"
   href="http://www.jacorb.org/bugzilla/show_bug.cgi?id=979">bug 979</a>
          <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">CC</td>
           <td>
                
           </td>
           <td>nguyenq@stladvantage.com
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Unexpected exception on local calls interceptions"
   href="http://www.jacorb.org/bugzilla/show_bug.cgi?id=979#c2">Comment # 2</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Unexpected exception on local calls interceptions"
   href="http://www.jacorb.org/bugzilla/show_bug.cgi?id=979">bug 979</a>
              from <span class="vcard"><a class="email" href="mailto:nguyenq@stladvantage.com" title="Quynh <nguyenq@stladvantage.com>"> <span class="fn">Quynh</span></a>
</span></b>
        <pre>(In reply to Hugo Roenick from <a href="show_bug.cgi?id=979#c1">comment #1</a>)
<span class="quote">> Created <span class=""><a href="attachment.cgi?id=434" name="attach_434" title="Demo with fix in pom.xml">attachment 434</a> <a href="attachment.cgi?id=434&action=edit" title="Demo with fix in pom.xml">[details]</a></span>
> Demo with fix in pom.xml

> Updating the demo with corrections in pom.xml</span >

Hi Hugo,

  I think I know what caused the NullPointerException.  In
Delegate.non_existent(), the ServantObject was null from the call to
servant_preinvoke() below:

    try
    {
        so = servant_preinvoke(self, "_non_existent", java.lang.Object.class);
    }
    catch (OBJECT_NOT_EXIST e)
    {
        return true;
    }

That is because the obj._non_existent() call in sayHello() was made with the
"Any wrong secret" credential in sayHello(), and it was rejected by the
ServerRequestInterceptorImpl.receive_request() on the server side with the
NO_PERMISSION exception which causes servant_preinvoke() to return null for the
ServantObject.  The NullPointerException was thrown when it was accessed in the
call:

    finally
    {
      servant_postinvoke(self, so);
    }

Since it is a local call, the ForwardRequest exception was passed on instead of
the NO_PERMISSION.

I think, as an improvement to Delegate.non_existent(), the code segment below
can be added check for null ServantObject and throw the OBJ_ADAPTER exception:

     if (so == null )
     {
       throw new OBJ_ADAPTER( "Servant returned from servant_preinvoke was
null" );
     }


To make your code to work, I think you need to remove the check for
NO_PERMISSION and just forward all exceptions in the
ClientRequestInterceptor.receive_exception().

Hope that helps.

Quynh Nguyen</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>