Myeclipse中debug Web项目时,出现Edit the Source lookup path

一、问题描述和显示:

Myeclipse中debug Web项目时,出现Edit the Source lookup path

 

二、出现错误的根本原因:

没有该类的source文件,DispatcherServlet属于org.springframework.web.servlet.DispatcherServlet

Myeclipse中debug Web项目时,出现Edit the Source lookup path

必须引入spring-webmvc-4.3.3.RELEASE-sources.jar

三、解决办法

(1)下载缺少的源码包。

下载地址:http://repo.spring.io/release/org/springframework/spring/

下载并解压,打开libs目录,找到source文件。  Myeclipse中debug Web项目时,出现Edit the Source lookup path

Myeclipse中debug Web项目时,出现Edit the Source lookup path

(2)回到debug界面,选择Edit the Source lookup path

Myeclipse中debug Web项目时,出现Edit the Source lookup path

Myeclipse中debug Web项目时,出现Edit the Source lookup path

 

Myeclipse中debug Web项目时,出现Edit the Source lookup path

点击打开,导入jar文件,点击ok,即可。

(3)此时包已经导入,有可能只是闪烁一下,并未生效,此时,要关闭debug,关闭服务器,把web项目从Tomcat中删除,重新deploy部署,再次debug项目。

注意:步骤2中的3.选择下载的source文件jar包,如果项目中已经buildpath,在web app libraries中,可以选择Java Project,选择对应的项目,按确定。因为项目中已经有源码包,如果没有,就需要从外部引入。