spring-projects / sts4

The next generation of tooling for Spring Boot, including support for Cloud Foundry manifest files, Concourse CI pipeline definitions, BOSH deployment manifests, and more... - Available for Eclipse, Visual Studio Code, and Theia
https://spring.io/tools
Eclipse Public License 1.0
869 stars 203 forks source link

Can't start Spring Boot Demo application #279

Closed pra-bhu closed 3 years ago

pra-bhu commented 5 years ago

Issue Type: Performance Issue

I'm not sure what's wrong here. I just loaded the default Spring Boot app and it fails to run. It takes forever to load the dependencies, compilation and spring board doesn't even shows the app. below is the vscode-spring-boot-debug-log vscode-spring-boot-debug-log.log

Extension version: 0.0.8 VS Code version: Code 1.33.1 (51b0b28134d51361cf996d2f0a1c698247aeabd8, 2019-04-11T08:20:22.771Z) OS version: Linux x64 4.18.0-17-generic

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i3-3227U CPU @ 1.90GHz (4 x 1352)| |GPU Status|2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: disabled_software
surface_synchronization: enabled_on
video_decode: unavailable_off
webgl: enabled
webgl2: enabled| |Load (avg)|1, 1, 1| |Memory (System)|3.74GB (0.12GB free)| |Process Argv|--unity-launch| |Screen Reader|no| |VM|0%|
Process Info ``` CPU % Mem MB PID Process 1 107 4316 code main 0 23 4320 zygote 0 210 4366 window (DemoApplication.java - Untitled (Workspace) - Visual Studio Code) 0 4 4835 /usr/bin/zsh 0 184 4843 extensionHost 0 61 5236 electron_node server.js 0 467 5245 /usr/lib/jvm/java-8-oracle/bin/java -Declipse.application=org.eclipse.jdt.ls.core.id1 -Dosgi.bundles.defaultStartLevel=4 -Declipse.product=org.eclipse.jdt.ls.core.product -Dfile.encoding=utf8 -noverify -Xmx1G -XX:+UseG1GC -XX:+UseStringDeduplication -jar /home/prashant/.vscode/extensions/redhat.java-0.43.0/server/plugins/org.eclipse.equinox.launcher_1.5.300.v20190213-1655.jar -configuration /home/prashant/.vscode/extensions/redhat.java-0.43.0/server/config_linux -data /home/prashant/.config/Code/User/workspaceStorage/5ec7987883374fe78e0da3071eee271b/redhat.java/jdt_ws 0 38 5014 watcherService 0 34 5166 searchService 0 73 4809 shared-process 0 54 5233 window (undefined) 2 96 6714 window (Issue Reporter) 0 92 4352 gpu-process 0 0 6739 /bin/sh -c /bin/ps -ax -o pid=,ppid=,pcpu=,pmem=,command= 0 0 6740 /bin/ps -ax -o pid=,ppid=,pcpu=,pmem=,command= ```
Workspace Info ``` | Window (DemoApplication.java - Untitled (Workspace) - Visual Studio Code) | Folder (course_api): 27 files | File types: prefs(4) properties(3) java(3) json(2) attach_pid3288(1) | attach_pid5377(1) attach_pid5578(1) classpath(1) | gitignore(1) attach_pid28331(1) | Conf files: launch.json(1); ```
kdvolder commented 5 years ago

I just loaded the default Spring Boot app and it fails to run.

Sorry, what app is that? As far as I know when we ship STS it doesn't come with a 'default app' so I don't know what you mean.

It takes forever to load the dependencies, compilation and spring board doesn't even shows the app.

Loading dependencies can take a while, it depends on internet connection speed amongst other things.

spring board doesn't even shows the app

With spring board you mean this I presume? https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-spring-boot-dashboard

Unless dependencies are loaded... this is somewhat normal since the determination of whether the app is a boot app is based on its dependencies. So, no dependencies means the app is not going to show.

I'd like to get to the bottom of this but without some detailed information from you on how to reproduce this that's going to be hard/impossible. So if you try and write down a set of steps on how you setup your workspace i.e.

pra-bhu commented 5 years ago

what tooling did you install exactly (vs code extensions I gather, but which ones?)

Thanks for your response. I have attached the sample application which I generated from maven-archetype.(spring-boot-blank-archetype) spring_boot.zip PFA Logs are attached in the previous post.

what other steps do you do to try to 'run' the app. I added few dependencies on my own . You can check that in the pom.xml.

Extensions that I have installed are: 1) Java Extension Pack 0.6.0 2) Spring Boot Extension Pack

Following is the entire list: code --install-extension adashen.vscode-tomcat code --install-extension alphabotsec.vscode-eclipse-keybindings code --install-extension anseki.vscode-color code --install-extension christian-kohler.path-intellisense code --install-extension CoenraadS.bracket-pair-colorizer code --install-extension dbaeumer.vscode-eslint code --install-extension eamodio.gitlens code --install-extension EditorConfig.EditorConfig code --install-extension EQuimper.react-native-react-redux code --install-extension esbenp.prettier-vscode code --install-extension faustinoaq.javac-linter code --install-extension felipecaputo.git-project-manager code --install-extension formulahendry.auto-close-tag code --install-extension formulahendry.auto-complete-tag code --install-extension formulahendry.auto-rename-tag code --install-extension HookyQR.beautify code --install-extension humao.rest-client code --install-extension joelday.docthis code --install-extension kumar-harsh.graphql-for-vscode code --install-extension ms-vscode.vscode-typescript-tslint-plugin code --install-extension oderwat.indent-rainbow code --install-extension Pivotal.vscode-boot-dev-pack code --install-extension Pivotal.vscode-concourse code --install-extension Pivotal.vscode-manifest-yaml code --install-extension Pivotal.vscode-spring-boot code --install-extension redhat.java code --install-extension ritwickdey.LiveServer code --install-extension SirTori.indenticator code --install-extension sohibe.java-generate-setters-getters code --install-extension SolarLiner.linux-themes code --install-extension streetsidesoftware.code-spell-checker code --install-extension TimonVS.ReactSnippetsStandard code --install-extension VisualStudioExptTeam.vscodeintellicode code --install-extension vscjava.vscode-java-debug code --install-extension vscjava.vscode-java-dependency code --install-extension vscjava.vscode-java-pack code --install-extension vscjava.vscode-java-test code --install-extension vscjava.vscode-maven code --install-extension vscjava.vscode-spring-boot-dashboard code --install-extension vscjava.vscode-spring-initializr code --install-extension vscode-icons-team.vscode-icons code --install-extension WallabyJs.quokka-vscode code --install-extension wayou.vscode-todo-highlight code --install-extension wix.vscode-import-cost code --install-extension xabikos.JavaScriptSnippets

Let me know if there's anything else we need to get it resolved. I really appreciate your attention. Thanks a ton.

kdvolder commented 5 years ago

what other steps do you do to try to 'run' the app.

I added few dependencies on my own . You can check that in the pom.xml.

That still doesn't say how you run the app. Do you use a specific UI / command contributed by one of the installed extensions? Since this is precisely the step that you claim is failing, it is good to precisely describe exactly what you do. Anyway... I will try to find some time later to reproduce the problem. There's probably enough information now :-)

pra-bhu commented 5 years ago

Screenshot from 2019-04-25 21-42-12 Hey, I tried uninstalling the jdk and adding a new one. Now the app is running(Which is a huge relief) but with certain Problems which I'm unable to understand why? Proper libraries and dependencies have been included. The app runs but still specific 4 Problems keeps popping. Can you please explain?

kdvolder commented 5 years ago

The app runs but still specific 4 Problems keeps popping. Can you please explain?

No I really can't. I mean how could I you don't even describe the problems? I really can't guess what the problems are or why they happen.

The first thing you want to do is try and see if this is a problem with your app or something caused by the tools (vscode / STS / ...). The best way to do that is try and build and run your app from the commandline. If you see the same problems when you run it like that, then the problem is something actually wrong with your project. If it works properly on the commandline, then its more likely a problem with the tooling.

Edit: Oh okay I think your screenshot show some compile errors in vscode. Okay... I can make a guess about that. By changing the JVM, I suspect vscode Java tooling may have gotten confused about the JVM and the project's classpath. What you could try is to completely 'reset' the project state like this:

a) close vscode. b) cleanout any/all Eclipse metadata from the projects on disk (under the hood, vscode-java actually uses Eclipse jdt). Try and find all files folders called .project, .classpath and .settings. Delete all of them. c) re-open vscode

I think that should force vscode-java to re-create the project metadata from scratch and that might fix your problem (though I'm not 100% sure since I still don't quite understand the actual problem's cause).

martinlippert commented 3 years ago

Closing this one here now due to no further activity for quite a bit of time. If you come across this issue again or something related, please comment and we can re-open or raise a new issue and we will investigate.