Intellij IDEA 14 Remote Debug ignores breakpoints - java

I'm working with a spring based project in java 1.6. I have a remote debug configuration to local tomcat server which worked without problems. Today I have encountered a problem with it. I place breakpoints in my code but they have not the valid symbol and are ignored while debugging, I have no idea why. I tried to clean/rebuild the project , invalidate cache but no effect. Any ideas?

How do you connect to tomcat procces?
From Intellij debug button, or do you start tomcat manualy, with debug keys in tomcat's proccess?
Are you 100% sure, that this line of code should execute? Maybe it makes sence to log anything on that line of code, so as too see that a problem is definatly in debug-connection?

Related

Intellij break point report Method threw 'java.lang.ClassNotFoundException' exception even the variable exist

Anywhere I break, when I hover on variable or try to evaluate, IntelliJ always report:
Method threw 'java.lang.ClassNotFoundException' exception even the variable exist
I tried to clear cache and restart the IntelliJ as well as refresh Gradle cache and rebuild the app. Nothing work. But the application itself did not crash and runs as usually, so I am pretty sure its Intellij problem. But I can't find any solution online.
Also, the file is a Kotlin file.
First, I forgot to mention, this error came up when I was in JRebel debug mode.
For now, none of the existing solution worked. But I did the following:
1. I upgraded to later version of intellij (2019.3). everything stop running and all sort of error came up.
2. I reverted back to the version I was using (2019.2)
3. then I did rebuild with default debug mode icon (little red bug icon) then with jrebel debug mode icon (rocket with a grey bug). Only Jrebel debug mode have that error message!
I still did not know why jRebel acts like that suddenly, but at least this is a piece of information that may help lead to better solution than what I would have to do now ---- use default Intellij debug mode.... which is very very slow....
So likely you may not even need to take any of the above step, but simply try to build with the Intellij Debug mode to see if it still work so to isolate out that if its a JRebel problem.
Could you please open a JRebel Support ticket and we can then take a closer look at the issue?
You can open a ticket either from the JRebel IDE plugin or by sending an email to support#jrebel.com

Breakpoints not working on IntelliJ Ultimate

I am new to IntelliJ and I am trying to set up environment. I use latest version of IntelliJ and Tomcat. When I make an api request using Postman, the breakpoints on IntelliJ are not being hit. I have configured Tomcat locally and when I run the server in debug mode I do not get any error and the application runs as expected. But I want to debug my application and breakpoints on IntelliJ do not work. Any help will he highly appreciated.
Resolved: I deleted the entire project and set it up from scratch. And this helped.
Thanks everyone for your suggestions:)

IntelliJ IDEA invalid breakpoint

I have installed IntelliJ IDEA and upgraded a web project to run with Tomcat. It works fine but after some time I have discovered that I'm not able to debug some code I add to the end of class. Because when I set a breakpoint in this code it marks as invalid. If I hover the invalid mark the warning message appears Warning: No executable code found at line xxx in class yyy.
The screenshot of the source code in editor when web application is running in debug mode:
Does anybody know why IntelliJ Idea can't find executable code there and how to set a valid breakpoint like the first one in the code that compiles and running?
When I have this problem, I go to menu "File -> Invalidate Caches and Restart". The problem is likely that the IntelliJ cache isn't up to date yet.

Hot code swap is not working, why?

When I'm trying to write a simple one class console app - there is no problem. I can change code in a method when debugging.
The problem is with my web apps on Jetty. It's not working nor just in usual debug mode(pressing a debug button in eclipse) nor in remote debug mode described here. I can debug but can't change even usual not static methods, like adding sysout for example, I mean I can change it but after saving it's not updated and it works the same as before.
Also, I talked to my colleagues, it works for them but they use Spring Tool Suite version of eclipse, I tried and concluded that it works in the latest version STS out of the box in usual debug mode and it doesn't work in the latest version of Eclipse.
What can be a reason?
Answer based on my comments to the question (as suggested by OP):
Strange Eclipse behaviour can happen when your workspace or project metadata are corrupted. This can happen for example when you upgrade Eclipse version and use workspace created by the old version.
You should try to re-create your workspace and setup fresh project checkout. If the problem goes away, you know there was something fishy in the workspace metadata.
You would have to use hot swap proxy for swapping classes in EE container like jRebel.
Check it out.

Eclipse skipping breakpoints

My issue isn't a new one, and I found several threads about it, yet no one was helpful for me.
I hope this one will.
I can't debug with eclipse. It recognizes breakpoints, switches to debug view, but somehow it gets out of sync and I can't debug my code. Sometimes It works, but after a while It happens again.
I work with JDK 1.6.0_24, Glassfish 3.1, eclipse INDIGO (but it also happens on HELIOS).
I tried (as I found in this site) to set eclipse to use Parallel GC. I tried put it in the eclipse.ini file, I tried to put in the glassfish VM arguments itself, and I tried to put it at eclipse JDK additional VM arguments (preference -> installed JRE-> JDK -> etc). Nothing seem to work for me. I also tried them all together.
Help me please..
Thank you all from advance,
Ido
EDIT:
OK, I noticed few more things:
On the Debug view, in my stck trace, I found the exact class with the breakpoint is paused and it had this comment: "(Suspended breakpoint at line XX)". When I clicked the line, suddenly the green line appeared. Yet, as soon as I clicked F6 to continue, It went out of sync again, just the next line became suspended. Weird.
I checked the processes running on my computer and found that there are several "java.exe" processes running at the same time. (eclipse runs on javaw.exe). Maybe this is why glassfish and eclipse refuse to work together.
I checked the build path and found that this is my output folder: project-name/target/classes. Is this good?
Any thoughts?
Ido
So, I couldn't fix this but I found a workaround that completely solves this - FINALLY!.
I just stopped using glassfish WTP for debugging and set a remote debug to my local glassfish. it works perfectly with few minor annoying things - but breakpoints finally noticed.
Set remote debug
Go to your glassfish admin console and set your glassfish to work on debug mode.
Click on configuration --> server-config --> JVM settings, and check debug enabled check box.
Restart server
In eclipse - start server on normal mode (not debug - it is useless).
Go to Debug configurations and locate "Remote Java Application"
Create a new Remote java app debug config
Enter name (lets say Glassfish-Debug)
Choose project to debug
Enter your own IP address in the host section and set the port to 9009
This is optional but it is more comfortable to work with:
Go to "Common" tab, and check the Debug check box. This will make this Glassfish remote debugging configuration constant on your debug menu.
That's it. Now all you have to do is always start your Glassfish in normal mode and then go to Debug configurations and run This Glassfish remote debugging you just set.
And now I'm getting to the annoying part: After rebuild your project, sometimes you might get again out of sync. You just need to disconnect the remote debugging session and run it again. Small price to pay.
I hope it helps..
I had faced similar issues, But it turned out to be a simpler problem of multiple versions of JREs/JDKs installed.
Try Debug -> Run Configuration -> JRE -> Alternate JRE -> select JDK 1.6.0_24.
Also check for project build paths if correct Jars are been used.
Hope this helps.

Categories

Resources