The type javax.servlet.http.HttpServletRequest cannot be resolved. 解决办法

报错信息:
The type javax.servlet.http.HttpServletRequest cannot be resolved. It is indirectly referenced from 
 required .class files

原因是缺少serverlet的引用库,解决办法:

1.右键工程 -properties->java build path->在java build path 的 libraries tab页中选择 Add external Jars... 按钮

2.找到eclipse的安装目录,我的是在 E:\eclipse4.7\eclipse\plugins,然后搜索 javax.servlet,找到

javax.servlet.jsp_2.2.0.v201112011158.jar

javax.servlet_3.1.0.v201410161800.jar

进行添加即可。

注:每个版本儿的eclipse这两个文件的后缀不一样,我的是 Oxygen.2 Release (4.7.2)

参考自:https://blog.csdn.net/smartzhaomin/article/details/19487907


阅读更多

The type com.sun.star.lang.XEventListener cannot be resolved.

04-12

报错:The type com.sun.star.lang.XEventListener cannot be resolved. It is indirectly referenced from rn required .class filesrn后台报错:rnAllocate exception for servlet convertUtilrnjava.lang.Error: Unresolved compilation problem: rn The type com.sun.star.lang.XEventListener cannot be resolved. It is indirectly referenced from required .class filesrnrn at servlet.ConvertServlet.(ConvertServlet.java:1)rn at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)rn at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)rn at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)rn at java.lang.reflect.Constructor.newInstance(Constructor.java:513)rn at java.lang.Class.newInstance0(Class.java:355)rn at java.lang.Class.newInstance(Class.java:308)rn at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:119)rn at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1061)rn at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:812)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:135)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)rn at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:394)rn at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:284)rn at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:322)rn at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1699)rn at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)rn at java.lang.Thread.run(Thread.java:619)rnrnrn高手帮忙看看哈!

没有更多推荐了,返回首页