OA系统

我用的是  Eclipse j2ee,解决方法是

Uncaught Ext.Error: You're trying to decode an invalid JSON String: <html> <head> <title>Struts Problem Report</title> <style> pre { margin: 0; padding: 0; } </style> </head> <body> <h2>Struts Problem Report</h2> <p> Struts has detected an unhandled exception: </p> <div id="exception-info"> <table> <tr> <td><strong>Messages</strong>:</td> <td> <ol> <li>Unresolved compilation problems: The import javax.servlet.http.HttpServletResponse cannot be resolved HttpServletResponse cannot be resolved to a type HttpServletResponse cannot be resolved to a type HttpServletResponse cannot be resolved to a type HttpServletResponse cannot be resolved to a type </li> <li>Could not instantiate bean class [aspic.oa.action.RandomNumberAction]: Constructor threw exception; nested exception is java.lang.Error: Unresolved compilation problems: The import javax.servlet.http.HttpServletResponse cannot be resolved HttpServletResponse cannot be resolved to a type HttpServletResponse cannot be resolved to a type HttpServletResponse cannot be resolved to a type HttpServletResponse cannot be resolved to a type </li> <li>Error creating bean with name 'aspic.oa.action.RandomNumberAction': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [aspic.oa.action.RandomNumberAction]: Constructor threw exception; nested exception is java.lang.Error: Unresolved compilation problems: The import javax.servlet.http.HttpServletResponse cannot be resolved HttpServletResponse cannot be resolved to a type HttpServletResponse cannot be resolved to a type HttpServletResponse cannot be resolved to a type HttpServletResponse cannot be resolved to a type </li> <li>Unable to instantiate Action, aspic.oa.action.RandomNumberAction, defined for 'getRandNum' in namespace '/'Error creating bean with name 'aspic.oa.action.RandomNumberAction': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [aspic.oa.action.RandomNumberAction]: Constructor threw exception; nested exception is java.lang.Error: Unresolved compilation problems: The import javax.servlet.http.HttpServletResponse cannot be resolved HttpServletResponse cannot be resolved to a type HttpServletResponse cannot be resolved to a type HttpServletResponse cannot be resolved to a type HttpServletResponse cannot be resolved to a type </li> </ol> </td> </tr> <tr> <td><strong>File</strong>:</td> <td>aspic/oa/action/BaseJsonAction.java</td> </tr> <tr> <td><strong>Line number</strong>:</td> <td>9</td> </tr> </table> </div> <div id="stacktraces"> <hr /> <h3>Stacktraces</h3> <div class="stacktrace" style="padding-left: 0em"> <strong>Unable to instantiate Action, aspic.oa.action.RandomNumberAction, defined for 'getRandNum' in namespace '/'Error creating bean with name 'aspic.oa.action.RandomNumberAction': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [aspic.oa.action.RandomNumberAction]: Constructor threw exception; nested exception is java.lang.Error: Unresolved compilation problems: The import javax.servlet.http.HttpServletResponse cannot be resolved HttpServletResponse cannot be resolved to a type HttpServletResponse cannot be resolved to a type HttpServletResponse cannot be resolved to a type HttpServletResponse cannot be resolved to a type </strong> <div> <pre> com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:319) com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:400) com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:194) org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:63) org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39) com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:58) org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:500) org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77) org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929) org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002) org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585) org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312) java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) java.lang.Thread.run(Unknown Source) </pre> </div> </div> <div class="stacktrace" style="padding-left: 2em"> <strong>org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'aspic.oa.action.RandomNumberAction': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [aspic.oa.action.RandomNumberAction]: Constructor threw exception; nested exception is java.lang.Error: Unresolved compilation problems: The import javax.servlet.http.HttpServletResponse cannot be resolved HttpServletResponse cannot be resolved to a type HttpServletResponse cannot be resolved to a type HttpServletResponse cannot be resolved to a type HttpServletResponse cannot be resolved to a type </strong> <div> <pre> org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:288) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1035) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowire(AbstractAutowireCapableBeanFactory.java:339) com.opensymphony.xwork2.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:179) com.opensymphony.xwork2.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:154) com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:150) com.opensymphony.xwork2.ObjectFactory.buildAction(ObjectFactory.java:120) com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:300) com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:400) com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:194) org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:63) org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39) com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:58) org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:500) org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77) org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929) org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002) org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585) org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312) java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) java.lang.Thread.run(Unknown Source) </pre> </div> </div> <div class="stacktrace" style="padding-left: 4em"> <strong>org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [aspic.oa.action.RandomNumberAction]: Constructor threw exception; nested exception is java.lang.Error: Unresolved compilation problems: The import javax.servlet.http.HttpServletResponse cannot be resolved HttpServletResponse cannot be resolved to a type HttpServletResponse cannot be resolved to a type HttpServletResponse cannot be resolved to a type HttpServletResponse cannot be resolved to a type </strong> <div> <pre> org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:162) org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:110) org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:280) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1035) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowire(AbstractAutowireCapableBeanFactory.java:339) com.opensymphony.xwork2.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:179) com.opensymphony.xwork2.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:154) com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:150) com.opensymphony.xwork2.ObjectFactory.buildAction(ObjectFactory.java:120) com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:300) com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:400) com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:194) org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:63) org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39) com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:58) org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:500) org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77) org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929) org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002) org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585) org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312) java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) java.lang.Thread.run(Unknown Source) </pre> </div> </div> <div class="stacktrace" style="padding-left: 6em"> <strong>java.lang.Error: Unresolved compilation problems: The import javax.servlet.http.HttpServletResponse cannot be resolved HttpServletResponse cannot be resolved to a type HttpServletResponse cannot be resolved to a type HttpServletResponse cannot be resolved to a type HttpServletResponse cannot be resolved to a type </strong> <div> <pre> aspic.oa.action.BaseJsonAction.<init>(BaseJsonAction.java:9) aspic.oa.action.RandomNumberAction.<init>(RandomNumberAction.java:10) sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) java.lang.reflect.Constructor.newInstance(Unknown Source) org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147) org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:110) org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:280) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1035) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowire(AbstractAutowireCapableBeanFactory.java:339) com.opensymphony.xwork2.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:179) com.opensymphony.xwork2.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:154) com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:150) com.opensymphony.xwork2.ObjectFactory.buildAction(ObjectFactory.java:120) com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:300) com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:400) com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:194) org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:63) org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39) com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:58) org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:500) org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77) org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929) org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002) org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585) org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312) java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) java.lang.Thread.run(Unknown Source) </pre> </div> </div> </div> <div class="footer"> <hr /> <p> You are seeing this page because development mode is enabled. Development mode, or devMode, enables extra debugging behaviors and reports to assist developers. To disable this mode, set: <pre> struts.devMode=false </pre> in your <code>WEB-INF/classes/struts.properties</code> file. </p> </div> </body> </html>

你可能感兴趣的:(报错,OA)