简体   繁体   English

无法在Eclipse和Tomcat中创建断点

[英]Unable to create a breakpoint in Eclipse and Tomcat

Since yesterday, I get a strange error message when I start my Tomcat (6.0.35) under Eclipse Juno (build 20120614-1722): 从昨天开始,当我在Eclipse Juno(内部版本20120614-1722)下启动Tomcat(6.0.35)时,收到一条奇怪的错误消息:

在此处输入图片说明

Among the things I tried in order to get rid of the error: 为了消除错误,我尝试执行以下操作:

  • Check in Preferences -> Java -> Compiler if all "Classfile Generation" checkboxes where checked. 如果所有“类文件生成”复选框都被选中,则在首选项-> Java->编译器中选中。 I did that for both general preferences and project preference 我这样做是出于一般偏好和项目偏好
  • Uncheck them, build, check them build again (found on another question) 取消选中它们,进行构建,然后再次对其进行构建(在另一个问题上找到)
  • Add org.eclipse.jdt.core.compiler.debug.lineNumber=generate to my .settings/org.eclipse.jdt.core.prefs file org.eclipse.jdt.core.compiler.debug.lineNumber=generate添加到我的.settings/org.eclipse.jdt.core.prefs文件中
  • Use a new CVS checkout (same symptoms) 使用新的CVS结帐(相同的症状)

And now, I don't know what to do anymore. 而现在,我不知道该怎么办了。 The problem is really stopping me from get anything done. 问题实际上是阻止我完成任何事情。 I can't work anymore. 我不能工作了

Crazy is: the problem doesn't happen on every class, only on some of them. 疯狂的是:问题并非在每堂课上都发生,只在其中一部分上发生。 Neither does it happen on my other Eclipse projects. 在我的其他Eclipse项目中也没有发生。 And it didn't happen before yesterday, even if I can't remeber having done anything weird. 即使昨天我做不出奇怪的事情,也没有在昨天之前发生。 Actually, I have never seen a problem like this in almost 10 years I'm using Eclipse... 实际上,在使用Eclipse的近十年中,我从未见过这样的问题……

If you have any idea, I would be really grateful... 如果您有任何想法,我将不胜感激。

Edit: 编辑:

I also tried to ignore the message and go on with my tests: If I create another breakpoint upstream from my problematic class, when I enter this problematic class, it tries to open a $Proxy132 class, which means it actually opens an empty page, with a source not found message 我还尝试忽略该消息并继续进行测试:如果我在有问题的类的上游创建另一个断点,则当我输入有问题的类时,它会尝试打开$Proxy132类,这意味着它实际上打开了一个空白页,带有source not found消息

Whenever I would see this kind of message in Eclipse Helios it was because the compile step (Ant in my case) was not set to include debug information. 每当我在Eclipse Helios中看到这种消息时,都是因为未将编译步骤(在我的情况下为Ant)设置为包括调试信息。 When using Ant, we had a build.xml file that had a flag stating debug="true". 使用Ant时,我们有一个build.xml文件,该文件带有一个标志,指示debug =“ true”。 This would be just a higher-level way of setting the "-g" parameter to javac. 这只是将“ -g”参数设置为javac的高级方法。 Once I set my debug flag to "true", the "-g" option would be sent to the compiler and the source code would build with line number information included. 将调试标志设置为“ true”后,“-g”选项将发送到编译器,并且将使用包含行号信息的源代码进行构建。 This had to be done on all Java files, so if you have modules that aren't compiled automatically as part of a bigger Java process, you will need to make sure those flags get sent to the compiler in those modules as well. 这必须在所有Java文件上完成,因此,如果您的模块不是作为较大的Java进程的一部分自动编译的,则还需要确保将这些标志也发送到这些模块中的编译器。 Basically, everywhere you need to debug has to have the "-g" flag set when compiling it. 基本上,任何需要调试的地方在编译时都必须设置“ -g”标志。 Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM