Classloading differences between Run and Debug mode

My dev team has been having an intermitent issue, on a few different developer stations, for a few months. We have some test cases in IDEA that run against a remote Jboss server. For some reason, every so often we get serialVersionUIDs mismatch errors trying to exercise EJB calls if we use IDEA's built in test runner.

This would typically point to a classloading problem. Interestingly, whenever we ask the classLoader for the code's location (XXXX.class.getProtectionDomain().getCodeSource().getLocation()), it reports the correct location, that has the correct UID, according to serialver.

What really makes this problem puzzling is the fact that this only happens when we use the IDEA runner in Run mode. If we try to use the debugger(by just right clicking on the test and hitting debug), there is no serialUID mismatch, and the problem doesn't happen!

As far as I know, there should be no difference between the classes being loaded when I run or debug a test case in IDEA, yet we've seen this kinds of problems be easily worked around by just running on debug. From where I stand, this makes very little sense.

Is there any difference between the way IDEA's  run and debug modes that could account for something like this?

Please sign in to leave a comment.