在跑一个网上的java调天气的接口报错?报错-问答-阿里云开发者社区-阿里云

开发者社区> 问答> 正文

在跑一个网上的java调天气的接口报错?报错

爱吃鱼的程序员 2020-06-14 21:20:09 84

ervlet.service() for servlet [action] in context with path [/WeatherAIp] threw exception [Servlet execution threw an exception] with root cause java.lang.Error: Unresolved compilation problems: The type javax.servlet.http.HttpServletRequest cannot be resolved. It is indirectly referenced from required .class files The type javax.servlet.http.HttpServletResponse cannot be resolved. It is indirectly referenced from required .class files The type javax.servlet.ServletResponse cannot be resolved. It is indirectly referenced from required .class files The type javax.servlet.ServletRequest cannot be resolved. It is indirectly referenced from required .class files The import javax.servlet.http.HttpServletRequest cannot be resolved The import javax.servlet.http.HttpServletResponse cannot be resolved HttpServletRequest cannot be resolved to a type HttpServletResponse cannot be resolved to a type HttpServletRequest cannot be resolved to a type HttpServletResponse cannot be resolved to a type HttpServletRequest cannot be resolved to a type HttpServletResponse cannot be resolved to a type

at com.shd.struts1.action.ObtainIpAction.<init>(ObtainIpAction.java:1)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at org.apache.struts.chain.commands.util.ClassUtils.getApplicationInstance(ClassUtils.java:71)
at org.apache.struts.chain.commands.servlet.CreateAction.createAction(CreateAction.java:98)
at org.apache.struts.chain.commands.servlet.CreateAction.getAction(CreateAction.java:68)
at org.apache.struts.chain.commands.AbstractCreateAction.execute(AbstractCreateAction.java:90)
at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)</pre> 



Java
分享到
取消 提交回答
全部回答(1)
  • 爱吃鱼的程序员
    2020-06-14 21:20:24

    <preclass="recommend-textmb-10">Thetypejavax.servlet.http.HttpServletRequestcannotberesolved.如果在MyEclipse中遇到这种情况,也就是HttpServletRequest报红叉的时候,这样做1、右键工程找到buildpath项2、找到AddLibraries3、点击myEclipseLibraries,Next4、添加JavaEE5OK

    0 0
开发与运维
使用钉钉扫一扫加入圈子
+ 订阅

集结各类场景实战经验,助你开发运维畅行无忧

推荐文章
相似问题
推荐课程