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. 表单验证插件----jquery validation

    1.下载地址:http://jqueryvalidation.org/ 2.使用方法: <script type="text/javascript" src="ht ...

  2. VC6在win7环境下无法添加以及打开现有文件的解决办法

       在VC6.0中使用键盘快捷键或者是文件菜单打开现有文件以及添加文件出现编辑器停止响应,弹出内容为Microsoft(R) Developer Studio已停止工作 Windows正在检查解决该 ...

  3. RDIFramework.NET ━ .NET快速信息化系统开发框架 V2.8 版本━新增岗位管理-WinForm部分

    RDIFramework.NET ━ .NET快速信息化系统开发框架 V2.8 版本 新增岗位管理-WinForm部分 岗位(职位)管理模块主要是针对组织机构的岗位(职位)进行管理,包括:增加.修改. ...

  4. 应该具备的调试技能(java)

    ------Java部分---------- 1. tomcat在eclispe中怎样启动调试模式2. 带有main方法的Java应用程序怎样启动调试模式3. 调试在eclispe中的快捷键 F5 F ...

  5. c# AES加解密并转ASCII码

    using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Sec ...

  6. For,Function,Lazy

    package com.dtgroup.study import scala.io.Source object ForFunctionLazy { def main(args: Array[Strin ...

  7. Python快速建站系列-Part.Three-注册和登录

    |版权声明:本文为博主原创文章,未经博主允许不得转载. 上一个Part已经给TSSS编好了一个简单的Web服务,网页的基础模版也写好了,那从这个Part开始就慢慢增加编写功能. 先写基础功能:注册和登 ...

  8. jquery判断起止时间大小和非空

    //时间判断 function CheckDate() { var startTime = $('#txtTime').val(); //获取当前日期 var start = new Date(sta ...

  9. iOS 开发笔记-AFNetWorking https SSL认证

    一般来讲如果app用了web service , 我们需要防止数据嗅探来保证数据安全.通常的做法是用ssl来连接以防止数据抓包和嗅探 其实这么做的话还是不够的 . 我们还需要防止中间人攻击(不明白的自 ...

  10. inotify+rsync目录实时同步

    两台linux服务器系统CentOS7 一台Apache IP:192.168.155.130(发布文件服务器,也可以叫rsync客户端) 一台nginx IP:192.168.155.131(同步镜 ...