16

I've rather strange issue that I can't resolve with Intellij IDEA. I was parsing email file with org.apache.james.mime4j package but my mail file had incompatible format of Date: header. So I created module from mime4j sources and removed mime4j jar from my disk.

I've found a place where parsing happens. When I put System.out.println("Something") there, I see it in my console. But when I put a breakpoint right on println's line it doesn't stop. (But it stops in my main() function).

Do you have any idea why this can happen? I've invalidated my cache. I use IDEA 11.1.2.

2
  • Are you sure there is no post-processing done to the jar? This could do all sorts of things that would change or in some way alter the linenumbertable in the classfiles deployed vs the line numbers in your source. If those two don't match up perfectly, you'll find erratic debug behavior. Commented Jul 30, 2012 at 18:21
  • Have you recompiled after putting in your print statements? Commented Jul 30, 2012 at 18:37

4 Answers 4

18

IDEA may cache your jar and use a cached copy, double check the module dependencies, there should be no the jar dependency, only the dependency on the module containing sources.

Also try File | Invalidate Caches.

Sign up to request clarification or add additional context in comments.

2 Comments

Invalidating caches may not delete the cached jar stored under %system%\jars, see devnet.jetbrains.net/docs/DOC-181. Are you sure that module dependencies do not list this jar? Did you try to delete all the output and rebuild? Can you share a sample project to reproduce it?
THANK YOU! Is it possible to make IDEA not cache the dependencies (or specific ones)? I've scratched my head for hours trying to debug a project where the source lines obviously didn't match the code being executed...
3

The thing that fixed my issue (same description) was to synchronize the sources. See screenshot below:

enter image description here

Comments

1

I also did invalidate caches/restart but there was no positive result.

In my case the application process stopped but IDEA didn't catch the breakpoint. The solution was to click pause debugger while process was freezed:

enter image description here

Comments

0

In my case I was debugging a unit test and the class with the breakpoint was mocked.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.