使用myEclipse开发JSP时遇到的奇怪问题

 
在MyEclipse中启动Tomcat,并将项目部署之后,在浏览器地址栏中输入 http://localhost/doclib/inex.jsp 进行测试。MyEclipse自动会跳出来一个对话框
This kind of launch is configured to open the Debug perspective when it suspends.Do you want to open this perspective now?
确认以后进入程序调试视图,并且自动跳出来一个叫getNextToken的页面,上面用红色字体写着:
Source not found for Scanner.getNextToken()line:899

在Debug视图中可以复制Exception Stack的内容如下:
Thread [http-8080-Processor24] (Suspended (exception ArrayIndexOutOfBoundsException))
Scanner.getNextToken() line: 899
Parser.parse() line: 8460
Parser.parse(ICompilationUnit, CompilationResult, int, int) line: 8657
Parser.parse(ICompilationUnit, CompilationResult) line: 8622
Parser.dietParse(ICompilationUnit, CompilationResult) line: 7420
Compiler.beginToCompile(ICompilationUnit[]) line: 289
Compiler.compile(ICompilationUnit[]) line: 315
JDTCompiler.generateClass(String[]) line: 404
JDTCompiler(Compiler).compile(boolean, boolean) line: 297
JDTCompiler(Compiler).compile(boolean) line: 276
JDTCompiler(Compiler).compile() line: 264
JspCompilationContext.compile() line: 563
JspServletWrapper.service(HttpServletRequest, HttpServletResponse, boolean) line: 303
JspServlet.serviceJspFile(HttpServletRequest, HttpServletResponse, String, Throwable, boolean) line: 314
JspServlet.service(HttpServletRequest, HttpServletResponse) line: 264
JspServlet(HttpServlet).service(ServletRequest, ServletResponse) line: 802
ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 252
ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 173
StandardWrapperValve.invoke(Request, Response) line: 213
StandardContextValve.invoke(Request, Response) line: 178
StandardHostValve.invoke(Request, Response) line: 126
ErrorReportValve.invoke(Request, Response) line: 105
StandardEngineValve.invoke(Request, Response) line: 107
CoyoteAdapter.service(Request, Response) line: 148
Http11Processor.process(InputStream, OutputStream) line: 869
Http11Protocol$JmxHttp11ConnectionHandler(Http11BaseProtocol$Http11ConnectionHandler).processConnection(TcpConnection, Object[]) line: 664
PoolTcpEndpoint.processSocket(Socket, TcpConnection, Object[]) line: 527
LeaderFollowerWorkerThread.runIt(Object[]) line: 80
ThreadPool$ControlRunnable.run() line: 684
ThreadWithAttributes(Thread).run() line: 595
此时,按下F8继续运行(Resume)的话程序可以继续运行,但是这样比较麻烦。
在网络上也找到了类似的问题:
 
他们解决的方法是降低Tomcat的版本,从5.5降到5.0就可以了。但是我的项目是基于5.5的,一部分工作已经完成。经过研究,发现这其实不是Tomcat的问题,因为如果单独启动Tomcat的话网站运行是正常的。
 
在MyEclipse网站上发现了这篇文章
 
其中的解决方法是
 
This is the ghost breakpoint issue we have seen before, normally using -clean fixes it, but as you mentioned it didn't help. The solution is to create a new workspace and reimport your projects into it. We have been unable to track down why breakpoints are getting set or where they come from, and it happens very infrequently. I've had it happen once to me, and I know 2 other users that had it happen. In all cases a new workspace fixed it and it never came back.
 
而且这种情况是非常罕见的。
 
具体来说,解决的方法是:
 
在磁盘上新建一个目录作为新的工作区( workspace),然后在Eclipse中选择菜单项 File|Switch workspace 切换到新的工作区,将原来的项目导入。再重新启动Tomcat,问题解决。
 
也可以先将 workspace中的全部项目导出,退出eclipse后,删除该 workspace对应目录下的所有内容;然后启动eclipse并导入刚才导出的项目。
 
个人认为:该错误可能是由workspace目录下 .data/.plugins 中的插件出现混乱引起的
 
  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值