Sts4: Live Hovers does not show up when running Spring Boot in WSL

Created on 1 May 2018  路  11Comments  路  Source: spring-projects/sts4

When running a Spring Boot project ($ mvn spring-boot:run) in Linux subsystem in windows 10 (WSL bash shell, Ubuntu 16.04 distro), Boot Hints does not show up.

There are no warnings nor errors that I could see in the output box for the Spring Boot Tool VSCode extension (Pivotal.vscode-spring-boot).

Boot Hints show up normally if I run a Spring Boot project in git bash for windows 10, or in cmd on the same computer.

All 11 comments

Is the Linux Subsystem a VM? That would explain it. There's really no way for IDE running on the Windows machine to discover there are boot processes running on the VM.

It's not a VM. It's native to windows 10: https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux

I can see all the processes running by WSL in windows task manager just like windows processes. I can run a Spring Boot web project on it and access the web services like normal.

Instead of running $ mvn spring-boot:run in C:\Windows\System32\cmd.exe, I run it in C:\Windows\System32\bash.exe.

What happens if you run the jps command from your JDK on your Windows host system (where you also run the tools)? Does the running boot app show up in that list? And if so, what happens if you run jconsole ? Can you connect to that running boot app from the same system that you are running the IDE on?

(asking this because it is using the same mechanics under the hood to determine the running boot apps)

Thank you for replying!

When I run jsp command in WSL, I could see the spring boot apps (WamApplication and PafApiApplication) listed in the output:

$ jps
177 Launcher
353 Jps
82 WamApplication
3 Launcher
216 PafApiApplication

When I run jconsole command in WSL, I also see the spring boot apps listed:

jconsole screenshot

However, when I run jps command in windows cmd, I don't see any of the spring boot apps listed:

$ jps
110612 spring-boot-language-server-0.2.0-SNAPSHOT.jar
69700 Jps
81300 org.eclipse.equinox.launcher_1.5.0.v20180207-1446.jar
76904 spring-boot-language-server-0.2.0-SNAPSHOT.jar
54172 org.eclipse.equinox.launcher_1.5.0.v20180207-1446.jar

It's the same for running jconsole in cmd.

When I try to connect to any of the spring boot apps vis jconsole in WSL, it fails with errors like this in the bash output (it's a bit long):

2018-05-04 09:45:06
Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.171-b11 mixed mode):

"DestroyJavaVM" #43 prio=5 os_prio=0 tid=0x00007f310c010000 nid=0x53 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"http-nio-8004-AsyncTimeout" #41 daemon prio=5 os_prio=0 tid=0x00007f307d9f6800 nid=0x83 waiting on condition [0x00007f30e765f000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
        at java.lang.Thread.sleep(Native Method)
        at org.apache.coyote.AbstractProtocol$AsyncTimeout.run(AbstractProtocol.java:1133)
        at java.lang.Thread.run(Thread.java:748)

"http-nio-8004-Acceptor-0" #40 daemon prio=5 os_prio=0 tid=0x00007f307d9f5000 nid=0x82 runnable [0x00007f30e776f000]
   java.lang.Thread.State: RUNNABLE
        at sun.nio.ch.ServerSocketChannelImpl.accept0(Native Method)
        at sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:422)
        at sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:250)
        - locked <0x00000007352a13a0> (a java.lang.Object)
        at org.apache.tomcat.util.net.NioEndpoint$Acceptor.run(NioEndpoint.java:455)
        at java.lang.Thread.run(Thread.java:748)

"http-nio-8004-ClientPoller-1" #39 daemon prio=5 os_prio=0 tid=0x00007f307d9d2800 nid=0x81 runnable [0x00007f30e787f000]
   java.lang.Thread.State: RUNNABLE
        at sun.nio.ch.EPollArrayWrapper.epollWait(Native Method)
        at sun.nio.ch.EPollArrayWrapper.poll(EPollArrayWrapper.java:269)
        at sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:93)
        at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:86)
        - locked <0x00000007352a1b48> (a sun.nio.ch.Util$3)
        - locked <0x00000007352a1b38> (a java.util.Collections$UnmodifiableSet)
        - locked <0x00000007352a1a00> (a sun.nio.ch.EPollSelectorImpl)
        at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:97)
        at org.apache.tomcat.util.net.NioEndpoint$Poller.run(NioEndpoint.java:793)
        at java.lang.Thread.run(Thread.java:748)

"http-nio-8004-ClientPoller-0" #38 daemon prio=5 os_prio=0 tid=0x00007f307d9b8000 nid=0x80 runnable [0x00007f30e798f000]
   java.lang.Thread.State: RUNNABLE
        at sun.nio.ch.EPollArrayWrapper.epollWait(Native Method)
        at sun.nio.ch.EPollArrayWrapper.poll(EPollArrayWrapper.java:269)
        at sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:93)
        at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:86)
        - locked <0x0000000735281b88> (a sun.nio.ch.Util$3)
        - locked <0x0000000735281b78> (a java.util.Collections$UnmodifiableSet)
        - locked <0x0000000735281a40> (a sun.nio.ch.EPollSelectorImpl)
        at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:97)
        at org.apache.tomcat.util.net.NioEndpoint$Poller.run(NioEndpoint.java:793)
        at java.lang.Thread.run(Thread.java:748)

"http-nio-8004-exec-10" #37 daemon prio=5 os_prio=0 tid=0x00007f307d984000 nid=0x7f waiting on condition [0x00007f30e7a9f000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x00000007351b8d38> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
        at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
        at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:103)
        at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:31)
        at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:748)

"http-nio-8004-exec-9" #36 daemon prio=5 os_prio=0 tid=0x00007f307d982000 nid=0x7e waiting on condition [0x00007f30e7baf000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x00000007351b8d38> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
        at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
        at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:103)
        at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:31)
        at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:748)

"http-nio-8004-exec-8" #35 daemon prio=5 os_prio=0 tid=0x00007f307d980000 nid=0x7d waiting on condition [0x00007f30e7cbf000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x00000007351b8d38> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
        at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
        at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:103)
        at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:31)
        at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:748)

"http-nio-8004-exec-7" #34 daemon prio=5 os_prio=0 tid=0x00007f307d97e000 nid=0x7c waiting on condition [0x00007f30e7dcf000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x00000007351b8d38> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
        at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
        at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:103)
        at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:31)
        at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:748)

"http-nio-8004-exec-6" #33 daemon prio=5 os_prio=0 tid=0x00007f307d97c000 nid=0x7b waiting on condition [0x00007f30e7edf000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x00000007351b8d38> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
        at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
        at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:103)
        at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:31)
        at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:748)

"http-nio-8004-exec-5" #32 daemon prio=5 os_prio=0 tid=0x00007f307d97a000 nid=0x7a waiting on condition [0x00007f30e7fef000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x00000007351b8d38> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
        at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
        at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:103)
        at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:31)
        at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:748)

"http-nio-8004-exec-4" #31 daemon prio=5 os_prio=0 tid=0x00007f307d978800 nid=0x79 waiting on condition [0x00007f30ec13f000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x00000007351b8d38> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
        at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
        at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:103)
        at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:31)
        at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:748)

"http-nio-8004-exec-3" #30 daemon prio=5 os_prio=0 tid=0x00007f307d976800 nid=0x78 waiting on condition [0x00007f30ec24f000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x00000007351b8d38> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
        at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
        at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:103)
        at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:31)
        at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:748)

"http-nio-8004-exec-2" #29 daemon prio=5 os_prio=0 tid=0x00007f307d975000 nid=0x77 waiting on condition [0x00007f30ec35f000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x00000007351b8d38> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
        at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
        at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:103)
        at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:31)
        at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:748)

"http-nio-8004-exec-1" #28 daemon prio=5 os_prio=0 tid=0x00007f307d974000 nid=0x76 waiting on condition [0x00007f30ec46f000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x00000007351b8d38> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
        at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
        at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:103)
        at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:31)
        at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:748)

"NioBlockingSelector.BlockPoller-1" #27 daemon prio=5 os_prio=0 tid=0x00007f307d5c2800 nid=0x75 runnable [0x00007f30ec68f000]
   java.lang.Thread.State: RUNNABLE
        at sun.nio.ch.EPollArrayWrapper.epollWait(Native Method)
        at sun.nio.ch.EPollArrayWrapper.poll(EPollArrayWrapper.java:269)
        at sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:93)
        at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:86)
        - locked <0x00000007351b8750> (a sun.nio.ch.Util$3)
        - locked <0x00000007351b8740> (a java.util.Collections$UnmodifiableSet)
        - locked <0x00000007351b8618> (a sun.nio.ch.EPollSelectorImpl)
        at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:97)
        at org.apache.tomcat.util.net.NioBlockingSelector$BlockPoller.run(NioBlockingSelector.java:298)

"Live Reload Server" #26 daemon prio=5 os_prio=0 tid=0x00007f307c0e4000 nid=0x74 runnable [0x00007f30ec57f000]
   java.lang.Thread.State: RUNNABLE
        at java.net.PlainSocketImpl.socketAccept(Native Method)
        at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:409)
        at java.net.ServerSocket.implAccept(ServerSocket.java:545)
        at java.net.ServerSocket.accept(ServerSocket.java:513)
        at org.springframework.boot.devtools.livereload.LiveReloadServer.acceptConnections(LiveReloadServer.java:146)
        at org.springframework.boot.devtools.livereload.LiveReloadServer$$Lambda$483/2030481423.run(Unknown Source)
        at java.lang.Thread.run(Thread.java:748)

"File Watcher" #24 daemon prio=5 os_prio=0 tid=0x00007f307d95a000 nid=0x72 runnable [0x00007f30ec99f000]
   java.lang.Thread.State: RUNNABLE
        at java.io.UnixFileSystem.getBooleanAttributes0(Native Method)
        at java.io.UnixFileSystem.getBooleanAttributes(UnixFileSystem.java:242)
        at java.io.File.exists(File.java:819)
        at org.springframework.boot.devtools.filewatch.FileSnapshot.<init>(FileSnapshot.java:42)
        at org.springframework.boot.devtools.filewatch.FolderSnapshot.collectFiles(FolderSnapshot.java:71)
        at org.springframework.boot.devtools.filewatch.FolderSnapshot.collectFiles(FolderSnapshot.java:68)
        at org.springframework.boot.devtools.filewatch.FolderSnapshot.collectFiles(FolderSnapshot.java:68)
        at org.springframework.boot.devtools.filewatch.FolderSnapshot.collectFiles(FolderSnapshot.java:68)
        at org.springframework.boot.devtools.filewatch.FolderSnapshot.collectFiles(FolderSnapshot.java:68)
        at org.springframework.boot.devtools.filewatch.FolderSnapshot.collectFiles(FolderSnapshot.java:68)
        at org.springframework.boot.devtools.filewatch.FolderSnapshot.<init>(FolderSnapshot.java:59)
        at org.springframework.boot.devtools.filewatch.FileSystemWatcher$Watcher.getCurrentSnapshots(FileSystemWatcher.java:285)
        at org.springframework.boot.devtools.filewatch.FileSystemWatcher$Watcher.scan(FileSystemWatcher.java:258)
        at org.springframework.boot.devtools.filewatch.FileSystemWatcher$Watcher.run(FileSystemWatcher.java:243)
        at java.lang.Thread.run(Thread.java:748)

"SimplePauseDetectorThread_0" #23 daemon prio=9 os_prio=0 tid=0x00007f3090031800 nid=0x71 sleeping[0x00007f30ecaaf000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
        at java.lang.Thread.sleep(Native Method)
        at java.lang.Thread.sleep(Thread.java:340)
        at java.util.concurrent.TimeUnit.sleep(TimeUnit.java:386)
        at org.LatencyUtils.TimeServices.sleepNanos(TimeServices.java:62)
        at org.LatencyUtils.SimplePauseDetector$SimplePauseDetectorThread.run(SimplePauseDetector.java:116)

"Thread-5" #22 daemon prio=9 os_prio=0 tid=0x00007f309001f000 nid=0x70 waiting on condition [0x00007f30ecbbf000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x0000000734f1be70> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
        at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
        at org.LatencyUtils.PauseDetector$PauseDetectorThread.run(PauseDetector.java:85)

"container-0" #21 prio=5 os_prio=0 tid=0x00007f307cbcf000 nid=0x6f waiting on condition [0x00007f30ed0cf000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
        at java.lang.Thread.sleep(Native Method)
        at org.apache.catalina.core.StandardServer.await(StandardServer.java:427)
        at org.springframework.boot.web.embedded.tomcat.TomcatWebServer$1.run(TomcatWebServer.java:181)

"ContainerBackgroundProcessor[StandardEngine[Tomcat]]" #20 daemon prio=5 os_prio=0 tid=0x00007f307cdad800 nid=0x6e waiting on condition [0x00007f30ed1df000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
        at java.lang.Thread.sleep(Native Method)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1355)
        at java.lang.Thread.run(Thread.java:748)

"Service Thread" #11 daemon prio=9 os_prio=0 tid=0x00007f310c0ea800 nid=0x66 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C1 CompilerThread3" #10 daemon prio=9 os_prio=0 tid=0x00007f310c0df000 nid=0x65 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread2" #9 daemon prio=9 os_prio=0 tid=0x00007f310c0dd000 nid=0x64 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread1" #8 daemon prio=9 os_prio=0 tid=0x00007f310c0db000 nid=0x63 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread0" #7 daemon prio=9 os_prio=0 tid=0x00007f310c0d8000 nid=0x62 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"JDWP Event Helper Thread" #6 daemon prio=10 os_prio=0 tid=0x00007f310c0d6000 nid=0x61 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"JDWP Transport Listener: dt_socket" #5 daemon prio=10 os_prio=0 tid=0x00007f310c0d2800 nid=0x60 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Signal Dispatcher" #4 daemon prio=9 os_prio=0 tid=0x00007f310c0c4800 nid=0x5f waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Finalizer" #3 daemon prio=8 os_prio=0 tid=0x00007f310c092800 nid=0x5e in Object.wait() [0x00007f30f479f000]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x00000005c1232928> (a java.lang.ref.ReferenceQueue$Lock)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143)
        - locked <0x00000005c1232928> (a java.lang.ref.ReferenceQueue$Lock)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:164)
        at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:212)

"Reference Handler" #2 daemon prio=10 os_prio=0 tid=0x00007f310c08e000 nid=0x5d in Object.wait() [0x00007f30f48af000]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x00000005c1205a30> (a java.lang.ref.Reference$Lock)
        at java.lang.Object.wait(Object.java:502)
        at java.lang.ref.Reference.tryHandlePending(Reference.java:191)
        - locked <0x00000005c1205a30> (a java.lang.ref.Reference$Lock)
        at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:153)

"VM Thread" os_prio=0 tid=0x00007f310c086800 nid=0x5c runnable

"GC task thread#0 (ParallelGC)" os_prio=0 tid=0x00007f310c025800 nid=0x54 runnable

"GC task thread#1 (ParallelGC)" os_prio=0 tid=0x00007f310c027000 nid=0x55 runnable

"GC task thread#2 (ParallelGC)" os_prio=0 tid=0x00007f310c029000 nid=0x56 runnable

"GC task thread#3 (ParallelGC)" os_prio=0 tid=0x00007f310c02a800 nid=0x57 runnable

"GC task thread#4 (ParallelGC)" os_prio=0 tid=0x00007f310c02c800 nid=0x58 runnable

"GC task thread#5 (ParallelGC)" os_prio=0 tid=0x00007f310c02e000 nid=0x59 runnable

"GC task thread#6 (ParallelGC)" os_prio=0 tid=0x00007f310c030000 nid=0x5a runnable

"GC task thread#7 (ParallelGC)" os_prio=0 tid=0x00007f310c031800 nid=0x5b runnable

"VM Periodic Task Thread" os_prio=0 tid=0x00007f310c0ef800 nid=0x67 waiting on condition

JNI global references: 8246

Heap
 PSYoungGen      total 531968K, used 183282K [0x0000000715b80000, 0x0000000754400000, 0x00000007c0000000)
  eden space 510464K, 33% used [0x0000000715b80000,0x0000000720029bb8,0x0000000734e00000)
  from space 21504K, 68% used [0x0000000734e00000,0x0000000735c52e30,0x0000000736300000)
  to   space 22016K, 0% used [0x0000000752e80000,0x0000000752e80000,0x0000000754400000)
 ParOldGen       total 169984K, used 25556K [0x00000005c1200000, 0x00000005cb800000, 0x0000000715b80000)
  object space 169984K, 15% used [0x00000005c1200000,0x00000005c2af52b8,0x00000005cb800000)
 Metaspace       used 43465K, capacity 45458K, committed 45528K, reserved 1089536K
  class space    used 5707K, capacity 6094K, committed 6144K, reserved 1048576K

Any advice?
Thanks!

First of all, sorry for the late reply...

The tooling uses the same mechanics for discovering and connecting to the boot apps via JMX than jps and jconsole does, so it seems consistent with your experiments that the spring tooling doesn't find the processes.

Unfortunately I don't have a solution for this at hand. We need to investigate how JMX can be configured in this WLS setting. Will put that on the list of things to investigate for future releases.

(comment in Pivotal Tracker added by Kris De Volder:)

This link explains how to setup windows subsystem for linux: https://docs.microsoft.com/en-us/windows/wsl/install-win10

I'm going to try to follow these instructions, hopefully this can actually work when running windows in a VM (is this like running a VM inside of a VM?). If it works I can try to work out a way to make live hovers work via manual configuration using the setting added in this story: https://www.pivotaltracker.com/story/show/159408820

I've got boot hints working in windows WSL but it requires some manual steps. I don't know how/if we would be able to make this work automatically. I think the problem is really that from Java's point of view the linux subsystem follows its own/different logic of where the JVM puts files that allow for jps mechanism to detect JVM processes and to dynamically enable JMX for them.

For example, to run Java stuff from WSL I had to install Java into the Linux subsystem. So this is a totally separate JVM install from the one used to launch the boot-java-language server from vscode running in Windows. The WSL JVM is basically working like its running on Linux and so it will be using the /tmp folder on the Linux filesystem, whereas the JVM used by the language server puts tmp folders in a totally different place. Since process discovery and the whole 'enable JMX' mechanics are somehow dependent on files written by the JVM into /tmp this is probably why it doesn't work. It is unclear if its possible to make it work.

Luckliy, as a user, you can work around this with some manual steps to configure things:

Step 1: Enable the JMX support on a specific port when launching the app. For example I run my app from the WSL with a command like this:

java -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.port=41383 -Dcom.sun.management.jmxremote.rmi.port=41383 -Djava.rmi.server.hostname=localhost -Dcom.sun.management.jmxremote.local.only=false -jar target/hello*.jar

This will make have JMX enabled and accessible via this JMX_URL: service:jmx:rmi://localhost:41383/jndi/rmi://localhost:41383/jmxrmi.

Step 2) Now to make the live hovers work in vscode we can add this to the workspace settings:

{
    "boot-java.remote-apps": [
        {
            "jmxurl" : "service:jmx:rmi://localhost:41383/jndi/rmi://localhost:41383/jmxrmi",
            "host" : "localhost:8080"
        }
    ]
}

Now, although the vscode extension and (boot language server) isn't able to discover the running process on its own, it is able to connect to it because we have told it, via the workspace settings where to look for it.

Note: The configuration mechanism was meant mainly to allow for connecting to apps running on cloudfoundry who's JMX connections are being tunnelled via an ssh tunnel from localhost. The 'host' entry isn't really needed for most of the livehover to work, so even if you put some garbage in there you may not notice anything broken. The host is only used to show a correct hostname in the live urls computed for requestmappings. In the CF scenario there's would be no need to specify the port, so there isn't a proper way to set it. On CF the requestmappings are accessed over the normal http port on the CF host.

But when app is run locally in WSL it will probably run answering http connections on some local port (the default would be port 8080 unless user configures it explicitly). It is a bit of a 'hack' here that I appended the port 8080 at end of localhost. This makes live requestmapping urls work properly.

(comment in Pivotal Tracker added by Kris De Volder:)

On the companion github issue ticket I have documented a manual process for getting live hovers to show up for an app running on WSL.

So for the time being I'm moving the ticket out of the current milestone backlog.

I'm not sure we should/can do more. We should discuss this at next team planning meeting.

@khe817 would be great if you could double check if the described way allows you to make this work in your environment, too. I don't see us doing anything more advanced in this area in the near future to automate this specific setup, therefore it would be extremely useful to know if this works for you using the latest builds of STS4.

I tried what @kdvolder guided and it worked.

Thank you guys very much for looking into this!

That is great news, thanks for testing and letting us know, much appreciated.

Was this page helpful?
0 / 5 - 0 ratings