STRUTS2 Error: Java.lang.NullPointerException:Source must not being null

Source: Internet
Author: User

There is an error in using Strut2+ajax for asynchronous uploads today, the console does not print information, and the AJAX callback function returns the following information, presumably the meaning of a null pointer.
The input name value of the upload is actually the result of an inconsistency with the action variable name. Input name is myfile, the variable is myfile, and the case of a letter is caused by an error! Watch this place!

HTTP Status 500-

type Exception Report

message

Description The server encountered an internal error (), prevented it from fulfilling this request.

Exception

Java.lang.NullPointerException:Source must not being null
Org.apache.commons.io.FileUtils.copyFile (fileutils.java:761)
Org.apache.commons.io.FileUtils.copyFile (fileutils.java:731)
Com.etoak.action.UploadAction.execute (uploadaction.java:44)
SUN.REFLECT.NATIVEMETHODACCESSORIMPL.INVOKE0 (Native Method)
Sun.reflect.NativeMethodAccessorImpl.invoke (nativemethodaccessorimpl.java:57)
Sun.reflect.DelegatingMethodAccessorImpl.invoke (delegatingmethodaccessorimpl.java:43)
Java.lang.reflect.Method.invoke (method.java:606)
Com.opensymphony.xwork2.DefaultActionInvocation.invokeAction (defaultactioninvocation.java:450)
Com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly (defaultactioninvocation.java:289)
Com.opensymphony.xwork2.DefaultActionInvocation.invoke (defaultactioninvocation.java:252)
Org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept (debugginginterceptor.java:256)
Com.opensymphony.xwork2.DefaultActionInvocation.invoke (defaultactioninvocation.java:246)
Com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept (defaultworkflowinterceptor.java:167 )
Com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept (methodfilterinterceptor.java:98)
Com.opensymphony.xwork2.DefaultActionInvocation.invoke (defaultactioninvocation.java:246)
Com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept (validationinterceptor.java:265)
Org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept ( annotationvalidationinterceptor.java:68)
Com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept (methodfilterinterceptor.java:98)
Com.opensymphony.xwork2.DefaultActionInvocation.invoke (defaultactioninvocation.java:246)
Com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept (conversionerrorinterceptor.java:138)
Com.opensymphony.xwork2.DefaultActionInvocation.invoke (defaultactioninvocation.java:246)
Com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept (parametersinterceptor.java:239)
Com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept (methodfilterinterceptor.java:98)
Com.opensymphony.xwork2.DefaultActionInvocation.invoke (defaultactioninvocation.java:246)
Com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept (parametersinterceptor.java:239)
Com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept (methodfilterinterceptor.java:98)
Com.opensymphony.xwork2.DefaultActionInvocation.invoke (defaultactioninvocation.java:246)
Com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept (staticparametersinterceptor.java:191 )
Com.opensymphony.xwork2.DefaultActionInvocation.invoke (defaultactioninvocation.java:246)
Org.apache.struts2.interceptor.MultiselectInterceptor.intercept (multiselectinterceptor.java:73)
Com.opensymphony.xwork2.DefaultActionInvocation.invoke (defaultactioninvocation.java:246)
Org.apache.struts2.interceptor.CheckboxInterceptor.intercept (checkboxinterceptor.java:91)
Com.opensymphony.xwork2.DefaultActionInvocation.invoke (defaultactioninvocation.java:246)
Org.apache.struts2.interceptor.FileUploadInterceptor.intercept (fileuploadinterceptor.java:325)
Com.opensymphony.xwork2.DefaultActionInvocation.invoke (defaultactioninvocation.java:246)
Com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept (modeldriveninterceptor.java:100)
Com.opensymphony.xwork2.DefaultActionInvocation.invoke (defaultactioninvocation.java:246)
Com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept (Scopedmodeldriveninterceptor.java : 141)
Com.opensymphony.xwork2.DefaultActionInvocation.invoke (defaultactioninvocation.java:246)
Com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept (chaininginterceptor.java:145)
Com.opensymphony.xwork2.DefaultActionInvocation.invoke (defaultactioninvocation.java:246)
Com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept (prepareinterceptor.java:171)
Com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept (methodfilterinterceptor.java:98)
Com.opensymphony.xwork2.DefaultActionInvocation.invoke (defaultactioninvocation.java:246)
Com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept (i18ninterceptor.java:161)
Com.opensymphony.xwork2.DefaultActionInvocation.invoke (defaultactioninvocation.java:246)
Org.apache.struts2.interceptor.ServletConfigInterceptor.intercept (servletconfiginterceptor.java:164)
Com.opensymphony.xwork2.DefaultActionInvocation.invoke (defaultactioninvocation.java:246)
Com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept (aliasinterceptor.java:193)
Com.opensymphony.xwork2.DefaultActionInvocation.invoke (defaultactioninvocation.java:246)
Com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept (exceptionmappinginterceptor.java:189 )
Com.opensymphony.xwork2.DefaultActionInvocation.invoke (defaultactioninvocation.java:246)
Org.apache.struts2.impl.StrutsActionProxy.execute (strutsactionproxy.java:54)
Org.apache.struts2.dispatcher.Dispatcher.serviceAction (dispatcher.java:563)
Org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction (executeoperations.java:77)
Org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter ( STRUTSPREPAREANDEXECUTEFILTER.JAVA:99)

Note The full stack trace of the root cause are available in the Apache tomcat/7.0.6 logs.

Apache tomcat/7.0.6

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

STRUTS2 Error: Java.lang.NullPointerException:Source must not being null

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.