Cannot set Java breakpoint in Intellij IDEA

I'm trying to put breakpoints into the GoogleAppEngine sources (SDK 1.7.0) but IDEA Ultimate (11.0.2) just keeps telling me Warning: No executable code found at line 482 in class com.google.appengine.api.memcache.AsyncMemcacheServiceImpl.

I get this error message both when I run the code from unit tests and I start up the development server.

It's quite annonying. Anyway my sources are in an external (relative to both the IDEA home and the project home) directory, and my jar files are under the Appengine SDK lib dir.

My jar files are added as project library to the module, and my sources are attached to this library. I was playing around with module dependencies as well, but without any luck. Finally I decided to put this library into Compile scope, but that was a bad idea since the SDK provides these jars at runtime, so I decided to fall back to Provided scope.

I also played with the export checkbox on the module dependencies tab, but I think this is irrelevant, according to the web help, export is only important when you have dependent modules and you want to make your library available in these modules as well.

Anyway, this question arised 4 years ago also. So I'm wondering now whether is it really so hard to solve this issue?

I'm very disappointed now. I didn't have any problems with IDEA so far... I saw that this problem arised to other people as well, so this is not unique I guess.

Any help is appreciated.


I edited my question due to my javap experiments below: It seems that the classes and the sources are NOT out of sync. I checked out the 1.7.0 related revision from SVN, and I'm using the 1.7.0 SDK, so these should not be out of sync at all.


Solution 1:

I had similar problems and various attempts has been applied. Below is my usual steps:

  1. If you are using Maven dependencies, go to Maven Projects -> refresh
  2. If that does not work, Try top menu --> Build --> Rebuild Project
  3. If that still doesn't work, try top menu --> File --> Invalidate Cache/Restart
  4. If that still doesn't work, then $CATALINA_BASE/bin/catalina.sh stop, then start

After this, usually it covers 99% of the problems. Otherwise, Probably you will have to examine some other possibilities.

Solution 2:

I had faced similar problem while debugging in intellij. I wasn't able to put breakpoint at one of the code snippet, then i changed the line number of the code and after that i was able to put breakpoint. Looks like a bug in intellij or some caching issue.

Solution 3:

I found some other cases where people reported that IDEA says "No executable code found". A common pattern is that they were trying to debug code that has been built without debug information. Check that you are compiling with the "-g" flag (or equivalent) set.

Solution 4:

I was able to fix this problem by recompiling the class in question: Build - > Recompile (filename.java)