Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » No Xtext languages have been registered
No Xtext languages have been registered [message #1844253] Tue, 07 September 2021 08:25 Go to next message
Hung Nguyen is currently offline Hung NguyenFriend
Messages: 2
Registered: September 2021
Junior Member
Hi, I'm trying to add XText LSP to an existing XText language. What I did is I create a fresh project with the same language name and copy the ide module from the fresh XText project to the existing one.

The existing project has another class, where all the CLI operation's entry points are (let call it CLI.java). So I create a class called RunLSP inside the ide module, which contains a simple entry to ServerLauncher like this:
public class RunLSP {
	public static void run() {
		ServerLauncher.main(null);
	}
}


And then, in the CLI.java, I import RunLSP to headless and use RunLSP.run(). When the language server starts. It prints out a stack trace and complains that there is no language registered and I should put the setup class inside 'src-gen/META-INF/services/org.eclipse.xtext.ISetup'. The problem is the file is already there so I really don't know what to do.
SEVERE: Internal error: java.lang.reflect.InvocationTargetException
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.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:1130)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
        at java.base/java.lang.Thread.run(Thread.java:832)
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:64)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:564)
        at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:65)
        ... 11 more
Caused by: java.lang.IllegalStateException: No Xtext languages have been registered. Please make sure you have added the languages's setup class in '/META-INF/services/org.eclipse.xtext.ISetup'
        at org.eclipse.xtext.ide.server.LanguageServerImpl.initialize(LanguageServerImpl.java:210)
        ... 16 more


Does anyone know how to solve this? Thank you very much.
Re: No Xtext languages have been registered [message #1844272 is a reply to message #1844253] Tue, 07 September 2021 16:16 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14283
Registered: July 2009
Senior Member
Does your project use the new workflow and project setup as the wizard creates them for new projects
? Is there a meta-und/services generated in Sri-gen of ide project ?


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: No Xtext languages have been registered [message #1844312 is a reply to message #1844272] Wed, 08 September 2021 17:01 Go to previous messageGo to next message
Hung Nguyen is currently offline Hung NguyenFriend
Messages: 2
Registered: September 2021
Junior Member
Honestly I don't know, the project was create a long time ago (14 years I think). I will redirect your question to my colleagues.
Re: No Xtext languages have been registered [message #1844317 is a reply to message #1844312] Wed, 08 September 2021 18:03 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14283
Registered: July 2009
Senior Member
Then you need to port to the new workflow
(Check what the Wieses creates and or create a new project and copy code over


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Validator
Next Topic:Expression Language Formatting and Quickfixes
Goto Forum:
  


Current Time: Wed Jun 29 00:11:49 GMT 2022

Powered by FUDForum. Page generated in 0.01835 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top