Bartek Maraszek
Bartek Maraszek

Reputation: 1414

Eclipse debugger doesn't see changes in code

I'm debugging a JUnit test for code deployed on JBoss 7 AS via Arquillian. The debugger stops at breakpoints, but executes the old version of the code (e.g. it goes through empty lines) while I see the new version on my screen.

I have found this question: I deleted my old remote debug configuration and created a new one, removed the default sources and attached the new ones (Source --> Add --> Java Project, and selected my projects). This didn't solve my problem.

This answer suggest cleaning the projects. My projects are managed by maven, so I run mvn clean install from the console. This didn't help.

Since the JBoss is started by Arquillian, I don't think it matters if I have the automatic publishing turned on (Window --> Preferences --> Server --> Launching), but it's turned on anyways.

I'm having this issue quite often right now, at seemingly random moments - I run the same (working) remote debug configuration over and over and suddenly I'm experiencing this issue even though I haven't changed the sources in debug configuration.

What is the cause of this issue? What is the quickest way to fix it?

Upvotes: 1

Views: 2503

Answers (1)

Bartek Maraszek
Bartek Maraszek

Reputation: 1414

The issue was caused by JBoss reading old deployment info from its config file. I used the following actions to force a redeploy:

  1. Go to JBOSS_HOME/standalone/configuration
  2. Edit standalone.arquillian.xml
  3. Delete the deployments information (near the end of the file). See this answer.
  4. (Optionally) remove data from old deployments - in JBOSS_HOME/standalone the folders temp, data, and logs can be safely removed. See this answer.

I am still not sure what causes the xml to retain old deployment info and if this can be avoided.

Upvotes: 1

Related Questions