在Myeclipse buildpath 加server lib (server runtime)/项目导入时报错:The import javax.servlet.http.HttpServletRequest cannot be resolved
来源于:http://blog.csdn.net/dingqinghu/article/details/8805922
http://yl-fighting.iteye.com/blog/1409468
使用Myeclipse,将eclipse下的工程复制过来后,发现提示Tomcat 7.0 unbound。缺少Server Runtime。
解决方法如下:
1,File->New->Other->Server->Server(注意在new时,需要勾上Show All Wizards),下一步,选择Apache,Tomcat v7.0 Server,点击finish。
2,项目右键->Properties->Java Build Path->Libraries->Add Library->Server Runtime(MyEclipse incompatible)->next->Tomcat v7.0 Server->Tomcat v7.0 Server
即可。
项目导入时报错:The import javax.servlet.http.HttpServletRequest cannot be resolved
Error:
The import javax.servlet cannot be resolved
The import javax.servlet.http.HttpServletRequest cannot be resolved
Description:
我们经常会把别人的项目copy到自己这里进行二次开发或者参考,有的时候会发生上面的错误,
即eclipse项目里我们导入的项目里提示HttpServletRequest 不能引用,会伴随头疼的小红叉出现。
Accuse:
具体原因是我们工程里面web-inf/lib目录下少了相应的包:Package javax.servlet.http引起的;
通俗且确切的讲就是缺少TOMCAT_HOME\lib下的servlet-api.jar。
我导入别人的项目,在别人的机器上他配置了Server,一般都是tomcat,而在拷贝的过程中Server的那些library是不会随项目一起拷贝过来的,除非别人把tomcat的library已经拷贝到WEB-INF\lib下了。
Action:
Project -> Properties -> Java Build Path -> Add Library -> Server Runtime -> next -> 选择你的Server -> Finish
在Myeclipse buildpath 加server lib (server runtime)/项目导入时报错:The import javax.servlet.http.HttpServletRequest cannot be resolved的更多相关文章
- 在Myeclipse buildpath 加server lib
把eclipse下的工程复制过来后,发现缺少Server Runtime.本想直接在buildpath里加lib,在Myeclipse里找了一圈,恁是没发现在哪里可以添加,虽然在preference里 ...
- myeclipse 项目运行时报错:运行项目时报错:Could not publish server configuration for Tomcat v6.0 Server at localhost. Multiple Contexts have a"/"
1.先去E:\PLZT\workspace\.metadata\.plugins\org.eclipse.wst.server.core.sever.xml看里面是否存在两个配置是的话删除一个重启服务 ...
- SQL Server management studio使用sa连接时报错与伺服器的连接已成功,但在登入程序是发生错误
使用Sql Server management studio的sa用户连接数据库时,报如下错误 解决方法: 1.使用windows验证登录 2.右键点击连接,点击属性,点击安全性,选择混合验证 3.重 ...
- Myeclipse开发环境下文件中出现的提示错误与解决方法:The import javax.servlet cannot be resolved?
1.开发工具:MyEclipse 2.右击项目 >> Build Path >> Add External Archives (Tomcat >> li ...
- mvc EF框架中,加载外键对象序列化对象时报错 序列化类型为XX的对象时检测到循环引用
Newtonsoft.Json.dll 或者通过->工具->库程序包管理工具->NuGet管理包->联机 输入Newtonsoft或者json.net Newtonsoft.J ...
- 样式加载不出来,浏览器控制台报错:Resource interpreted as Stylesheet but transferred with MIME type text/html
写登录的时候出现的问题,样式时好时坏,浏览器控制台看到的信息是: Uncaught SyntaxError: Unexpected token <Resource interpreted as ...
- myEclipse 导入maven项目时报错
1.先右击项目,build Path 查看是否是某个JAR出了错.去掉无用的JAR 以及修改对应的JDK版本 2.检查src源文件,查看是否是源文件出了错.发现,还真的是 导入的包上面,报错:The ...
- The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path(Myeclipse添加Server Library)
网上找练习的项目导入到myeclipse项目发现每个JSP 出现错误The superclass "javax.servlet.http.HttpServlet" was not ...
- com.sun.xml.internal.ws.server.ServerRtException: Server Runtime Error: java.net.BindException: Cannot assign requested address: bind
在发布 web service 时报错: Endpoint.publish(publishAddress, hl7MessageReveiver); com.sun.xml.internal.ws.s ...
随机推荐
- MPP 架构数据库
Greenplum是一种基于postgresql的分布式数据库.其采用shared nothing架构(MPP),主机,操作系统,内存,存储都是自我控制的,不存在共享.也就是每个节点都是一个单独的数据 ...
- μc/osⅡ简化版任务机制浅析
去年玩过一阵单片机,也用过μc/osⅡ的系统,但是就理解内核而言,整个即时操作系统还是过于冗杂,很多的东西很不适合初学者来动手操作,多方查找我发现他的任务机制可以进行功能的进一步简化, 可以类似于任务 ...
- 【hibernate】<第一节>hibernate简单入门
所需工具: ide:eclipse or myeclipse jdk:1.7 jar包:hibernate-distribution-3.6.0.Final 和对应mysql的驱动类(对应jar包如图 ...
- Android Studio系列教程三--快捷键
Android Studio系列教程三--快捷键 2014 年 12 月 09 日 DevTools 本文为个人原创,欢迎转载,但请务必在明显位置注明出处!http://stormzhang.com/ ...
- Android的Style的使用
Style个人理解就是view的一些属性的集合,那么一系列view(例如TextVIew),只要是要该style那么就都有相同的内容,如 文字的大少,颜色等,方便修改 首先最基本的使用,多个textV ...
- js中接口的声明与实现
实现接口,必须实现接口里的所有方法. function Interface(name,fns){//声明一个接口类 this.name = name; th ...
- C语言错误: HEAP CORRUPTION DETECTED
程序源代码: //写文件两种方式(文本文件和二进制文件) #define _CRT_SECURE_NO_WARNINGS #include<stdio.h> #include<std ...
- jquery-lazyload延迟加载图片 及 加载顺序 bug 修复
jquery-lazyload延迟加载图片 代码修改片段 function update() { var counter = 0; /**fix by weiyj start***/ elemen ...
- InfluxDb系列:几个关键概念(主要是和关系数据库做对比)
https://docs.influxdata.com/influxdb/v0.9/concepts/key_concepts/ #,measurement,就相当于关系数据库中的table,他就是 ...
- Java系列: 关于LinkedList的 ListIterator的add和remove
static void testListIteratorAdd(){ LinkedList<String> strList = new LinkedList<String>() ...