Issue Details (XML | Word | Printable)

Key: JRA-11878
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Critical Critical
Assignee: Sam Chang [Atlassian]
Reporter: Sean Rees
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
JIRA

SOAP - JiraSoapService.getComments(token, issueKey) NPE

Created: 04/Jan/07 05:13 PM   Updated: 08/Jan/07 08:57 PM
Component/s: Remote API (SOAP & XML-RPC)
Affects Version/s: 3.7
Fix Version/s: 3.7.2

Time Tracking:
Not Specified

Environment: RHEL (CentOS 4.4), Tomcat 5.5.17, JDK5u9, MySQL 4

Participants: Sam Chang [Atlassian], Sean Rees and Yuen-Chi Lian [Atlassian]
Since last comment: 1 year, 39 weeks, 3 days ago
Resolution Date: 08/Jan/07 08:57 PM
Labels:


 Description  « Hide
RemoteComment.java:27 NPE
roleLevel = comment.getRoleLevel().getName()

Caused by: java.lang.NullPointerException
at com.atlassian.jira.rpc.soap.beans.RemoteComment.<init>(RemoteComment.java:27)
at com.atlassian.jira.rpc.soap.util.SoapUtils.getComments(SoapUtils.java:165)
at com.atlassian.jira.rpc.soap.service.IssueServiceImpl.getComments(IssueServiceImpl.java:407)
at com.atlassian.jira.rpc.soap.JiraSoapServiceImpl.getComments(JiraSoapServiceImpl.java:280)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397)
at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186)
at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
... 47 more

– Sample execution (stacktrace above)
irb(main):051:0> svc.getComments(tok, 'WBTOOL-1740')
SOAP::FaultError: java.lang.NullPointerException
from #<SOAP::Mapping::Object:0xb78f926c>

We upgraded to 3.7 using the upgrade procedure (setup naked install in new MySQL db, did an XML restore, then reindexed for good measure).



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Yuen-Chi Lian [Atlassian] added a comment - 04/Jan/07 09:24 PM
Hi Sean,

Thanks for reporting this to us. For time being, you may try editing the source code of the RPC plugin:

You can prevent the NPE by modifying the RemoteComment(Comment comment) constructor:

if(comment.getRoleLevel() != null){
  roleLevel = comment.getRoleLevel().getName();
}
else{
  roleLevel = null;
}

Cheers,
Yuen-Chi Lian


Sean Rees added a comment - 04/Jan/07 09:28 PM
Thanks for the tip! Glad to know that fix will work.