How use DEBUG with Eclipse + GlassFish 3?

2019-07-15 02:56发布

问题:

This is a thing that I really don't understand why doesn't work sometimes and sometimes it does. And this is freaking me out! I need help with it, please.

I have Eclipse Juno Java EE x86_64 with GlassFish ( version glassfish-3.1.2.2) in a JSF project, sometimes I need debug my code, so I start Eclipse, Debug on Server then set my break points. Then I go to my page, do the operations that the user would do in my project and when the BreakPoints should be activated, nothing happens, eclipse just pop ups but nothing more.

And the more weird is that sometimes this procedure works and most of all, it don't.. I really need to know what is happening here. I must be my settings or something else, but I know what it is..

My debug tab:

, I could bet that the problem is that the debug is referring to "localhost(1)" as server but I don't have any "localhost(1)", just "localhost", as you guys can see here:

Why is creating another localhost ? This is related why my debug dont works correctly ?

回答1:

For those who are having this issue, I was having this problem, until I noticed I was using JDK 1.7, so I change my JDK to 1.6. This suggestion works for me, I downloaded the Eclipse Juno, uninstalled JDK 1.7 with Revo Uninstaller (to be sure that Java would be fully removed from my computer to avoid any complication with it) and installed JDK 1.6 with Glassfish 3.1.2, and now it works fine! Hell ya! =] Thank you guys!