sts4 icon indicating copy to clipboard operation
sts4 copied to clipboard

An internal error occurred during: "Send Classpath Notifications". org/eclipse/lsp4e/LanguageServers

Open shubhamkundal opened this issue 1 year ago • 20 comments

whenever creating or updating meven(SpringBoot) project getting error as "An internal error occurred during: "Send Classpath Notifications".org/eclipse/lsp4e/LanguageServers". Due to this not able to connect datasource also. Please help.

shubhamkundal avatar Jan 31 '24 13:01 shubhamkundal

Can you please share more information? Which version of the Spring Tools do you use? For VSCode? The Eclipse-based distribution? Where does the error show up? Is there a stack trace showing up somewhere (in case of Eclipse in the Error Log View, for example)? Do you have steps how to reproduce this error? Or a sample project?

martinlippert avatar Jan 31 '24 14:01 martinlippert

yes I can reproduce this error but stacktrace is not there in logs

Screenshot 2024-01-31 204235

shubhamkundal avatar Jan 31 '24 15:01 shubhamkundal

while updating the project and while adding any dependency this error is coming

shubhamkundal avatar Jan 31 '24 15:01 shubhamkundal

Okay, so this is the Eclipse-based tooling. Do you use the Spring Tools for Eclipse distribution or did you install the Spring Tools as an additional plugin to your existing Eclipse installation? It seems to me like something went wrong during the install process, maybe some parts of a specific component did not get installed correctly.

Please also take a look at the Error Log view to se if there is some related item showing up with more information. You could also enable the additional logging of the language server process via the Preferences -> Language Servers -> Spring Language Servers, and enable the Logging to Console option there. After a restart of the IDE, this change should be active and you might see additional log output appearing in the console view. Please paste that output here as well.

martinlippert avatar Jan 31 '24 15:01 martinlippert

please find additional logs below :

21:19:32.896 [main] INFO o.s.i.v.b.a.BootLanguageServerBootApp - Starting BootLanguageServerBootApp using Java 17.0.2 with PID 9524 (C:\Users\Admin.p2\pool\plugins\org.springframework.tooling.boot.ls_1.51.0.202312011752\servers\spring-boot-language-server\BOOT-INF\classes started by Admin in C:\Users\Admin\Desktop) 21:19:32.901 [main] INFO o.s.i.v.b.a.BootLanguageServerBootApp - No active profile set, falling back to 1 default profile: "default" 21:19:35.618 [main] INFO o.s.i.v.boot.app.SpringSymbolIndex - project listener registered 21:19:36.297 [main] INFO o.s.i.v.b.a.BootLanguageServerBootApp - Started BootLanguageServerBootApp in 5.602 seconds (process running for 19.347) 21:19:36.302 [main] INFO o.s.i.v.c.l.LanguageServerRunner - java.home = C:\Program Files\Java\jdk-17.0.2 21:19:36.307 [LanguageServerApp-lifecycle] INFO o.s.i.v.c.l.LanguageServerRunner - Server ready to start after 19358 ms 21:19:36.307 [LanguageServerApp-lifecycle] INFO o.s.i.v.c.l.LanguageServerRunner - Starting LS as client 21:19:36.308 [LanguageServerApp-lifecycle] INFO o.s.i.v.c.l.LanguageServerRunner - Connected to parent using stdio 21:19:36.631 [pool-13-thread-1] INFO o.s.i.v.c.l.u.SimpleLanguageServer - Initializing 21:19:36.691 [pool-13-thread-1] INFO o.s.i.v.c.l.u.CompletionServerCapabilityRegistration - hasDynamicCompletionRegistration = false 21:19:36.694 [pool-13-thread-1] INFO o.s.i.v.c.l.u.CompletionServerCapabilityRegistration - Registering Completion Capability Statically 21:19:36.695 [pool-13-thread-1] INFO o.s.i.v.c.l.u.SimpleLanguageServer - Returning server capabilities to client 21:19:36.827 [pool-13-thread-1] INFO o.s.i.v.c.l.u.SimpleTextDocumentService - change arrived: 1 21:19:36.858 [Simple-Language-Server main thread] INFO o.s.i.v.b.a.BootVersionValidationConfig - Started Boot Version reconciler 21:19:36.876 [Simple-Language-Server main thread] INFO o.s.i.v.b.jdt.ls.JdtLsProjectCache - INIT CLASSPATH LISTENER enableClasspath=true 21:19:36.885 [Simple-Language-Server main thread] INFO o.s.i.v.b.jdt.ls.JdtLsProjectCache - Enable classpath listener enabled = true current enablement = false 21:19:36.892 [Simple-Language-Server main thread] INFO o.s.i.v.b.jdt.ls.JdtLsProjectCache - Adding classpath listener enabled=true 21:19:36.894 [Simple-Language-Server main thread] INFO o.s.i.v.b.jdt.ls.JdtLsProjectCache - Project Observer is supported 21:19:36.928 [pool-13-thread-1] INFO o.s.i.v.b.j.u.CompilationUnitCache - Invalidate AST for file:///C:/Users/Admin/Desktop/SpringBoot/Boot04-BulkLoadingApp/src/main/java/in/ineuron/comp/Company.java 21:19:36.953 [pool-5-thread-3] INFO o.s.i.v.b.j.u.CompilationUnitCache - CU Cache: work item submitted for doc file:///C:/Users/Admin/Desktop/SpringBoot/Boot04-BulkLoadingApp/src/main/java/in/ineuron/comp/Company.java 21:19:36.954 [pool-5-thread-1] INFO o.s.i.v.b.j.u.CompilationUnitCache - CU Cache: work item submitted for doc file:///C:/Users/Admin/Desktop/SpringBoot/Boot04-BulkLoadingApp/src/main/java/in/ineuron/comp/Company.java 21:19:36.957 [pool-5-thread-2] INFO o.s.i.v.b.j.u.CompilationUnitCache - CU Cache: work item submitted for doc file:///C:/Users/Admin/Desktop/SpringBoot/Boot04-BulkLoadingApp/src/main/java/in/ineuron/comp/Company.java 21:19:37.100 [Simple-Language-Server main thread] INFO o.s.i.v.c.l.u.SimpleLanguageServer - Initialization completed after 20150 ms 21:19:37.105 [Simple-Language-Server main thread] INFO o.s.i.v.boot.app.SpringSymbolIndex - update settings of spring indexer - start 21:19:37.110 [Simple-Language-Server main thread] INFO o.s.i.v.boot.app.SpringSymbolIndex - update settings of spring indexer - done 21:19:37.115 [Simple-Language-Server main thread] INFO o.s.i.v.b.j.BootJavaLanguageServerComponents - update live process tracker settings - start 21:19:37.115 [Simple-Language-Server main thread] INFO o.s.i.v.b.j.BootJavaLanguageServerComponents - update live process tracker settings - done 21:19:37.116 [Simple-Language-Server main thread] INFO o.s.i.v.b.a.BootLanguageServerInitializer - Triggering reconcile on all open documents 21:19:37.122 [Simple-Language-Server main thread] INFO o.s.i.v.b.j.l.v.SpringProcessConnectorRemote - updating settings for remote processses to track - start 21:19:37.123 [Simple-Language-Server main thread] INFO o.s.i.v.b.j.l.v.SpringProcessConnectorRemote - updating settings for remote processses to track - done 21:19:37.123 [Simple-Language-Server main thread] INFO o.s.i.v.boot.app.SpringSymbolIndex - update settings of spring indexer - start 21:19:37.124 [Simple-Language-Server main thread] INFO o.s.i.v.boot.app.SpringSymbolIndex - update settings of spring indexer - done 21:19:37.125 [Simple-Language-Server main thread] INFO o.s.i.v.b.j.BootJavaLanguageServerComponents - update live process tracker settings - start 21:19:37.125 [Simple-Language-Server main thread] INFO o.s.i.v.b.j.BootJavaLanguageServerComponents - update live process tracker settings - done 21:19:37.125 [Simple-Language-Server main thread] INFO o.s.i.v.b.a.BootLanguageServerInitializer - Triggering reconcile on all open documents 21:19:37.134 [Simple-Language-Server main thread] INFO o.s.i.v.b.j.l.v.SpringProcessConnectorRemote - updating settings for remote processses to track - start 21:19:37.135 [Simple-Language-Server main thread] INFO o.s.i.v.b.j.l.v.SpringProcessConnectorRemote - updating settings for remote processses to track - done

shubhamkundal avatar Jan 31 '24 15:01 shubhamkundal

That looks reasonably okay. What about the Error Log View entries?

martinlippert avatar Jan 31 '24 16:01 martinlippert

This error is coming when I am trying to start eclipse, this logs are for that only, when trying to update the mevan project that time also error is coming but logs are not printed image

shubhamkundal avatar Jan 31 '24 16:01 shubhamkundal

this is when running application in debug mode

image

shubhamkundal avatar Jan 31 '24 16:01 shubhamkundal

eclipse version is 2022-12

shubhamkundal avatar Jan 31 '24 16:01 shubhamkundal

Below mentioned error is given for application, but all dependencies are added. image

. ____ _ __ _ _ /\ / ' __ _ () __ __ _ \ \ \
( ( )_
_ | '_ | '| | ' / ` | \ \ \
\/ )| |)| | | | | || (| | ) ) ) ) ' |
| .__|| ||| |_, | / / / / =========||==============|/=//// :: Spring Boot :: (v3.1.8)

2024-01-31T22:36:15.358+05:30 INFO 6952 --- [ main] i.i.SpringBootOctTestAppApplication : Starting SpringBootOctTestAppApplication using Java 17.0.2 with PID 6952 (C:\Users\Admin\Desktop\SpringBoot\SpringBootOctTestApp\target\classes started by Admin in C:\Users\Admin\Desktop\SpringBoot\SpringBootOctTestApp) 2024-01-31T22:36:15.366+05:30 INFO 6952 --- [ main] i.i.SpringBootOctTestAppApplication : No active profile set, falling back to 1 default profile: "default" 2024-01-31T22:36:17.852+05:30 INFO 6952 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http) 2024-01-31T22:36:17.874+05:30 INFO 6952 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2024-01-31T22:36:17.874+05:30 INFO 6952 --- [ main] o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.18] 2024-01-31T22:36:18.097+05:30 INFO 6952 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 2024-01-31T22:36:18.100+05:30 INFO 6952 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 2611 ms 2024-01-31T22:36:18.254+05:30 WARN 6952 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'employeeDaoImpl': Unsatisfied dependency expressed through field 'dataSource': Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception with message: Failed to determine a suitable driver class 2024-01-31T22:36:18.260+05:30 INFO 6952 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat] 2024-01-31T22:36:18.296+05:30 INFO 6952 --- [ main] .s.b.a.l.ConditionEvaluationReportLogger :

Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled. 2024-01-31T22:36:18.342+05:30 ERROR 6952 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :


APPLICATION FAILED TO START


Description:

Failed to configure a DataSource: no embedded datasource could be configured.

Reason: Failed to determine a suitable driver class

Action:

Consider the following: If you want an embedded database (H2, HSQL or Derby), please put it on the classpath. If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).

shubhamkundal avatar Jan 31 '24 17:01 shubhamkundal

I sort of doubt that "send classpath notification" in the IDE has anything to do with the app failing to start... The classpath data is not sent from Eclipse to Boot language server. Don't think that app launching in Eclipse has anything to do with the Boot LS...

Can you run mvn spring-boot:run from the command line? Does this start your app normally?

BoykoAlex avatar Jan 31 '24 18:01 BoykoAlex

It looks to me more as you don't have DB url specified... What's the value of spring.datasource.url property? What's you DB implementation? Anything like jdbc:postgresql://localhost/petclinic? Do you see it in your application.properties?

BoykoAlex avatar Jan 31 '24 18:01 BoykoAlex

Agree, we have two different things here. One is the application not starting up, which is probably a question you should ask on StackOverflow. It doesn't seem to be related to the IDE. You can verify this my running the app from the command line (as Alex mentioned above).

The second piece is the error message about the "send classpath notification", which is clearly an IDE issue. From your screenshot, it looks like you have plenty of additional third-party plugins installed, which makes it a bit hard to debug this issue. Did you open the Error Log View in your IDE yet? How does it look like? What is listed inside?

I would also recommend to download a ready-to-use distribution of the Spring Tools 4 for Eclipse from https://spring.io/tools, start such a vanilla installation with an empty workspace, and create a simple Spring project via the wizard to Import Spring Getting Started Content, select the Rest Service guide and run that project as a reference.

martinlippert avatar Jan 31 '24 19:01 martinlippert

I'm having the same problem, but is it resolved? I'm using 2022-12 Eclipse, and I changed the JDK version to 11.

The error occurs every time I do the maven update project. I checked the error log and it is as follows.

java.lang.NoClassDefFoundError: org/eclipse/lsp4e/LanguageServers
	at org.springframework.tooling.ls.eclipse.commons.LSP4ECommandExecutor.executeClientCommand(LSP4ECommandExecutor.java:29)
	at org.springframework.tooling.jdt.ls.commons.classpath.SendClasspathNotificationsJob.flush(SendClasspathNotificationsJob.java:178)
	at org.springframework.tooling.jdt.ls.commons.classpath.SendClasspathNotificationsJob.run(SendClasspathNotificationsJob.java:149)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.lang.ClassNotFoundException: org.eclipse.lsp4e.LanguageServers cannot be found by org.springframework.tooling.ls.eclipse.commons_4.21.1.202401312010
	at org.eclipse.osgi.internal.loader.BundleLoader.generateException(BundleLoader.java:541)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass0(BundleLoader.java:536)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:416)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:168)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
	... 4 more

Springboot project execution works successfully, and I'm concerned that error keeps occurring.

image

I am using the version of sts as below.

image

khsrla9806 avatar Feb 21 '24 00:02 khsrla9806

My DB problem solved after adding driver url, which actually not required in hibernate now, but for mentioned DB error that is the resolution. For "class path notification" error there is no resolution till now. Everytime I update the maven project I get same error.

shubhamkundal avatar Feb 21 '24 04:02 shubhamkundal

@shubhamkundal are you getting exception similar to the one above. What is your JVM used to launch Boot langiage server? Once STS4 is up and running and classpath notifications exceptions are observed:

  1. Launch jconsole either from the command line prompt or from the java home bin folder
  2. Find org.springframework.ide.vscode.boot.app.BootLanguageServerBootApp process and connect to it
  3. Find Virtual Machine entry in the top cell of the table shown on VM Summary tab What's the JVM? I suspect it might be java 11...

BoykoAlex avatar Feb 21 '24 15:02 BoykoAlex

@shubhamkundal @khsrla9806 You both mentioned that you are using Eclipse 2022-12, which is a version that Spring Tools 4.21.1 doesn't support anymore. The latest version of Spring Tools supports the latest Eclipse release (2023-12) as well as the previous release (2023-09) - in case of Spring Tools 4.21.0 and 4.21.1, so there is probably a compatibility issue going on under the hood here. The java.lang.NoClassDefFoundError error points into the same direction.

I am not sure how you ended up in this situation, but we should definitely looking into ways to prevent these possibly incompatible install situations from happening. I will open a separate GitHub issue for that.

The last version that supported Eclipse 2022-12 was the Spring Tools 4.19.0 release. You can find the p2 repository here, if you want to install that version instead of the latest release: https://cdn.spring.io/spring-tools/release/TOOLS/sts4/update/4.19.0.RELEASE/e4.26/

But I would recommend to update your environment to the latest underlying Eclipse release instead and then use the latest Spring Tools release together with that. Or -to make things easier - download the Spring Tools 4.21.1 distribution build for Eclipse from https://spring.io/tools

martinlippert avatar Feb 23 '24 14:02 martinlippert

Another side note: The IDE itself requires a JDK 17 to run and you should not try to change that. But this is completely independent of the JDKs that you configure inside of the IDE to be used for your projects. There you can use whichever JDK works for the project. But keep in mind that Spring Framework 6 and Spring Boot 3 have a JDK 17 as a baseline, so running those apps with a JDK 11 doesn't work.

martinlippert avatar Feb 23 '24 14:02 martinlippert

@martinlippert spring tool 4.21.1 does not support in eclipse 2022-12???

mohitjain2000 avatar Mar 04 '24 16:03 mohitjain2000

@martinlippert spring tool 4.21.1 does not support in eclipse 2022-12???

As described in https://github.com/spring-projects/sts4/issues/1177#issuecomment-1961398759, the latest version of the Spring Tools always supports the latest Eclipse release and the one prior to that. For the Spring Tools 4.21.1, this would be Eclipse 2023-12 (latest Eclipse release) and Eclipse 2023-09, the release prior to that.

If you are using an older Eclipse version, you should stick to the corresponding Spring Tools version that is compatible with that Eclipse version: https://github.com/spring-projects/sts4/wiki/Previous-Versions

martinlippert avatar Mar 04 '24 17:03 martinlippert