6

I am running JBoss 4.0.3.SP1_CP04 and connecting to it with Eclipse 3.4.1's debugger, both using JDK 1.6.0_11.

When I make a minor change to a method (e.g. changing a "+ 1" in the logic to a "+ 2") and save it, I immediately receive an error message dialog titled "Hot Code Replace Failed" with the error "Delete method not implemented"

Hot code replace failed dialog http://img6.imageshack.us/img6/531/hotcodereplacefailedkp6.png

Can anyone suggest steps for getting this to work?

ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199
Brett
  • 231
  • 1
  • 3
  • 6

6 Answers6

4

What you want to do is deploy to JBOSS as an exploded WAR. Typically, if an editor does the initial deploy itself, it will then manage copying individual files over as they change.

In IntelliJ, this is easy. I have never done it from Eclipse, but this project is your best bet.

Chase Seibert
  • 15,703
  • 8
  • 51
  • 58
  • This answer reminded me to check if my WAR was exploded after creating a new project and finding that I couldn't hot swap - thanks! – peteorpeter Oct 15 '13 at 14:44
2

I have been using JRebel and it's a life saver as far as modifying code and dynamically updating the app server. Paid for itself the first day. (we have a 7 minute compile/deploy/restart cycle)

toomasr
  • 4,731
  • 2
  • 33
  • 36
Javamann
  • 2,882
  • 2
  • 25
  • 22
1

The reason is that the assembly can be used another compiler that hot swap. For example, if you build project by maven, we used javac. When you try to perform a hot swap etslipse uses built-in compiler jdt compiler(compiler is not taken from installed jdk and can not be changed by regular means.). Binary classes obtained are different and jvm can not replace them.

Roman
  • 11
  • 1
  • Can you provide a citation that the JVM cannot classes built by the internal eclipse compiler or when classes from different compilers are mixed. I cannot image why this should be the case, but also cannot rule it out. – dmeister Oct 11 '12 at 08:06
  • 2
    I've made the experience that normal classes usually work fine, but as soon as inner/anonymous classes are involved, things break, I think jdt and javac use different naming conventions for the generated classes. – Michael Böckling Oct 15 '12 at 08:15
1
  1. Before running debugger in Eclipse insure all projects in your workspace are refreshed (it is required if code was changed outside Eclipse, e.g. after getting changes from version control system using outside tool)
  2. In Java Build Path of Eclipse insure you don't include as a part of some library classes which you are trying to hot swap
  3. Check that Eclipse JRE = JBoss JRE
  4. Check class you are trying to hot swap. Does it have inner classes? I just run into issue when I can't swap class with inner class, while other classes are swapped without issues.
phantom4
  • 11
  • 1
0

I had an issue where hot code replacement itself was not working. We did some changes like making sure that the "build automatically" was checked and unchecking the - "abort build when an build path error occurs". But in my case, HCR itself was not working. I wasnt getting the message as you mentioned. More details are in this link. https://sites.google.com/site/javaerrorsandsolutions/home/hot-code-replacement

user513365
  • 179
  • 1
  • 2
0

What you described should work. What are your jvm args to jboss to enable debugging?

Mine are these: -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n

Ron
  • 1,932
  • 20
  • 17