Code Monkey home page Code Monkey logo

Comments (18)

kdvolder avatar kdvolder commented on May 16, 2024 1

Problem appears to be caused by a discrepeancy between the case (upper vs lower) of the drive-letter for uris of projects and documents. These uris come to us from different sources (one from vscode client and the other from jdt language server).

It seems that the uris end up being different. One ends up being like this: file:/C:/... where the other is file:/c:/... instead.

This makes it so that when a completion request comes in for a given document uri, when we go looking for the corresponding project, we don't find it (because of the mismatched drive-letters).

from sts4.

Unichron avatar Unichron commented on May 16, 2024 1

Yes it's also working for me with the latest nightly build. Thanks!

from sts4.

kdvolder avatar kdvolder commented on May 16, 2024

I have not seen this problem. It looks like an error coming from within vscode's implementation. But its possible this still our (STS language server's) fault somehow.

I think the first thing we need to do is get more details about the versions of 'stuff' that you are using.

I.e. are you on the latest versions of vscode and our extensions? If not, please try to upgrade.

You can check your version of vscode by running

code --version

You can check the version of spring-boot and other extensions from within vscode ui in the same view where you installed them. I can give detailed instructions if you can not figure it out. Let me know.

from sts4.

lwl19 avatar lwl19 commented on May 16, 2024

C:\Users\rush>code -v
1.24.0
6a6e02cef0f2122ee1469765b704faf5d0e0d859
x64

java version "1.8.0_172"
Java(TM) SE Runtime Environment (build 1.8.0_172-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.172-b11, mixed mode)

I found this warn always output log file
[STS4 Thread-1] WARN org.springframework.ide.vscode.commons.util.Log - Change event with bad version ignored
[STS4 Thread-1] INFO org.springframework.ide.vscode.commons.boot.app.cli.SpringBootApp - SpringBootApp disposed: Process [id=1756, name=org.codehaus.plexus.classworlds.launcher.Launcher clean]
[STS4 Thread-1] WARN org.springframework.ide.vscode.commons.util.Log - Change event with bad version ignored
[STS4 Thread-1] WARN org.springframework.ide.vscode.commons.util.Log - Change event with bad version ignored
[STS4 Thread-1] WARN org.springframework.ide.vscode.commons.util.Log - Change event with bad version ignored
[STS4 Thread-1] WARN org.springframework.ide.vscode.commons.util.Log - Change event with bad version ignored
[STS4 Thread-1] WARN org.springframework.ide.vscode.commons.util.Log - Change event with bad version ignored
[STS4 Thread-1] WARN org.springframework.ide.vscode.commons.util.Log - Change event with bad version ignored
[STS4 Thread-1] WARN org.springframework.ide.vscode.commons.util.Log - Change event with bad version ignored
[STS4 Thread-1] WARN org.springframework.ide.vscode.commons.util.Log - Change event with bad version ignored
[STS4 Thread-1] WARN org.springframework.ide.vscode.commons.util.Log - Change event with bad version ignored
[STS4 Thread-1] WARN org.springframework.ide.vscode.commons.util.Log - Change event with bad version ignored
[STS4 Thread-1] WARN org.springframework.ide.vscode.commons.util.Log - Change event with bad version ignored
[STS4 Thread-1] WARN org.springframework.ide.vscode.commons.util.Log - Change event with bad version ignored
[STS4 Thread-1] WARN org.springframework.ide.vscode.commons.util.Log - Change event with bad version ignored
[STS4 Thread-1] WARN org.springframework.ide.vscode.commons.util.Log - Change event with bad version ignored
[STS4 Thread-1] WARN org.springframework.ide.vscode.commons.util.Log - Change event with bad version ignored

from sts4.

kdvolder avatar kdvolder commented on May 16, 2024

The error log has nothing worrysome. We know what those warnings mean and they are harmlessly ignored.

Version you have is same as mine. It seems to be working for me.

Do you have the redhat Java support installed alongside the vscode-spring-boot extension?

We just released an update of the vscode-spring-boot last friday. (Version is 0.3.0). If that is the version you are using, it seems to be working for me.

That being said, we are getting the classpath from Java redhat support. And there are some potential hickups around that. If the redhat language support has problems getting classpath our extension will too, and without classpath data, there will be no completions or validations in our editor.

This may be what's happening.

Another possibility is that the java language server isn't started yet. Try to make sure that it is working properly by opening a .java file and check if Java gives content assist when you type in there (i.e. check if the java support is able find types like for example 'SpringApplication' and others like that.

from sts4.

lwl19 avatar lwl19 commented on May 16, 2024

I aways keep extensions with the latest version. All functionality is ok except when i opening .properties and .yml, the content assist is not working.

I found an error in log file:

[STS4 Thread-1] ERROR org.springframework.ide.vscode.commons.util.Log - Error
java.lang.NullPointerException
at org.springframework.ide.vscode.boot.metadata.IndexNavigator.getExtensionCandidate(IndexNavigator.java:93)
at org.springframework.ide.vscode.boot.metadata.IndexNavigator.isEmpty(IndexNavigator.java:130)
at org.springframework.ide.vscode.boot.yaml.completions.ApplicationYamlAssistContext$IndexContext.traverse(ApplicationYamlAssistContext.java:458)
at org.springframework.ide.vscode.boot.yaml.completions.ApplicationYamlAssistContext$IndexContext.traverse(ApplicationYamlAssistContext.java:386)
at org.springframework.ide.vscode.commons.yaml.path.YamlNavigable.traverseAmbiguously(YamlNavigable.java:45)
at org.springframework.ide.vscode.commons.yaml.path.YamlPath.lambda$traverseAmbiguously$0(YamlPath.java:142)
at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:267)
at java.util.stream.Streams$StreamBuilderImpl.forEachRemaining(Streams.java:419)
at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:270)
at java.util.stream.Streams$StreamBuilderImpl.tryAdvance(Streams.java:405)
at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464)
at org.springframework.ide.vscode.commons.yaml.path.AbstractYamlTraversal.traverse(AbstractYamlTraversal.java:41)
at org.springframework.ide.vscode.commons.yaml.hover.YamlHoverInfoProvider.getHoverInfo(YamlHoverInfoProvider.java:83)
at org.springframework.ide.vscode.boot.properties.BootPropertiesLanguageServerComponents.lambda$getHoverProvider$1(BootPropertiesLanguageServerComponents.java:145)
at org.springframework.ide.vscode.commons.languageserver.hover.VscodeHoverEngineAdapter.handle(VscodeHoverEngineAdapter.java:72)
at org.springframework.ide.vscode.commons.languageserver.composable.CompositeLanguageServerComponents$3.handle(CompositeLanguageServerComponents.java:109)
at org.springframework.ide.vscode.commons.languageserver.util.SimpleTextDocumentService.lambda$hover$5(SimpleTextDocumentService.java:301)
at reactor.core.publisher.MonoCallable.call(MonoCallable.java:92)
at reactor.core.publisher.FluxSubscribeOnCallable$CallableSubscribeOnSubscription.run(FluxSubscribeOnCallable.java:225)
at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:50)
at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:27)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

from sts4.

martinlippert avatar martinlippert commented on May 16, 2024

@lwl19 two more questions... :-)

Are you getting the exception mentioned above ([STS4 Thread-1] WARN org.springframework.ide.vscode.commons.util.Log - Change event with bad version ignored ) when working with VSCode?

And can you maybe share an example project that reproduces this behavior and the new exception that you posted a moment ago? That would be awesome.

from sts4.

kdvolder avatar kdvolder commented on May 16, 2024

I pushed a small change that should avoid the NPE. I don't think it will fix the real problem though. We don't really know what it is yet. I'm still thinking it's something about the project somehow interfering with obtain properties metadata.

@lwl19 Does the project build fine when you run a maven build from the commandline? I.e. something like 'mvn clean package'.

Secondly, do you see activity in the log like this:

[STS4 Thread-1] INFO org.springframework.ide.vscode.boot.jdt.ls.JdtLsProjectCache - Project Created: file:/home/kdvolder/tmp/hello-world-service
[STS4 Thread-1] INFO org.springframework.ide.vscode.boot.jdt.ls.JdtLsProjectCache - Classpath has 81 entries 69 source attachements

I'm trying determine if spring-boot extension is obtaining proper classpath data from the java language server.

from sts4.

lwl19 avatar lwl19 commented on May 16, 2024

@martinlippert My project based on Spring Initializr to generate a simple quickstart.
"Change event with bad version ignored"
That warn appeared in my any spring project when working with VSCode.
@kdvolder I guess that is my network interfere with obtain properties metadata. (GWF:https://en.wikipedia.org/wiki/Great_Firewall)

from sts4.

kdvolder avatar kdvolder commented on May 16, 2024

"Change event with bad version ignored"

This is harmless. Vscode is sending redundant change events sometimes (e.g. when a file is saved for example). Our language server ignores the events and logs a warning, but it shouldn't cause any problems.

I guess that is my network interfere with obtain properties metadata.

It could be, but since the metadata is embedded inside of the project dependencies (in the jar files) there would be other signs of trouble. (E.g. I'd expect you have problems with the general Java file editing completions etc. if the java tooling cannot download the jar dependencies from maven).

from sts4.

lwl19 avatar lwl19 commented on May 16, 2024

stsjdt.log
vscode-spring-boot-1532072418511.log

I found "/redhat.java/jdt_ws/jdt.ls-java-project/src" and "/redhat.java/jdt_ws/jdt.ls-java-project/bin" is empty folder,that would be signs of trouble.
"executing callback sts4.classpath.GqzfYCCz jdt.ls-java-project false 19".

from sts4.

kdvolder avatar kdvolder commented on May 16, 2024

The logs don't show anything unexpected. So still a mystery what might be the problem. From the file paths I see in the logs, I gather you are on Windows. In theory it shouldn't matter, but we are all on Mac / Linux ourselves so we don't test as much on Windows. It is possible that we have a bug of some kind that makes things not work on Windows. I'm putting a ticket in our internal tracker to remind us to do some windows testing soon.

from sts4.

Unichron avatar Unichron commented on May 16, 2024

Hi,
I have the exact same problem. I tested it with the latest version of code and the extension on two different machines running Windows 10. I also updated the jdk to 181, no luck. Tried running code as admin, nothing changed. I tested it with a basic project generated with initializr, no dependencies, no additional code, compiles fine, java autocomplete works fine.

vscode-spring-boot.log:
[main] INFO org.springframework.ide.vscode.commons.util.Log - Starting LS
[main] INFO org.springframework.ide.vscode.commons.util.Log - Connected to parent using socket on port 45556
[STS4 Thread-1] INFO org.springframework.ide.vscode.boot.jdt.ls.JdtLsProjectCache - Project Created: file:/C:/dev/propsdemo
[STS4 Thread-1] INFO org.springframework.ide.vscode.boot.jdt.ls.JdtLsProjectCache - Classpath has 99 entries 82 source attachements
[STS4 Thread-1] INFO org.springframework.ide.vscode.boot.jdt.ls.JdtLsProjectCache - Project Created: file:/C:/Users/Uni/AppData/Roaming/Code/User/workspaceStorage/7920618386cb2287750eeae935ff2ca3/redhat.java/jdt_ws/jdt.ls-java-project
[STS4 Thread-1] INFO org.springframework.ide.vscode.boot.jdt.ls.JdtLsProjectCache - Classpath has 19 entries 7 source attachements
[STS4 Thread-1] WARN org.springframework.ide.vscode.commons.util.Log - Change event with bad version ignored

from sts4.

martinlippert avatar martinlippert commented on May 16, 2024

This is indeed strange. Can you attach the sample project? Just curious to double check the exact same project here to see if this is related to the environment or to something else.

from sts4.

Unichron avatar Unichron commented on May 16, 2024

It's just a default generated project from https://start.spring.io/, didn't change a bit.

from sts4.

kdvolder avatar kdvolder commented on May 16, 2024

I think both @Unichron and @lwl19 are on Windows. So I will do some Window's testing today. I'll have to set things up on a VM. It seems the most likely explanation is some type of bug that breaks things on Windows.

from sts4.

kdvolder avatar kdvolder commented on May 16, 2024

I'm trying it right now on Windows 10 VM and I can confirm that it is also not working for me.

Steps I did to reproduce this:

  • startup vscode
  • use the intializer extension from miscrosoft (installed via vscode marketplace) to create a simple boot app with actuator and web dependencies.
  • open main java file in vscode editor. Allow some time to initialize various stuff in java language server.
  • open application.properties
  • try invoking some completions.
    => no suggestions.

At first glance, from the output in server log it seems like the language server is receiving classpath data. I will have to setup a debug environment to see what it actually does with the data and try to determine where/if/why it might be going wrong reading metadata from the classpath jars.

from sts4.

kdvolder avatar kdvolder commented on May 16, 2024

Tested with latest snapshot build. Is working now for me. There will be new release on vscode marketplace in a couple of days (tomorrow, if all goes according to plan :-).

If you want to test it now rather than wait, you can install the snapshot which you can download here:

http://dist.springsource.com/snapshot/STS4/nightly-distributions.html

Instructions on installing a .vsix file here (near bottom of the page): https://github.com/spring-projects/sts4/blob/master/vscode-extensions/vscode-spring-boot/README.md

from sts4.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.