问题描述
java.lang.NullPointerExceptionatjava.io.FileInputStream.<init>(FileInputStream.java:103)atcom.yd.action.GameBackAction.addGame(GameBackAction.java:44)atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)atjava.lang.reflect.Method.invoke(Method.java:597)atcom.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:440)atcom.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:279)atcom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242)atorg.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:306)atcom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)atorg.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)atorg.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:468)atorg.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:395)atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)atorg.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)atorg.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)atorg.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)atorg.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)atorg.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)atorg.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)atorg.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)atorg.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)atorg.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)atjava.lang.Thread.run(Thread.java:619)2011-3-18:38:27com.opensymphony.xwork2.util.logging.commons.CommonsLoggerinfo信息:Removingfilegame.gamePhoto3upload图像108.jpg2011-3-18:38:27com.opensymphony.xwork2.util.logging.commons.CommonsLoggerinfo信息:Removingfilegame.gamePhoto2upload图像109.jpg2011-3-18:38:27com.opensymphony.xwork2.util.logging.commons.CommonsLoggerinfo信息:RemovingfilegamePhoto1upload图像108.jpg
解决方案
解决方案二:
空指针异常atcom.yd.action.GameBackAction.addGame(GameBackAction.java:44)在你的GameBackAction.java的第44行查看一下
解决方案三:
打个断点跟踪一下你就会明白的
解决方案四:
你用System.out.println()跟踪一下你的Action看看是那步atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)没赋上值
解决方案五:
空指针,没获取到文件啦,是不是页面那里文本输入框的name属性名称不一致
解决方案六:
该回复于2011-03-17 10:26:45被版主删除