开发者社区> 问答> 正文

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

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> 



展开
收起
爱吃鱼的程序员 2020-06-14 21:20:09 579 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

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

    2020-06-14 21:20:24
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
Spring Cloud Alibaba - 重新定义 Java Cloud-Native 立即下载
The Reactive Cloud Native Arch 立即下载
JAVA开发手册1.5.0 立即下载