struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maurizio Cucchiara <mcucchi...@apache.org>
Subject Re: [S2] Random java.lang.reflect.InvocationTargetException and java.lang.NullPointerException error??
Date Wed, 07 Sep 2011 07:28:24 GMT
Did you define for your class either the setter and the getter
accessors for the xactionActivity object?
Also, could you see the source code of your action class?

Maurizio Cucchiara



On 6 September 2011 22:39, Burton Rhodes <burtonrhodes@gmail.com> wrote:
> I was wondering if anyone can help track down this error that I'm
> getting.  Unfortunately, I cannot reproduce the error with any
> consistency - just sort of appears to happen randomly.  My debug log &
> stack trace is below.  It happens only when a user submits this one
> form that may (or may not) contain a file - along with other
> information.  I get the error in the "validateUpdate()" function of
> the action and it appears that the "model" of the action
> (xactionActivity) is null.  How can the model "sometimes" be null if
> it's set via the form?  I have included my action setup thinking it
> may have something to do with my interceptors?  The user never sees
> the error on the webpage, it just shows up in the logs.  I'm really at
> a loss for this one.  Let me know if I need to share more information
> to help.  Any ideas are appreciated....
>
>
> -------------- ACTION SETUP -------
> <action name="XactionActivityGeneric_update"
> class="com.afs.web.action.xaction.XactionActivityGenericAction"
> method="update">
>
>     <interceptor-ref name="fileUpload">
>          <!-- 5 MB limit -->
>          <param name="maximumSize">5242880</param>
>     </interceptor-ref>
>
>     <!-- Set no-cache headers -->
>     <interceptor-ref name="noCacheInterceptor" />
>
>     <!-- Do some security stuff here -->
>     <interceptor-ref name="sessionInterceptor" />
>
>     <interceptor-ref name="paramsPrepareParamsStack">
>          <param name="exception.logEnabled">true</param>
>          <param name="exception.logLevel">ERROR</param>
>     </interceptor-ref>
>
>     <result>/struts/xaction/xactionActivityGenericAddEdit_popup.jsp</result>
>     <result name="input">/struts/xaction/xactionActivityGenericAddEdit_popup.jsp</result>
>     <result name="error">/struts/common/error_popup.jsp</result>
> </action>
>
> --------------- LOG -----------------------
> INFO : --XactionActivityGenericAction:validateUpdate() function...
> Sep 06, 11:07:10 (XactionActivityGenericAction.java:142)
> INFO : AppUser: rosemary
> Sep 06, 11:07:10 (XactionActivityGenericAction.java:143)
> ###!!!### Log File Below states xactionActivity=null, why??  ###!!!###
> INFO : this.toString(): XactionActivityGenericAction [xactionId=0,
> xactionActivityId=0, xactionActivityTypeId=0, xactionActivity=null,
> fileNameNoExt=null, fileExt=null, newFile1=null,
> newFile1FileName=null, newFile1ContentType=null,
> newFile1ChangeName=null, callBackFunction=null, closeWindow=false,
> appUserIdAuthor=0, user=com.afs.entity.AppUser@2d]
> Sep 06, 11:07:10 (CommonsLogger.java:38)
> ERROR:
> java.lang.reflect.InvocationTargetException
>        at sun.reflect.GeneratedMethodAccessor905.invoke(Unknown Source)
>        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>        at java.lang.reflect.Method.invoke(Method.java:616)
>        at com.opensymphony.xwork2.interceptor.PrefixMethodInvocationUtil.invokePrefixMethod(PrefixMethodInvocationUtil.java:121)
>        at com.opensymphony.xwork2.validator.ValidationInterceptor.doBeforeInvocation(ValidationInterceptor.java:236)
>        at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:261)
>        at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
>        at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
>        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
>        at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:133)
>        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
>        at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)
>        at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
>        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
>        at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)
>        at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
>        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
>        at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:190)
>        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
>        at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:314)
>        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
>        at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)
>        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
>        at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145)
>        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
>        at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171)
>        at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
>        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
>        at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
>        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
>        at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)
>        at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
>        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
>        at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)
>        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
>        at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)
>        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
>        at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176)
>        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
>        at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:190)
>        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
>        at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187)
>        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
>        at com.afs.web.interceptor.SessionInterceptor.intercept(SessionInterceptor.java:57)
>        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
>        at com.afs.web.interceptor.NoCacheInterceptor.intercept(NoCacheInterceptor.java:31)
>        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
>        at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:314)
>        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
>        at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
>        at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:498)
>        at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
>        at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)
>        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:368)
>        at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
>        at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
>        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
>        at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97)
>        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
>        at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:100)
>        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
>        at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:78)
>        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
>        at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:119)
>        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
>        at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
>        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
>        at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:35)
>        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
>        at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:187)
>        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
>        at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
>        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
>        at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79)
>        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
>        at org.springframework.security.web.session.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:109)
>        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
>        at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:169)
>        at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
>        at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
>        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>        at org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:113)
>        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
>        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:465)
>        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
>        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
>        at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
>        at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291)
>        at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:769)
>        at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:698)
>        at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:891)
>        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
>        at java.lang.Thread.run(Thread.java:636)
> Caused by: java.lang.NullPointerException
>        at com.afs.web.action.xaction.XactionActivityGenericAction.xactionActivityGenericToString(XactionActivityGenericAction.java:161)
>        at com.afs.web.action.xaction.XactionActivityGenericAction.validateUpdate(XactionActivityGenericAction.java:144)
>        ... 102 more
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message