-
Notifications
You must be signed in to change notification settings - Fork 455
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
Error occurred in initializing language server when opening Multi Module Maven Project in vscode #2806
Comments
@tarekahf Could you try the |
@snjeza don't worry... I figured out! |
@snjeza I tried the |
@tarekahf You can also try to set
and clean the workspace using |
Thanks a lot @snjeza I did switch to the pre-release version but this didn't solve my problem. I am now trying to open a previous Maven Based Project that I am sure was working. I will then see if the problem is due to vs code update or due to the project itself! |
@tarekahf Could you try to find the following files in your project tree:
|
Now, I tried to open another project that I am 100% sure was working before (a small maven project with a single POM.xml), and I see the following in the Language Server Output:
And, the build status keeps on spinning forever (small maven project with single POM.xml). EDIT: Could this happen (connection closed) because I am connected via Mobile Hotspot? I remember a couple of days ago, I opened the same project with the wrong I will follow the instructions you mentioned above to clean the project directory and get back to you. |
@tarekahf Could you attach this project? |
@snjeza I have another one, it's public and called I tried a no-build tool Java project, and it works fine. The problem now is only with Maven Projects. |
I duplicated of the folder used to run maven build from Eclipse where it was successful. I deleted the files you mentioned and opened the new project folder in vs code. I still see the build icon spinning forever, and I see the following in the Language Server Output:
And I see the following in the Terminal, the Build Output:
It's stuck for 5 minutes no progress. |
@tarekahf can try to set
in settings.json
|
This is a detailed update... First, I restarted my laptop to avoid any issues related to memory and conflicts with other tasks. This step made things better for sure. Also, I made sure to connect to WiFi. I opened this project
When I opened the huge multi-module maven project in vs code, I noticed if I use
It will eventually import the project and I can see them in the Java Project and Maven Views, but the build status icon on the status bar was spinning forever. Also, I saw the errors I tried again without the config mentioned above, and I can say it's about the same, and probably a bit worse (without). I think the main problem is that the project is relatively huge, and there is something causing the Language Server to restart every 2-3 minutes. I think what is happening if there are enough CPU/memory resources to compile the project to a degree where it allows the views on the left side (Java Projects and Maven) to show, in that case, I will see the project loading, but the build status is still running and will spin forever in both cases. See the attached Language Server Output log for both cases, with the config Mind you that I tried to compile using
In eclipse, to build the project, I must configure JRE properly and skip tests when running the maven build process. I think the classpath/JRE needs to be configured in POM.xml properly for the project to compile successfully without using eclipse. I am not sure if this is part of the problem. Please let me know if you have any idea how to solve the problem of the Language Server getting restarted every 2-3 minutes. Language Server Output-22-11-18 10-02am.log |
@tarekahf Could you show all your VS Code extensions?
Could you attach your settings.json?
|
@snjeza Extensions (37)
User and Workspace settings.json are attached below: user settings.json.txt Regarding the maven compile issue form command line, I did the following:
and the build was successful. I will repeat the maven compile process by changing POM.xml instead changing the environment variables. If you have any feedback please let me know. Update Regarding the multi-module project issue opening in VS Code: I tried to follow a recommendation to run the Extensions Bisect process from vs code, and I stopped since it appeared it will take a long time. It seems the bisect process disabled all extensions and then it turned them back on. I reloaded the project and left it for one hour. I came back it found out that everything was loaded and the Language Server was in a good state with a thumbs-up icon. I am now able to use the navigation section on the left to work with Java Project and Maven Views. I then reloaded the project using the command to clean Java Language Server Workspace, and I see the error "Error occurred in initializing Language Server" after a couple of minutes. Again, I ran the Extensions Bisect command and stopped it by clicking "Bad" then the project was reloaded and all look good. I see the Java Project and Maven views and run maven commands from vs code. And, the strange thing is that it was relatively fast while loading the project. I think the problem is caused by some extensions since if all extensions are disabled and enabled (after using Extensions Bisect), then the project will load. I appreciate your help! |
@snjeza today, I opened my laptop by resuming it from sleep mode. All applications were closed and started vs code, and the project loaded successfully without any problems. It took about 3-4 minutes to load, but it was successful. Also, the project is compiling successfully only after I set the PATH and JAVA_HOME to point to JDK 1.8. I still don't know if the problem is solved and am not sure how it is solved. I'll keep monitoring it and provide updates when needed. Please let me know if you have any feedback. Note: the setting |
After monitoring this issue over several days, I can say the following:
You can close this ticket now and I will create a more focused issue when I come across an apparent problem. |
Type: Bug
I checked out a Maven Project with multiple modules (main POM.xml and nested project with POM.xml files) and was able to open the project and compile it correctly using Eclipse.
However, if I check out the same project in another folder and open the project in vscode I will get an error while building the project while it is still loading. I even tried opening the same project folder that was built successfully in Eclipse, but I get the same error in vs code.
In the vscode status bar, I see the message "Error occurred in initializing language server". Then if I click on the thumbs-own icon, I see two log files which are attached below:
.log
client.log
Extension version: 0.25.6
VS Code version: Code 1.73.1 (6261075646f055b99068d3688932416f2346dd3b, 2022-11-09T04:27:29.066Z)
OS version: Windows_NT x64 10.0.19042
Modes:
Sandboxed: No
System Info
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
A/B Experiments
Extensions (37)
The text was updated successfully, but these errors were encountered: