File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes java.lang.NullPointerException in action class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "java.lang.NullPointerException in action class" Watch "java.lang.NullPointerException in action class" New topic
Author

java.lang.NullPointerException in action class

Omar Mohaidat
Ranch Hand

Joined: Jan 16, 2008
Posts: 34
Hi all,

In my action class after process this code :


i got this error

[8/14/11 15:00:13:420 AST] 00000029 SystemErr R java.lang.NullPointerException
[8/14/11 15:00:13:436 AST] 00000029 SystemErr R at com.cms.page.actions.CreateCorrespondenceAction.createCorrespondence(CreateCorrespondenceAction.java:1358)
[8/14/11 15:00:13:436 AST] 00000029 SystemErr R at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[8/14/11 15:00:13:436 AST] 00000029 SystemErr R at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
[8/14/11 15:00:13:436 AST] 00000029 SystemErr R at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[8/14/11 15:00:13:436 AST] 00000029 SystemErr R at java.lang.reflect.Method.invoke(Method.java:615)
[8/14/11 15:00:13:436 AST] 00000029 SystemErr R at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:269)
[8/14/11 15:00:13:436 AST] 00000029 SystemErr R at com.cms.page.actions.BaseAbstractAction.dispatchMethod(BaseAbstractAction.java:254)
[8/14/11 15:00:13:436 AST] 00000029 SystemErr R at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:170)
[8/14/11 15:00:13:436 AST] 00000029 SystemErr R at org.springframework.web.struts.DelegatingActionProxy.execute(DelegatingActionProxy.java:110)
[8/14/11 15:00:13:436 AST] 00000029 SystemErr R at org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)
[8/14/11 15:00:13:436 AST] 00000029 SystemErr R at org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)
[8/14/11 15:00:13:436 AST] 00000029 SystemErr R at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
[8/14/11 15:00:13:436 AST] 00000029 SystemErr R at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
[8/14/11 15:00:13:436 AST] 00000029 SystemErr R at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
[8/14/11 15:00:13:436 AST] 00000029 SystemErr R at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
[8/14/11 15:00:13:436 AST] 00000029 SystemErr R at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
[8/14/11 15:00:13:436 AST] 00000029 SystemErr R at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
[8/14/11 15:00:13:436 AST] 00000029 SystemErr R at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
[8/14/11 15:00:13:436 AST] 00000029 SystemErr R at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
[8/14/11 15:00:13:436 AST] 00000029 SystemErr R at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
[8/14/11 15:00:13:436 AST] 00000029 SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1068)
[8/14/11 15:00:13:436 AST] 00000029 SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1009)
[8/14/11 15:00:13:436 AST] 00000029 SystemErr R at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:145)
[8/14/11 15:00:13:436 AST] 00000029 SystemErr R at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
[8/14/11 15:00:13:436 AST] 00000029 SystemErr R at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
[8/14/11 15:00:13:436 AST] 00000029 SystemErr R at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
[8/14/11 15:00:13:436 AST] 00000029 SystemErr R at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
[8/14/11 15:00:13:436 AST] 00000029 SystemErr R at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
[8/14/11 15:00:13:436 AST] 00000029 SystemErr R at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:771)
[8/14/11 15:00:13:436 AST] 00000029 SystemErr R at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:679)
[8/14/11 15:00:13:436 AST] 00000029 SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:539)
[8/14/11 15:00:13:436 AST] 00000029 SystemErr R at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
[8/14/11 15:00:13:436 AST] 00000029 SystemErr R at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:90)
[8/14/11 15:00:13:436 AST] 00000029 SystemErr R at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:744)
[8/14/11 15:00:13:436 AST] 00000029 SystemErr R at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1455)
[8/14/11 15:00:13:436 AST] 00000029 SystemErr R at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:115)
[8/14/11 15:00:13:436 AST] 00000029 SystemErr R at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:454)
[8/14/11 15:00:13:436 AST] 00000029 SystemErr R at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:383)
[8/14/11 15:00:13:436 AST] 00000029 SystemErr R at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:102)
[8/14/11 15:00:13:436 AST] 00000029 SystemErr R at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
[8/14/11 15:00:13:436 AST] 00000029 SystemErr R at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
[8/14/11 15:00:13:436 AST] 00000029 SystemErr R at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
[8/14/11 15:00:13:436 AST] 00000029 SystemErr R at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
[8/14/11 15:00:13:436 AST] 00000029 SystemErr R at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:195)
[8/14/11 15:00:13:436 AST] 00000029 SystemErr R at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:743)
[8/14/11 15:00:13:436 AST] 00000029 SystemErr R at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
[8/14/11 15:00:13:436 AST] 00000029 SystemErr R at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473)



line 1358 in CreateCorrespondenceAction.java is


the strange thing that these parameters not null as this:
>>>>>>>>>>>>>>>>>>>>assignmentsVO.getAssignedToId() : 121
>>>>>>>>>>>>>>>>>>>>mailbox : CREATE_CORRESPONDENCE
and i am trying to print statement to log in checkUser method in adminManagementDelegate class; no statement in the log. this is the method:



please any help?
Omar Mohaidat
Ranch Hand

Joined: Jan 16, 2008
Posts: 34
any update???
Nam Ha
Ranch Hand

Joined: Aug 05, 2011
Posts: 50

the strange thing that these parameters not null as this:
>>>>>>>>>>>>>>>>>>>>assignmentsVO.getAssignedToId() : 121
>>>>>>>>>>>>>>>>>>>>mailbox : CREATE_CORRESPONDENCE
and i am trying to print statement to log in checkUser method in adminManagementDelegate class; no statement in the log. this is the method:


So the object adminManagementDelegate is possibly null. Try to check it again.


Java Object Creation
Omar Mohaidat
Ranch Hand

Joined: Jan 16, 2008
Posts: 34
Hi Nam,

thanks for your response...there is missing block to define this object on configuration file...the problem solved.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.lang.NullPointerException in action class
 
Similar Threads
Custom Validation Messages - advanced
Hibernate in RAD 7 on WAS 6.1 server. getting asm.jar related error
getting the Duplicate home name Exception while installing application
Problem in Starting the WAS server
Uncaught exception thrown in one of the service methods of the servlet