[jacorb-bugs] [Bug 979] Unexpected exception on local calls interceptions
bugzilla-daemon at jacorb.org
bugzilla-daemon at jacorb.org
Fri May 2 20:40:10 CEST 2014
http://www.jacorb.org/bugzilla/show_bug.cgi?id=979
Quynh <nguyenq at stladvantage.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |nguyenq at stladvantage.com
--- Comment #2 from Quynh <nguyenq at stladvantage.com> ---
(In reply to Hugo Roenick from comment #1)
> Created attachment 434 [details]
> Demo with fix in pom.xml
>
> Updating the demo with corrections in pom.xml
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
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spline.inf.fu-berlin.de/pipermail/jacorb-bugs/attachments/20140502/ebff885a/attachment.html>
More information about the jacorb-bugs
mailing list