4

I have made a small maven based web application in VSCode and trying to deploy it on JBoss using the Redhat Server Connector Extension.

But the hot deployment of the class files does not work in simple running JBoss server.

But Hot deployment does work in debug mode as 'Hot Code Replace' by setting the property 'java.debug.settings.hotCodeReplace' to 'auto'.

My inputs are from below links:

https://devblogs.microsoft.com/visualstudio/hot-code-replacement-for-java-comes-to-visual-studio-code/

and other SO links like: How do I get Java "hot code replacement" working in JBoss?

Hot deploy on JBoss - how do I make JBoss "see" the change?

But it couldn't help.

Can you suggest something more about how it is simply possible in running JBoss?

(PS: Auto Build feature in VSCode is already enabled.

And It works fine in eclipse).

Deep
  • 929
  • 2
  • 16
  • 32
  • pls send server.log – Francisco Melo junior Sep 11 '19 at 21:45
  • this seems to be much more of a characteristic on VSCode rather than an issue on EAP, the server.log can show this. – Francisco Melo junior Sep 11 '19 at 22:13
  • There is no addition to server.log when I change the classes.It remains the same. And I think that is the problem, the jboss is never informed when classes change.Yes, it might be characteristic of VSCode, but is it a constraint and we cannot change it.? – Deep Sep 12 '19 at 05:39
  • If there is no exception on the server.log, likely means that there is no issue on the server. Therefore, this is pretty much VSCode related yeah. Need to see in-depth what happens when 'java.debug.settings.hotCodeReplace' to 'auto' will do, cause this might be a bug yes. – Francisco Melo junior Sep 12 '19 at 14:38

1 Answers1

1

Hot deployment of web applications in VSCode's integrated RedHat Server connector can occur in following ways:

  • Exploded war folder: A folder is extracted from the original war and deployed to JBoss using the Exploded option. Here, the static changes like change in jsps and HTML are automatically reflected in the running application.

  • Hot code Replacement: Hot code replacement (HCR) is a fast debugging technique in which the Java debugger transmits new class files over the debugging channel to another JVM. HCR only works when the class signature does not change; you cannot remove or add fields to existing classes when using HCR. However, HCR can be used to change the body of a method. (source: https://devblogs.microsoft.com/visualstudio/hot-code-replacement-for-java-comes-to-visual-studio-code/)

  • Maven Install/build: It is actually not a preferred technique which someone will want but it is useful also. In this technique, you run maven: install which builds the project again and install it onto the server again.

Currently, VSCode for java and the server connector extension are new as compared to already available IDEs like Eclipse. So, we might expect more powerful functionality in coming future.

Deep
  • 929
  • 2
  • 16
  • 32
  • 1
    Hello, could you clarify the procedure for "Exploded war folder" ? In eclipse, it is done automatically : when a JSP file change, it is automatically published in the exploded war folder. what I have done so far is to set the target folder of my app as the exploded war directory. But I can't seem to make VSCode auto-publish modifications on files – Clément Bareth Dec 18 '19 at 11:23