You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"Cannot find any changed classes for hot replace!" #855
Yes I've basically a complete framework which itself is a multi-module maven project. Then I've another project which is itself a multi-module maven project and this project uses some of the components from the framework project.
I looked at the code of the extension and found this, could it be the reason it is triggered only on "auto" setting? if (hcrEvent.body.changeType === HcrChangeType.BUILD_COMPLETE) { if (getHotReloadFlag() === "auto") { return vscode.window.withProgress({ location: vscode.ProgressLocation.Window }, (progress) => { progress.report({ message: "Applying code changes..." }); return hcrEvent.session.customRequest("redefineClasses"); }); } }
Jinbo Wang (@testforstephen) kindly confirm one thing. Changed resources such as .css, .js are not detected and hence requires restart of the application.
I am encountering this issue too but the fix doesn't work. After applying the fix I get the error No delegateCommandHandler for vscode.java.validateLaunchConfig
openjdk version "11.0.7" 2020-04-14
OpenJDK Runtime Environment (build 11.0.7+10-post-Ubuntu-3ubuntu1)
OpenJDK 64-Bit Server VM (build 11.0.7+10-post-Ubuntu-3ubuntu1, mixed mode, sharing)
I was having this issue in spring boot project. The build job status was building the project fine.
The language server for java logs stated an error in duplicate entry. I opened the .classpath file and removed the duplicate entry. Then the hot code replace started working
Activity
testforstephen commentedon Jul 30, 2020
i can reproduce it. Thanks for the detailed steps.
ijazfx commentedon Jul 30, 2020
I'm facing same issue. HCR not working as expected and after each change I've to restart the program.
testforstephen commentedon Jul 30, 2020
The root cause for the original issue is the changed class is contained by multiple projects, and the debugger doesn't handle well during dedup.
Farrukh Ijaz (@ijazfx) What's your scenario? Are you working on a multi module maven projects?
ijazfx commentedon Jul 30, 2020
Yes I've basically a complete framework which itself is a multi-module maven project. Then I've another project which is itself a multi-module maven project and this project uses some of the components from the framework project.
I looked at the code of the extension and found this, could it be the reason it is triggered only on "auto" setting?
if (hcrEvent.body.changeType === HcrChangeType.BUILD_COMPLETE) { if (getHotReloadFlag() === "auto") { return vscode.window.withProgress({ location: vscode.ProgressLocation.Window }, (progress) => { progress.report({ message: "Applying code changes..." }); return hcrEvent.session.customRequest("redefineClasses"); }); } }testforstephen commentedon Jul 30, 2020
I see, looks like the same root cause.
js side is just glue code. The actual logic happens at debug server, see https://github.com/microsoft/java-debug/blob/master/com.microsoft.java.debug.plugin/src/main/java/com/microsoft/java/debug/plugin/internal/JavaHotCodeReplaceProvider.java#L340
testforstephen commentedon Jul 30, 2020
Farrukh Ijaz (@ijazfx) Max Streifeneder (@maxstreifeneder) Could you have a try on a private fix? https://raw.githubusercontent.com/testforstephen/vscode-test/master/vscode-java-debug-0.27.2.vsix
This private fix is built against Java 11, you need update your JDK to 11 when you try it.
ijazfx commentedon Jul 30, 2020
Yes it is working as expected. I wasn't able to test all the scenarios but a quick test revealed fast manual HCR.
ijazfx commentedon Jul 31, 2020
Jinbo Wang (@testforstephen) kindly confirm one thing. Changed resources such as .css, .js are not detected and hence requires restart of the application.
testforstephen commentedon Jul 31, 2020
Correct, the debugger only supports Java code hot reloading. It doesn't have the knowledge of your application background.
ijazfx commentedon Jul 31, 2020
Okay, thanks for the fix though.
maxstreifeneder commentedon Jul 31, 2020
Jinbo Wang (@testforstephen) works for me! thanks a lot for your quick response and fix - couldn't be any better :-)
Nintorac commentedon Jul 31, 2020
I am encountering this issue too but the fix doesn't work. After applying the fix I get the error
No delegateCommandHandler for vscode.java.validateLaunchConfigopenjdk version "11.0.7" 2020-04-14
OpenJDK Runtime Environment (build 11.0.7+10-post-Ubuntu-3ubuntu1)
OpenJDK 64-Bit Server VM (build 11.0.7+10-post-Ubuntu-3ubuntu1, mixed mode, sharing)
Visual Studio Code version: 1.46.1
Java extension version: Java Extension Pack v0.9.1
testforstephen commentedon Jul 31, 2020
Nintorac Could you share the log file?
F1 -> Java: Open Java language server log file
Nintorac commentedon Jul 31, 2020
I tried updating to Visual Studio Code version: 1.47.3 and still get errors.
Logs here https://pastebin.com/qLZGaAer
testforstephen commentedon Jul 31, 2020
java.version=9.0.4
Oh, you're still using an old vscode-java version and JDK 9. My private fix is built against Java 11. Could you try to update to JDK 11?
And if you still need build your project against to JDK 1.8, then you can try "java.configuration.runtimes" setting as below.
Nintorac commentedon Jul 31, 2020
Yup, that works. Thanks +1
MTyson commentedon Jun 2, 2021
FYI for others: I had to remove the project from the workspace and restart vscode to get this error to stop.
Java Debugger v.0.36
ahmednrana commentedon Jul 15, 2021
I was having this issue in spring boot project. The build job status was building the project fine.
The language server for java logs stated an error in duplicate entry. I opened the .classpath file and removed the duplicate entry. Then the hot code replace started working