Skip to content
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

POM Editor randomly report invalid errors (synchronisation issue?) #474

Open
glhez opened this issue Jan 3, 2022 · 4 comments
Open

POM Editor randomly report invalid errors (synchronisation issue?) #474

glhez opened this issue Jan 3, 2022 · 4 comments

Comments

@glhez
Copy link

glhez commented Jan 3, 2022

I am using the latest Eclipse 2021.12 with "M2E - POM Editor using LemMinX language server (includes Incubating components) " 1.18.3.20211116-0804 on Windows 10.

When I edit an XML document, the editor triggers validation using Lemminx and there I have those kind of problems which randomly spawn.

Non-parseable POM : expected START_TAG or END_TAG not TEXT (position: TEXT seen ...ency><d... @33:139)
The element type "artifactId" must be terminated by the matching end-tag "".

The pom.xml is valid and there is errors in it using another XML editor (jedit, ...).

  • If I remove the error from the Problem view, add some space, then save, the Editor spawn the exact same error.
  • If I introduce another error (for example, a space in some tag, like </pro ject>), the previous errors stick.
  • If I kill language server, remove the error, then I no longer have such errors.

I activated the language server logs (I can't provide the pom.xml) and had this exception:

java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:67)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.request(GenericEndpoint.java:120)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleRequest(RemoteEndpoint.java:261)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:190)
	at org.eclipse.lsp4e.LanguageServerWrapper.lambda$4(LanguageServerWrapper.java:260)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:194)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94)
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:65)
	... 12 more
Caused by: java.lang.UnsupportedOperationException
	at org.eclipse.lsp4j.services.LanguageClient.configuration(LanguageClient.java:139)
	... 17 more

I don't think it is related, and it does not get reported in Eclipse error log.

The log entry after correspond to the two error that shows in the Problem view.

Notes

  • I have this error since pretty much the integration of Lemminx into m2e-core.
  • I rarely use the POM editor as it happens to lock the workspace for too much space when I edit the file, because it tries to change the project, which in turns rebuild too much thing. In some rare case, this cause some kind of dead lock to Eclipse when m2e tries to download some stuff and block the workspace. I'm forced to kill Eclipse.
  • Please let me know if this should rather be a Lemminx issue - I don't edit XML document that much in Eclipse, but I don't remember seeing it in web.xml for example
@elipsed
Copy link

elipsed commented Jan 7, 2022

I am also having this issue.

I am using this version (M2E - Maven Integration for Eclipse (includes Incubating components) 1.19.0.20211116-0804)

I can recreate simply by converting an existing java project to the Maven nature. It will create a default pom.xml. If I then open up the pom.xml in Eclipse and paste in a couple of dependencies (apache commons, etc), I can save the file without issue.

Then if I rebuild or update maven, after a while I will get this error.

image

image

The pom.xml has been validated successfully using other XML editors. I have checked for control characters and found nothing.

@mickaelistria
Copy link
Contributor

Indeed, it looks like either some events were not sent to the LemMinX language server, or that LemMinX failed at processing some of them. Can you please enable "log to file" for LemMinX in the preferences > Language Servers > Logs, and then share the end of this file whenever such sync issue happens?

@glhez
Copy link
Author

glhez commented Jan 12, 2022

I don't know if I can share (work related stuff).
However, I think this is more a XML Language Server problem than m2e-core: on an XML editor, I have the exact same problem.

The file is a JNLP file and I get this error:

Element type "j" must be followed by either attribute specifications, ">" or "/>".

Of course, the file is correct.
In this case, closing all editor (but a Java one) and opening XML again fixed the problem.

I think in the case of POM it stick longer (I know that when you close all editor, normally the XML Language Server closes, but I do remember doing so last time I had the problem and it did not fix anything.

@glhez
Copy link
Author

glhez commented Feb 22, 2025

Just to say the problem is still present in Eclipse 2024-12.
Strangely enough, I have this problem only at work : I suppose there is something that stick between Eclipse and LSP4E (An AV ?) making it laggy enough.
Would be cool to have a "force send" to Language Server so that it does not try to be "smart" by only revalidating what's changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants