When im going to save the file given target path its getting fails to load a file name and server thrown an NullPointerException as well
as java.io.FileInputStream.<init>(Unknown Source) it Exceptions. It unable to catch a File Name
My code is was written like this,
Server thrown an Excetopn to above bold line what is the reason to thrown such exception i really was not getting. If have any
proper solution on that.
Exception is;
Stored file to D:\Monitors\null
Jul 14, 2010 1:46:58 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for
servlet default threw exception
java.lang.NullPointerException
at java.io.FileInputStream.<init>(Unknown Source)
at com.save.SaveFile.saveFile(SaveFile.java:29)
at com.kogent.action.FileActionUpload.uploadFile(FileActionUpload.java:18)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:399)
at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:262)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:213)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:219)