New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Live application information hovers not available #395
Comments
The info in the logs is not very interesting. The one in 'WINDOW' appears to be from the Redhat Java extensions so has not much relation to problems in the spring boot language server. The `vscode-spring-boot-debug-log' basically just has an information message saying that logging has been disabled. To get more interesting log output you can enable the log output via a preference. For example something like his in
I think I know why you are not getting the live hover information though. A few things have changed both in spring boot and in the tooling. Firstly, in spring boot, the jmx support is no longer enabled by default in recent versions (which the Petclinic app uses). So something/someone has to enable it explicitly when you launch the app. This happens automatically for apps launched from the Eclipse Boot Dashboard. For any other kind of launch you have to do it yourself. For example when I launch the PetClinic app from the commandline I do it like this:
How did you launch the petclinic app? Did you enable JMX in spring? Secondly, in the spring-boot tooling, the language server no longer auto connects to most processes (apps launched from Eclipse Boot Dashboard are an exception). You have to do that explicitly. In vscode you do this as follows:
Perhaps with this additional information you are able to get it working? If not, we can try trouble shoot more. In that case:
|
@evowilliamson If you have a chance to try... could you let us know if after enabling JMX for petclinic and using the 'Manage Live Boot Process Connections' command in vscode to connect to the process... things work as expected? In the mean time I'll assume that is the case and close this ticket. But we can of course re-open it and take another look if you are still experiencing problems. |
@kdvolder I will try today. I'll have some time after the break! |
When I mvn install the app and start the app from a terminal in the workspace, activating jmx in spring boot, and after selecting the live spring boot process, all is OK. But when I start the process by right-clicking the spring-petclinic option in the SPRING-BOOT-DASHBOARD, things go wrong at the moment of selecting the live spring boot process. I've included the boot-ls-log.txt file that contains the errors. I've also included my launch.json file that I use to spin off the debug process. Is there anything wrong with how I am providing the -D args to the process ? I've also tried splitting up the string in different elements in the list, but I got the same result: "args": [ Thanks in advance! |
I think the -D arguments are not arguments to your app but arguments to the JVM itself so you have to put them as 'vmArgs' not 'args'. I.e. if you look at how it is launched on the CLI:
You will see that the Also... yes I think in the launch.json file you put the arguments split up individually into a json list rather than as just one long string. |
Splitting up both arguments in array values, resulted in an error:
Caused by: java.lang.IllegalArgumentException: Invalid boolean value 'true,-Dspring.application.admin.enabled=true' Moving both arguments in the same string, results in no errors, but doesn't give me the live application hovers:
|
@evowilliamson That's odd I just tried it myself. Here's the complete contents of my launch.json file for reference:
I launched the Java app via the 'Run' codelens that appears in the main '.java' file next to the 'main' method. This launched fine. I then connected to the process using |
Aha! Okay so when I launch with the above launch.json from the Boot Dashboard 'play' button instead of using the 'Run' codelens then I do get an error. So maybe this could be a bug in the Boot Dashboard. I suspect the boot dash launch may be passing something funky for the vmarguments. Unfortunately its not that easy to check what was passed as, when the process errors it exits and so I don't get the chance to connect jconsole to take a look. |
Okay, I just put a waitloop in the start of my main method so process doesn't error and I have time to inspect what's in JVM args. This is what I found for vmArgs:
Looks like Boot dashboard launch (or something else?) added some arguments of its own and then merged in the ones from our launch.json file. But in doing so it put a I don't think this is a bug in STS 4, but I'll follow up on this and try and get this properly debugged/fixed. As a workaround for now, I think you can just omit the second vm argument. |
For reference, this launch.json file works for me (with Boot Dash launch):
|
I also tried putting all the VMArgs into a single string and that also appears to work fine. It does add the Anyhow... how it deals with the arguments when placed in a list is still a bug. |
Just using the single |
@kdvolder
I think it will be helpful when others have the same problem. |
Hi!
I am having issues with seeing live application hovers in the Spring Boot Tools extension.
My environment:
Ubuntu 18.04
Visual Studio Code
JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64
App: https://github.com/spring-projects/spring-petclinic
I've installed the Spring Boot Tools, latest version as of now.
I checked the vscode-spring-boot-debug-log and it doesn't look good:
Activating 'vscode-spring-boot' extension
Found java exe: /usr/lib/jvm/java-11-openjdk-amd64/bin/java
isJavaEightOrHigher => true
Redirecting server logs to /dev/null
ERR: Disabling server log output. No more output will be sent after this.
ERR:
Child process connected on port 45556
When I hover over a section in java file, I see an error in the Log(Window):
[2019-12-13 15:22:48.931] [renderer1] [error] The request (id: 55, method: 'textDocument/hover') has been cancelled: Error: The request (id: 55, method: 'textDocument/hover') has been cancelled
at /home/ivo/.vscode/extensions/redhat.java-0.54.2/dist/extension.js:1:72946
at /home/ivo/.vscode/extensions/redhat.java-0.54.2/dist/extension.js:1:73240
at Immediate. (/home/ivo/.vscode/extensions/redhat.java-0.54.2/dist/extension.js:1:73601)
at processImmediate (internal/timers.js:439:21)
logs.zip
I've attached both logs
The text was updated successfully, but these errors were encountered: