It's all about the answers!

Ask a question

NullPointerException inside RTC code


Dan Sevcenco (5021823) | asked May 08 '13, 9:50 a.m.
edited May 08 '13, 10:48 a.m. by Ralph Schoon (59.0k23642)
I have developed an work-item advisor and a participant using an RTC instance deployed on Tomcat. The code runs fine on this development environment.

Now, I have deployed the code on a pre-production environment in which RTC is installed on Websphere Application Server.

To my surprise, upon executing the action of saving a work-item, when the participant code is executed, RTC generates a run-time exception. The stack trace is at the end of this message.

The participant invokes the operation fWorkitemServer.saveWorkItem2
The exception is thrown inside the package : com.ibm.team.workitem.service.internal.save.
The participant code is inside package : itsm2.rtcext.workitem.extensions.service.participants.servicerequest.

RTC version is 4.0.0
WAS version is 7.0.0.25 and it is deployed on AIX v7.

How can I figure out what is wrong with the RTC deployment and operational configuration on WAS as oposed to Tomcat that is triggering this behaviour?

================ Stack trace begins here ===================

2013-05-08 21:11:39,346 [              WebContainer : 2] ERROR com.ibm.team.process.common                         -
java.lang.NullPointerException
        at com.ibm.team.workitem.common.internal.util.SequenceValue$Factory.valueOf(SequenceValue.java:83)
        at com.ibm.team.workitem.service.internal.save.APTSequenceValueUpdater.handleNotifySave(APTSequenceValueUpdater.java:48)
        at com.ibm.team.workitem.service.internal.save.WorkItemSaveParticipant.handleNotifySave(WorkItemSaveParticipant.java:32)
        at com.ibm.team.workitem.service.internal.save.WorkItemSavePreparation.notifySave(WorkItemSavePreparation.java:204)
        at com.ibm.team.workitem.service.internal.WorkItemRepositoryService.notifyPreSave(WorkItemRepositoryService.java:425)
        at com.ibm.team.workitem.service.internal.WorkItemRepositoryService.access$2(WorkItemRepositoryService.java:419)
        at com.ibm.team.workitem.service.internal.WorkItemRepositoryService$1.run(WorkItemRepositoryService.java:337)
        at com.ibm.team.workitem.service.internal.WorkItemRepositoryService$1.run(WorkItemRepositoryService.java:1)
        at com.ibm.team.repository.service.internal.PrimitiveTransactionService$3.run(PrimitiveTransactionService.java:168)
        at com.ibm.team.repository.service.internal.rdb.RepositoryDatabase.runTransaction(RepositoryDatabase.java:321)
        at com.ibm.team.repository.service.internal.rdb.RepositoryDatabase.runInTransaction(RepositoryDatabase.java:245)
        at com.ibm.team.repository.service.internal.PrimitiveTransactionService.runInTransaction(PrimitiveTransactionService.java:102)
        at com.ibm.team.repository.service.internal.PrimitiveTransactionService.runInTransaction(PrimitiveTransactionService.java:97)
        at sun.reflect.GeneratedMethodAccessor153.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
        at java.lang.reflect.Method.invoke(Method.java:611)
        at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord.invoke(ExportProxyServiceRecord.java:361)
        at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord.access$0(ExportProxyServiceRecord.java:347)
        at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord$ExportedServiceInvocationHandler.invoke(ExportProxyServiceRecord.java:56)
        at $Proxy110.runInTransaction(Unknown Source)
        at com.ibm.team.repository.service.AbstractService.runInTransaction(AbstractService.java:965)
        at com.ibm.team.workitem.service.internal.WorkItemRepositoryService.saveTransaction(WorkItemRepositoryService.java:326)
        at com.ibm.team.workitem.service.internal.WorkItemRepositoryService.save(WorkItemRepositoryService.java:284)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
        at java.lang.reflect.Method.invoke(Method.java:611)
        at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord.invoke(ExportProxyServiceRecord.java:361)
        at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord.access$0(ExportProxyServiceRecord.java:347)
        at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord$ExportedServiceInvocationHandler.invoke(ExportProxyServiceRecord.java:56)
        at $Proxy583.save(Unknown Source)
        at com.ibm.team.workitem.service.internal.WorkItemServer.save(WorkItemServer.java:298)
        at com.ibm.team.workitem.service.internal.WorkItemServer.saveWorkItems(WorkItemServer.java:151)
        at com.ibm.team.workitem.service.internal.WorkItemServer.saveWorkItem3(WorkItemServer.java:120)
        at com.ibm.team.workitem.service.internal.WorkItemServer.saveWorkItem2(WorkItemServer.java:115)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
        at java.lang.reflect.Method.invoke(Method.java:611)
        at com.ibm.team.workitem.service.internal.ServiceAdapter.invoke(ServiceAdapter.java:74)
        at $Proxy558.saveWorkItem2(Unknown Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
        at java.lang.reflect.Method.invoke(Method.java:611)
        at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord.invoke(ExportProxyServiceRecord.java:361)
        at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord.access$0(ExportProxyServiceRecord.java:347)
        at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord$ExportedServiceInvocationHandler.invoke(ExportProxyServiceRecord.java:56)
        at $Proxy560.saveWorkItem2(Unknown Source)
        at itsm2.rtcext.workitem.extensions.service.participants.servicerequest.ManageServiceRequestParticipant.saveWorkItem(ManageServiceRequestParticipant.java:594)
        at itsm2.rtcext.workitem.extensions.service.participants.servicerequest.ManageServiceRequestParticipant.run(ManageServiceRequestParticipant.java:133)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
        at java.lang.reflect.Method.invoke(Method.java:611)
        at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord.invoke(ExportProxyServiceRecord.java:361)
        at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord.access$0(ExportProxyServiceRecord.java:347)
        at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord$ExportedServiceInvocationHandler.invoke(ExportProxyServiceRecord.java:56)
        at $Proxy730.run(Unknown Source)
        at com.ibm.team.process.internal.common.advice.runtime.OperationAdviceManager.runParticipant(OperationAdviceManager.java:1143)
        at com.ibm.team.process.internal.common.advice.runtime.OperationAdviceManager.runParticipants(OperationAdviceManager.java:973)
        at com.ibm.team.process.internal.common.advice.runtime.OperationAdviceManager.advise(OperationAdviceManager.java:318)
        at com.ibm.team.process.internal.common.util.AbstractProcess.doAdvise(AbstractProcess.java:196)
        at com.ibm.team.process.internal.service.ServerProcess.access$2(ServerProcess.java:1)
        at com.ibm.team.process.internal.service.ServerProcess$2.run(ServerProcess.java:156)
        at com.ibm.team.repository.service.internal.PrimitiveTransactionService$3.run(PrimitiveTransactionService.java:168)
        at com.ibm.team.repository.service.internal.rdb.RepositoryDatabase.runTransaction(RepositoryDatabase.java:321)
        at com.ibm.team.repository.service.internal.rdb.RepositoryDatabase.runInTransaction(RepositoryDatabase.java:245)
        at com.ibm.team.repository.service.internal.PrimitiveTransactionService.runInTransaction(PrimitiveTransactionService.java:102)
        at com.ibm.team.repository.service.internal.PrimitiveTransactionService.runInTransaction(PrimitiveTransactionService.java:97)
        at sun.reflect.GeneratedMethodAccessor153.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
        at java.lang.reflect.Method.invoke(Method.java:611)
        at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord.invoke(ExportProxyServiceRecord.java:361)
        at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord.access$0(ExportProxyServiceRecord.java:347)
        at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord$ExportedServiceInvocationHandler.invoke(ExportProxyServiceRecord.java:56)
        at $Proxy110.runInTransaction(Unknown Source)
        at com.ibm.team.repository.service.internal.TransactionService.runInTransaction(TransactionService.java:37)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
        at java.lang.reflect.Method.invoke(Method.java:611)
        at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord.invoke(ExportProxyServiceRecord.java:361)
        at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord.access$0(ExportProxyServiceRecord.java:347)
        at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord$ExportedServiceInvocationHandler.invoke(ExportProxyServiceRecord.java:56)
        at $Proxy186.runInTransaction(Unknown Source)
        at com.ibm.team.process.internal.service.ProcessService.runInTransaction(ProcessService.java:4614)
        at com.ibm.team.process.internal.service.ProcessService.runInTransaction(ProcessService.java:4621)
        at com.ibm.team.process.internal.service.ServerProcess.adviseAndExecute(ServerProcess.java:153)
        at com.ibm.team.workitem.service.internal.AuditableServerProcess.adviseAndExecute(AuditableServerProcess.java:86)
        at com.ibm.team.workitem.service.internal.WorkItemRepositoryService.processSave(WorkItemRepositoryService.java:566)
        at com.ibm.team.workitem.service.internal.WorkItemRepositoryService.save(WorkItemRepositoryService.java:491)
        at com.ibm.team.workitem.service.internal.WorkItemRepositoryService.save(WorkItemRepositoryService.java:464)
        at com.ibm.team.workitem.service.internal.WorkItemRepositoryService.access$3(WorkItemRepositoryService.java:460)
        at com.ibm.team.workitem.service.internal.WorkItemRepositoryService$1.run(WorkItemRepositoryService.java:340)
        at com.ibm.team.workitem.service.internal.WorkItemRepositoryService$1.run(WorkItemRepositoryService.java:1)
        at com.ibm.team.repository.service.internal.PrimitiveTransactionService$3.run(PrimitiveTransactionService.java:168)
        at com.ibm.team.repository.service.internal.rdb.RepositoryDatabase$Transaction.run(RepositoryDatabase.java:470)
        at com.ibm.team.repository.service.internal.rdb.RepositoryDatabase$1.run(RepositoryDatabase.java:294)
        at com.ibm.team.repository.service.internal.rdb.ConnectionPoolService.withCurrentConnection(ConnectionPoolService.java:381)
        at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
        at java.lang.reflect.Method.invoke(Method.java:611)
        at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord.invoke(ExportProxyServiceRecord.java:361)
        at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord.access$0(ExportProxyServiceRecord.java:347)
        at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord$ExportedServiceInvocationHandler.invoke(ExportProxyServiceRecord.java:56)
        at $Proxy74.withCurrentConnection(Unknown Source)
        at com.ibm.team.repository.service.internal.rdb.RepositoryDatabase.runTransaction(RepositoryDatabase.java:290)
        at com.ibm.team.repository.service.internal.rdb.RepositoryDatabase.runInTransaction(RepositoryDatabase.java:245)
        at com.ibm.team.repository.service.internal.PrimitiveTransactionService.runInTransaction(PrimitiveTransactionService.java:102)
        at com.ibm.team.repository.service.internal.PrimitiveTransactionService.runInTransaction(PrimitiveTransactionService.java:97)
        at sun.reflect.GeneratedMethodAccessor153.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
        at java.lang.reflect.Method.invoke(Method.java:611)
        at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord.invoke(ExportProxyServiceRecord.java:361)
        at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord.access$0(ExportProxyServiceRecord.java:347)
        at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord$ExportedServiceInvocationHandler.invoke(ExportProxyServiceRecord.java:56)
        at $Proxy110.runInTransaction(Unknown Source)
        at com.ibm.team.repository.service.AbstractService.runInTransaction(AbstractService.java:965)
        at com.ibm.team.workitem.service.internal.WorkItemRepositoryService.saveTransaction(WorkItemRepositoryService.java:326)
        at com.ibm.team.workitem.service.internal.WorkItemRepositoryService.save(WorkItemRepositoryService.java:284)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
        at java.lang.reflect.Method.invoke(Method.java:611)
        at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord.invoke(ExportProxyServiceRecord.java:361)
        at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord.access$0(ExportProxyServiceRecord.java:347)
        at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord$ExportedServiceInvocationHandler.invoke(ExportProxyServiceRecord.java:56)
        at $Proxy583.save(Unknown Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
        at java.lang.reflect.Method.invoke(Method.java:611)
        at com.ibm.team.repository.servlet.AbstractTeamServerServlet.handleMethod(AbstractTeamServerServlet.java:1351)
        at com.ibm.team.repository.servlet.AbstractTeamServerServlet.executeMethod(AbstractTeamServerServlet.java:915)
        at com.ibm.team.repository.servlet.AbstractTeamServerServlet.doPost(AbstractTeamServerServlet.java:717)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:738)
        at com.ibm.team.repository.servlet.AbstractTeamServerServlet.handleRequest2(AbstractTeamServerServlet.java:2061)
        at com.ibm.team.repository.servlet.AbstractTeamServerServlet.handleRequest(AbstractTeamServerServlet.java:1878)
        at com.ibm.team.repository.servlet.AbstractTeamServerServlet.access$0(AbstractTeamServerServlet.java:1863)
        at com.ibm.team.repository.servlet.AbstractTeamServerServlet$1.service(AbstractTeamServerServlet.java:208)
        at com.ibm.team.repository.internal.service.auth.impl.JAuthHandler$1.run(JAuthHandler.java:102)
        at com.ibm.team.repository.servlet.AbstractTeamServerServlet.service(AbstractTeamServerServlet.java:1682)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
        at org.eclipse.equinox.http.registry.internal.ServletManager$ServletWrapper.service(ServletManager.java:180)
        at org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61)
        at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:126)
        at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:76)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
        at org.eclipse.equinox.servletbridge.BridgeServlet.service(BridgeServlet.java:120)
        at com.ibm.team.repository.server.servletbridge.JazzServlet.service(JazzServlet.java:68)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
        at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1657)
        at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1597)
        at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:131)
        at com.ibm.team.repository.server.servletbridge.BridgeFilter.processDelegate(BridgeFilter.java:133)
        at com.ibm.team.repository.server.servletbridge.BridgeFilter.doFilter(BridgeFilter.java:154)
        at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:188)
        at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:116)
        at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:77)
        at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:908)
        at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:934)
        at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:502)
        at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:181)
        at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:91)
        at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:864)
        at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1592)
        at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:186)
        at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:452)
        at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:511)
        at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:305)
        at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83)
        at com.ibm.ws.ssl.channel.impl.SSLReadServiceContext$SSLReadCompletedCallback.complete(SSLReadServiceContext.java:1784)
        at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
        at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
        at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
        at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
        at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
        at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
        at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
        at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1646)




One answer



permanent link
Ralph Schoon (59.0k23642) | answered May 08 '13, 9:57 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Please be aware that in the SDK you have client and server code. You can easily mix it. See http://rsjazz.wordpress.com/2013/03/14/what-apis-are-available-for-rtc-and-what-can-you-extend/ . If you do weird things happen. The other thing about null pointer is, for me it was usually my fault. Try to attach to your code in Tomcat as explained in the Extensions Workshop and try to find out what is null.

Comments
Ralph Schoon commented May 08 '13, 9:58 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Likely a Service or an object that you don't get for some reason.


Dan Sevcenco commented May 08 '13, 10:06 a.m.

Ralph,

The code works on Tomcat. It does not work on Websphere Application Server.

I would think that if my call setup was wrong, I would see some kind of error in the Tomcat configuration too.

Besides, I have enough development experience to know that a well written API (as the RTC API I am sure is) checks for method call parameters' validity as well as system state before actually executing the request.

As you can see from the stack trace, my participant's code is somewhere in the middle of the stack so a lot of code is executed from my code to the point where the NullPointerException is thrown. I am doubtful that all that code does not check for every kind of possible error conditions.


Ralph Schoon commented May 08 '13, 10:40 a.m. | edited May 08 '13, 10:47 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

If it deploys on WebSphere it should indeed work as on Tomcat. So if you don't get deployment errors that would be my first assumption too. However, the assumption that the API can protect itself against null pointers and such is probably not true. I have seen too many of those where, my bad, things did not work out as I thought. E.g. if a service can not be fetched and is null, and you call it, there is nothing an API can reasonably expected to do about it.

I have seen issues with packaging for WAS, where the Jar files did not uncompress and the like. Not likely what you see. However, there might still be issues with Java versions or product versions, or simply the process template or project area configuration.

I would look into the stack trace and at the positions you see the error to find out what might be different.


Dan Sevcenco commented May 08 '13, 11:57 a.m.

OK, I'll give you that the API can have its own problems. And your example of badly written code is aimed at the participant code, which is not the case here.

The deployment on WAS is done successfully, in that I can see the deployment and the bundle start messages in the internal admin pages. The participant is successfully initialized and called. I know this because the saveWorkItem2 is the last call in the code. And I have a lot of code before the call in question.

There must be something related to the RTC / WAS / Java / AIX configuration that is different from the RTC / Tomcat / Java / Linux configuration of my development machine.

The question is what and how can investigate to see what is going on?

Your answer


Register or to post your answer.