NullPointerException on JavaBeanDispatcher class when debug logging enabled
---------------------------------------------------------------------------

                 Key: AXIS2-5030
                 URL: https://issues.apache.org/jira/browse/AXIS2-5030
             Project: Axis2
          Issue Type: Bug
    Affects Versions: 1.3
            Reporter: chaitra s sampige


Getting a NPE

Caused by:
java.lang.NullPointerException
at 
org.apache.axis2.jaxws.server.dispatcher.JavaBeanDispatcher.invoke(JavaBeanDispatcher.java:95)
at 
org.apache.axis2.jaxws.server.EndpointController.invoke(EndpointController.java:172)
... 30 more

The debug logging code from JavaBeanDispatcher getting serviceInstance as null .

Issue seems to be in the below mentioned code snippet.

if (log.isDebugEnabled()) {
log.debug("Exception invoking a method of " +
serviceImplClass.toString() + " of instance " +
serviceInstance.toString());

To fix this, we can change the

log.debug("Exception invoking a method of " +
(serviceImplClass == null : null ? serviceImplClass.toString() ) + " of 
instance " + (serviceInstance == null : null ? serviceInstance.toString()));

In the original code is it necessary to call toString() in the log statement 
since toString() will anyways be called when serviceInstance is not null.


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to