0.环境:

  新装win8.1系统,Tomcat配置无误。

1.错误:

  项目中某一.jps页面忽然出现错误,鼠标点上去为:The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path.

忽视错误,在Eclipse下启动tomcat的时候,报错为:Eclipse下启动tomcat报错:The archive: D:/Program Files/apache-tomcat-7.0.52/bin/bootstrap.jar which is referenced by the classpath, does not exist.

2.查找原因:

  原本我的Tomcat路径为:D:\Program Files\apache-tomcat-7.0.52\,后来由于重装系统,改为:D:\ProgramFiles\apache-tomcat-7.0.52\,在报错中可以发现是缺少servlet-api.jar,也即tomcat路径问题。

3.尝试解决:

①.  

  1.右键点击项目->build path->configure build path->add library->server runtime->apache tomcat

无果,无法添加。

②.

  1.打开Eclipse中tomcat配置,就是双击server选项卡中的tomcat,然后选择openlaunch configuration,如下图所示:

  2.打开以后会出现如下界面:

  3.如上图所示,将错误路径删除,并保证正确配置tomcat-juli.jar和bootstrap.jar这两个jar包的路径。

无果,修改后仍启动不了Tomcat。

③.  

  1.在server选项卡中删除所有server,新建tomcat。

无果,无法新建。

④.

  1.退出 eclipse

  2.到[工程目录下]/.metadata/.plugins/org.eclipse.core.runtime

  3.把org.eclipse.wst.server.core.prefs和 org.eclipse.jst.server.tomcat.core.prefs这两个文件去掉

  4.重启eclipse

无果,没找到org.eclipse.wst.server.core.prefs和 org.eclipse.jst.server.tomcat.core.prefs这两个文件。

⑤.

  1.在Eclipse中,Window-->preference --> servers --> runtime --> environments --> 全部删除

  2.Add-->Browse-->选择本地tomcat文件夹所在位置-->确定 --> finish-->OK

成功!

4.结论:

  实际上是preference中路径错误的问题,直接删除掉server再重建的方法不行。

以后在移动相关资源或者依赖资源的时候会对原有的依赖它的项目产生影响。尽量将自己的IDE和相关的环境固定,少做更改,减少那些隐藏的错误出现的几率。

5.后续疑问:(未解)

  重装系统后Tomcat、Eclipse都是重新解压配置的,为何Eclipse会记住重装系统前的路径?

项目忽然出现 The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path 解决方法的更多相关文章

  1. The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path 解决方法

    项目忽然出现 The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Pat ...

  2. 项目出现 The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path 解决方法

    1. The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path ①项 ...

  3. java eclipse maven The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path 解决方法

    在eclipse 中使用maven 创建java web项目,启动服务器遇到提示:The superclass "javax.servlet.http.HttpServlet" w ...

  4. 新建maven指定jdk版本-eclipse新建maven项目报错The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path的解决方案

    具体表现为: 使用Eclipse+Maven建立了一个Javaweb工程,JSP页面顶端出现“红色”的报错信息:The superclass "javax.servlet.http.Http ...

  5. 使用maven创建项目时报错The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

    Description Resource Path Location Type The superclass "javax.servlet.http.HttpServlet" wa ...

  6. The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path 解决办法

    ♦  未在 Java构建路径中 找到父类 "javax.servlet.http.HttpServlet" ♦ 解决办法: 项目右击 → Build Path → 右侧 Add L ...

  7. web项目jsp出现The superclass javax.servlet.http.HttpServlet was not found on the Java Build Path错误

    原因是Javaweb工程类中没有添加Tomcat运行时相关类导致. 解决方式如下:出错的文件---->>build path---->>config build path--- ...

  8. 新建jsp文件,The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path错误解决方法

    新建一个jsp文件后,有一个错误,The superclass "javax.servlet.http.HttpServlet" was not found on the Java ...

  9. HttpServletRequest cannot be resolved to a type The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

    HttpServletRequest cannot be resolved to a type The superclass "javax.servlet.http.HttpServlet& ...

随机推荐

  1. discuz安装

    1.upload文件复制到根目录下,访问,安装 2.数据库需要提前建好 3.数据库地址默认是localhost,我安装时是127.0.0.1 4.最好在本地安装时,配置本地域名和线上域名一样,不然迁移 ...

  2. __weak

    需要使用弱引用的 三种情况: 1. 如果这个block不被持有,那么你完全没有必要使用__weak 2. 如果被持有了,那么__weak是必然的 3. 如果在多线程并发的情况下,不仅要使用__weak ...

  3. LeetCode Verify Preorder Serialization of a Binary Tree

    原题链接在这里:https://leetcode.com/problems/verify-preorder-serialization-of-a-binary-tree/ 题目: One way to ...

  4. js 十分精确身份证验证

    checkIdcard:function (idcard) { // 1 "验证通过!", 0 //身份证号码校验错误 var Errors = new Array( " ...

  5. mongoDb(2)聚合

    1.mongodb的聚合是有专门的一个方法的.

  6. Java Servlet(五):GenericServlet与Servlet、HttpServlet之间的关系(jdk7+tomcat7+eclipse)

    本篇主要记录下,对GenericServlet的作用理解,及其与Servlet/HttpServlet之间的关系. 示例完成业务: 1.新建一个login.jsp页面,要求改页面能输入username ...

  7. Linux:安装OpenSSH-Server E:Package openssh-server has no installation candidate

    $sduo apt-get install openssh-server Reading package lists… Done Building dependency tree Reading st ...

  8. Apache和IIS服务器共存问题--来自网上内容

    1.apache 主要支持PHP   IIS 主要支持asp  静态的网页他们都支持入htm,端口冲突的话你可以更改其中一个服务器的端口来实现端口的避让,IIS在右击“我的电脑”“管理”“服务和应用程 ...

  9. java-Filter过滤器

    特点 过滤浏览器请求的java程序 处于浏览器和被请求的资源之间 可以有多个过滤器组成过滤链 有配置的顺序决定先后顺序 常用语设置请求和响应的字符集 API doFilter()执行过滤 Filter ...

  10. [原创]java WEB学习笔记95:Hibernate 目录

    本博客的目的:①总结自己的学习过程,相当于学习笔记 ②将自己的经验分享给大家,相互学习,互相交流,不可商用 内容难免出现问题,欢迎指正,交流,探讨,可以留言,也可以通过以下方式联系. 本人互联网技术爱 ...