It's all about the answers!

Ask a question

Null Pointer Exception - CCM logs (ccm.log)


vijayakumar ramesh (1173660) | asked May 18 '18, 5:00 a.m.

we are getting Null pointer exception entries in ccm.logs, whenever user is trying to create new workitem/refresh work item.
java.lang.NullPointerException
    at com.ibm.team.workitem.service.internal.rest.WorkItemRestService.collectAdvisorConfigurations(WorkItemRestService.java:2318)
    at com.ibm.team.workitem.service.internal.rest.WorkItemRestService.getDynamicAttributesPropertiesConfiguration(WorkItemRestService.java:2298)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)

We have server side plugin developed which implements ICondition. Plugin doesn't have extension point (Operation ID), so it is not actually the standard Server side plugin way. It is just implementing ICondition.
This deals with attributes readonly/mandatory/writable behaviour.Plugin at the end returns only true or false.
Observations
Without installing this plugin - no entries of Null pointer exception in the ccm logs.
With plugin - Null Pointer exception entries in the log.
So investigated if exception happening from plugin class - but it is happening other IBM class ( collectAdvisorConfigurations(WorkItemRestService.java:2318)) over which we don't have control to catch this exception.
Tested catching the exception inside plugin - nothing was caught, so it means null pointer exception not happening from invocation of IBM  classes from this plugin.
If any body has idea about such scenarios please share/comment.

2 answers



permanent link
Ralph Schoon (63.1k33645) | answered May 18 '18, 5:20 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

If you have an ICondition extension deployed, the condition is used in and advisor e.g.

  1. Read Only for Condition
  2. Required for Condition

as you explain.

Other than in a normal advisor that only runs when someone presses the safe button, the advisors above (and the *** for Type and State) are called in the UI thread when opening a work item. This also happens in the Web UI.

You can connect to the server and debug what is happening.

I don't know what leads to that situation either, but I would check the configuration and potentially try to debug the issue on the server or on a Jetty debug server.

Note that the read only and required


Comments
vijayakumar ramesh commented May 28 '18, 3:55 a.m.

I also noticed that , this null pointer exception is thrown while loading Work item in the web client. It doesn't happen during loading/opening work item in  the Eclipse client.


permanent link
Artyom Tarasenko (111) | answered Feb 04 '19, 5:27 a.m.

This is not an answer, but a comment to the answer from Ralph.

 

The null value comes from com.ibm.team.workitem.service.internal.rest.DTOConversionService.convertValueProvider(IConfiguration)

which returns null if providerClass is null. And the providerClass is null because it is taken from

com.ibm.team.workitem.common.internal.attributeValueProviders.AbstractConfiguration.getScriptClass()

which only looks for the <script> entries in the configuration which our template doesn't have.

So, this is a template configuration issue. Looks like there should be
<script class="someclass"></script>
entries for every condition in the specification.xml.

 

Adding such entries for all Required and Read-Only Conditions makes the NPE disappear.

But then there is a side-effect:

The Web-UI tries to execute the script in order to show the mandatory mark (* asterisk) for all the elements.

 

With an empty script the mandatory mark in WebUI just disappears. Without the <script/> elements the mandatory marks are shown properly despite the NPE. With the <script/> elements, the mandatory fields are not marked.

 

One obvious workaround would be to implement the 'matches' in the JavaScript which would do exactly the same as the Java 'matches' in the server-side extension. But we would really like to avoid code duplication. Are there any better solutions?


Comments
Ralph Schoon commented Feb 04 '19, 5:35 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

I would suggest to approach support. I think I have seen discussions around NPE's in such situations and how to fix it. If there is a fix available support could provide that.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.