1

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?

Community
  • 1
  • 1
Bartek Maraszek
  • 1,404
  • 2
  • 14
  • 31
  • What do you mean by old version of code? from where you are expecting new version, means did you change code in eclipse OR from outside of Eclipse? You can try inserting any space/new_line and save code again. it will deploy new version on server in debug mode. – Neeraj Jul 25 '14 at 07:38
  • @Neeraj, I edited my code only in Eclipse. After inserting a new line and saving the file, the change is not being deployed on the server. The new line of code is not executed. – Bartek Maraszek Jul 25 '14 at 07:45
  • I hope "Build Automatically" option is ON. If you are building project from command line then it will not reflect changes in eclipse. Building project from command is totally different than building project in eclipse. My suggestion is to build project in eclipse if want your changes should published on server in debug mode. – Neeraj Jul 25 '14 at 08:47

1 Answers1

1

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.

Community
  • 1
  • 1
Bartek Maraszek
  • 1,404
  • 2
  • 14
  • 31