Skip to content
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

Failed to refresh live data from process 12704 - com.xxxx.xx.xxx.BillingServiceApp after retries: 10 #748

Closed
Carson-yy opened this issue Mar 29, 2022 · 16 comments
Assignees
Labels
for: vscode something that is specific for VSCode theme: live-data type: bug

Comments

@Carson-yy
Copy link

Carson-yy commented Mar 29, 2022

Failed to refresh live data from process 12704 - com.xxxx.xx.xxx.BillingServiceApp after retries: 10

visual studio code 1.65.2
windows 11
default JDK 17
runtime JDK 8

@Carson-yy Carson-yy changed the title Failed to refresh live data from process 12704 - com.chinasoft.fuhsi.billing.BillingServiceApp after retries: 10 Failed to refresh live data from process 12704 - com.xxxx.xx.xxx.BillingServiceApp after retries: 10 Mar 29, 2022
@martinlippert
Copy link
Member

This happens when the Spring Tools in VSCode try to fetch live information from the running app (in order to show live hovers): https://github.com/spring-projects/sts4/wiki/Live-Application-Information

With the latest update to the Spring Tools for VSCode, this is triggered automatically after you launched a Spring Boot application, but it looks like this doesn't work somehow.

In order to disable this automatic behavior, you can go to the preferences and disable Live Information -> Automatic Tracking.

In order to solve the underlying issue, we need a few more details here:

  • does your project have Spring Boot Actuator on the dependency list?
  • how does the beginning on the log output looks like when you start the application (the command that is executed including the JVM options set)

@Carson-yy
Copy link
Author

  1. Spring Boot Actuator exists.

  2. The beginning of the log is also normal.

@martinlippert
Copy link
Member

@Yaegar Can you paste the beginning of the log when starting the app here (the section that contains the launch arguments)?

@martinlippert
Copy link
Member

@Yaegar Maybe you can provide a small sample application that reproduces the behavior you are seeing?
And is there maybe a security setting on the machine that prevents the started app from being accessed va JMX from the tooling?

@sbreakey
Copy link

sbreakey commented May 26, 2022

I get this too.

Versions:
Vscode Version: 1.67.2 (Universal)
Commit: c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5
Date: 2022-05-17T18:20:57.384Z (1 wk ago)
Electron: 17.4.1
Chromium: 98.0.4758.141
Node.js: 16.13.0
V8: 9.8.177.13-electron.0
OS: Darwin x64 21.3.0

Launch args:
cd /Users/me/my-proj ; /usr/bin/env 'SOME_VAR=someval' /usr/local/Cellar/openjdk/17.0.2/libexec/openjdk.jdk/Contents/Home/bin/java -agentlib:jdwp=transport=dt_socket,server=n,suspend=y,address=localhost:58218 -XX:+ShowCodeDetailsInExceptionMessages @/var/folders/d3/yzvcd0ws7nv56wfg9z_h7vtm0000gr/T/cp_15dsny3wqaz08lv5lggsbrp17.argfile com.example.myapp.MyAppServiceApplication --spring.profiles.active=local

@martinlippert
Copy link
Member

@sbreakey From the launch args it looks like the necessary args to enable this feature as not set automatically. How do you launch the app? And can you provide a sample app and a few steps how to reproduce this?

There is a preference to disable the automatic launch args settings and the automatic attempt to connect to the process to show live data in the preferences Boot-Java -> Live Information -> Automatic Connection - if you want to avoid this automatic connection and the error message from showing up.

But it would be good to find the root cause here in order to fix the underlying problem, so more details would be very much appreciated here.

@sbreakey
Copy link

How do you launch the app?

I use the vscode debugger (using the Microsoft "Debugger for Java" extension: vscjava.vscode-java-debug). My launch configuration is:

{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "java",
      "name": "Launch MyApplication",
      "request": "launch",
      "mainClass": "com.whatever.myapp.MyApplication",
      "projectName": "myapp",
      "args": "--spring.profiles.active=local",
      "env": {
        "somekey": "someval"
      },
      "preLaunchTask": "Copy build-info from Gradle"
    }
}

And can you provide a sample app and a few steps how to reproduce this?

Sure here you go. It's literally an absolute bare bones gradle based, springboot 2.7.0 app generated by the initializer. Just open the "Run and Debug" screen in vscode and click "Run and Debug".

@martinlippert
Copy link
Member

@sbreakey Thanks for the additional details, we will take a closer look here. The project doesn't have spring-boot-actuators in the classpath, so live hovers won't show up anyway, but the tooling should be smart enough to not make any attempts in that direction in such a situation. But lets have a closer look first.

@BoykoAlex
Copy link
Contributor

Fixed with 24117a4

@negwu01
Copy link

negwu01 commented Nov 10, 2022

Tried running a spring boot application on vscode and got Failed to refresh live data from process 12243 after retries: 10 - Source spring boot tools extension. Live hovers were not possible. I added actuator and also added
-Dspring.liveBeansView.mbeanDomain and "vmArgs": "-Dspring.jmx.enabled=true" in the 'launch.json' file as described. But did not get any beans info or live hovers. It used to work on vscode 1.72 and spring boot 2.7.4.+ I now decided to migrate the code to spring boot 3.0.0 and vscode 1.73+ but I double if this issue is because of the versions.

@jarhuba
Copy link

jarhuba commented Nov 14, 2022

Same problem here.
Spring Boot 3.0.0-RC2, vscode 1.73.1
Fedora 36, jdk 17
Failed to refresh live data from process 55015 after retries: 10

2022-11-14T11:00:39.055+01:00 INFO 55015 --- [ main] com.crud.tasks.TasksApplication : Starting TasksApplication using Java 17.0.5 with PID 55015 (/home/jarek/Dokumenty/markownie-webserwis/module_19.2/tasks/bin/main started by jarek in /home/jarek/Dokumenty/markownie-webserwis/module_19.2/tasks)
2022-11-14T11:00:39.060+01:00 INFO 55015 --- [ main] com.crud.tasks.TasksApplication : No active profile set, falling back to 1 default profile: "default"
2022-11-14T11:00:40.078+01:00 INFO 55015 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'management.metrics-org.springframework.boot.actuate.autoconfigure.metrics.MetricsProperties' of type [org.springframework.boot.actuate.autoconfigure.metrics.MetricsProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2022-11-14T11:00:40.396+01:00 INFO 55015 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2022-11-14T11:00:40.413+01:00 INFO 55015 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2022-11-14T11:00:40.414+01:00 INFO 55015 --- [ main] o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.1]
2022-11-14T11:00:40.576+01:00 INFO 55015 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2022-11-14T11:00:40.576+01:00 INFO 55015 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1442 ms
2022-11-14T11:00:41.252+01:00 INFO 55015 --- [ main] o.s.b.a.e.web.EndpointLinksResolver : Exposing 1 endpoint(s) beneath base path '/actuator'
2022-11-14T11:00:41.328+01:00 INFO 55015 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2022-11-14T11:00:41.345+01:00 INFO 55015 --- [ main] com.crud.tasks.TasksApplication : Started TasksApplication in 2.684 seconds (process running for 3.239)

@martinlippert
Copy link
Member

@jarhuba @negwu01 In case you are running a Spring Boot 3 application, you might run into this issue: https://twitter.com/springtools4/status/1589591973878714368. So can you add this additional config to your application.properties file?

management.endpoints.jmx.exposure.include=*

to see if that fixes the issue?

@jarhuba
Copy link

jarhuba commented Nov 15, 2022

After adding this line vscode works correctly. Thank you.

@iwangbowen
Copy link

I encountered the same issue

@martinlippert
Copy link
Member

@iwangbowen We fixed this a while ago, the property is usually added automatically now when launching a Spring Boot app in VSCode (in case you have the Spring Boot Tools installed). Can you provide further details, maybe a sample app, and some steps how to reproduce this?

@BoykoAlex
Copy link
Contributor

BoykoAlex commented Oct 21, 2024

@iwangbowen it'd be great if you could share your Eclipse workspace folder zip in the case of Eclipse :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: vscode something that is specific for VSCode theme: live-data type: bug
Projects
None yet
Development

No branches or pull requests

7 participants