[arquillian-issues] [JBoss JIRA] (ARQ-1437) NPE in ExceptionProxy.readExternal() for root cause leads to deserializationProblem = true

Falko M. (JIRA) jira-events at lists.jboss.org
Tue Jul 23 09:25:26 EDT 2013


Falko M. created ARQ-1437:
-----------------------------

             Summary: NPE in ExceptionProxy.readExternal() for root cause leads to deserializationProblem = true
                 Key: ARQ-1437
                 URL: https://issues.jboss.org/browse/ARQ-1437
             Project: Arquillian
          Issue Type: Bug
      Security Level: Public (Everyone can see)
    Affects Versions: 1.1.0.Final, 1.0.2.Final
            Reporter: Falko M.
            Priority: Minor


See line 199 (for 1.0.2.Final):
{code}
// reset the cause, so we can de-serialize them individual
SecurityActions.setFieldValue(Throwable.class, original, "cause", causeProxy.createException());
{code}
For the root cause of an exception, {{causeProxy}} will always be {{null}} and so a {{NullPointerException}} is thrown.

As the code is wrapped in a try block with follwoing catch block:
{code}
catch (Throwable e) // ClassNotFoundExcpetion / NoClassDefFoundError
{
    // ignore, could not load class on client side, move on and create a fake 'proxy' later
    deserializationProblem = true;
}
{code}
the NPE is caught and is "expected" to be a {{ClassNotFoundExcpetion}} or {{NoClassDefFoundError}} which is clearly not the case.

*Possible fix:*
{{original.cause}} should only be overwritten when {{causeProxy}} is *not* null.

*More context information:*
I came across this problem while trying to find the reason for an unexpected {{ArquillianProxyException}}:
{code}org.jboss.arquillian.test.spi.ArquillianProxyException: javax.ejb.EJBException : javax.persistence.OptimisticLockException [Proxied because : Original exception not deserilizable, ClassNotFoundException]{code}
The root problem was not the NPE, but the {{ClassNotFoundException}} mislead me and so I debugged {{ExceptionProxy}}.
I my case there is an {{InvalidClassException}} because of an older hibernate version on the client side.
+So that is another problem of {{ExceptionProxy}} as it assumes that only {{ClassNotFoundExcpetion}} or {{NoClassDefFoundError}} can occur!+

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the arquillian-issues mailing list