Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » error when generating language
error when generating language [message #874675] Mon, 21 May 2012 10:49 Go to next message
Vlad Dumitrescu is currently offline Vlad DumitrescuFriend
Messages: 431
Registered: July 2009
Location: Gothenburg
Senior Member
Hi,

I tried to regenerate my language files today for the first time with M7 and I get an exception that ultimately is caused by the following:

Caused by: java.lang.IllegalStateException: Couldn't find resource on classpath. URI was 'classpath:/org/eclipse/xtext/example/arithmetics/Arithmetics.xtext'
at org.eclipse.xtext.resource.ClassloaderClasspathUriResolver.findResourceOnClasspath(ClassloaderClasspathUriResolver.java:60)
at org.eclipse.xtext.resource.ClassloaderClasspathUriResolver.resolve(ClassloaderClasspathUriResolver.java:45)

This is with freshly generated Arithmetics projects, but happens with all my Xtext projects. Is it a bug or a misconfiguration?

regards,
Vlad
Re: error when generating language [message #874682 is a reply to message #874675] Mon, 21 May 2012 11:02 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Looks like https://bugs.eclipse.org/bugs/show_bug.cgi?id=379903; try a
very recent N-build.

Regards

Ed Willink


On 21/05/2012 11:50, Vlad Dumitrescu wrote:
> Hi,
>
> I tried to regenerate my language files today for the first time with
> M7 and I get an exception that ultimately is caused by the following:
>
> Caused by: java.lang.IllegalStateException: Couldn't find resource on
> classpath. URI was
> 'classpath:/org/eclipse/xtext/example/arithmetics/Arithmetics.xtext'
> at
> org.eclipse.xtext.resource.ClassloaderClasspathUriResolver.findResourceOnClasspath(ClassloaderClasspathUriResolver.java:60)
> at
> org.eclipse.xtext.resource.ClassloaderClasspathUriResolver.resolve(ClassloaderClasspathUriResolver.java:45)
>
> This is with freshly generated Arithmetics projects, but happens with
> all my Xtext projects. Is it a bug or a misconfiguration?
>
> regards,
> Vlad
>
Re: error when generating language [message #874702 is a reply to message #874682] Mon, 21 May 2012 11:44 Go to previous messageGo to next message
Vlad Dumitrescu is currently offline Vlad DumitrescuFriend
Messages: 431
Registered: July 2009
Location: Gothenburg
Senior Member
Thank you Ed, but it doesn't help. I tried 2.3.0.v201205201426 and the result is below. It seems weird it looks for jars like that, outside the workspace.

regards, Vlad

0 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Registering platform uri '/home/qvladum'
8851 [main] WARN lipse.emf.mwe.utils.StandaloneSetup - Could not open Jar file /home/qvladum/workspace_shade_new/org.eclipse.xtext.example.arithmetics/../org.eclipse.xtext.example.arithmetics/../../dumpviewer/solaris_32/swt/swt.jar.
35176 [main] WARN lipse.emf.mwe.utils.StandaloneSetup - Could not open Jar file /home/qvladum/workspace_shade_new/org.eclipse.xtext.example.arithmetics/../org.eclipse.xtext.example.arithmetics/../../antlr/antlr-3.4/antlr-ant/main/antlr3-task/._antlr3.jar.
35253 [main] WARN lipse.emf.mwe.utils.StandaloneSetup - Could not open Jar file /home/qvladum/workspace_shade_new/org.eclipse.xtext.example.arithmetics/../org.eclipse.xtext.example.arithmetics/../../antlr/antlr-3.4/lib/._antlr-3.4-complete.jar.
35259 [main] WARN lipse.emf.mwe.utils.StandaloneSetup - Could not open Jar file /home/qvladum/workspace_shade_new/org.eclipse.xtext.example.arithmetics/../org.eclipse.xtext.example.arithmetics/../../antlr/antlr-3.4/runtime/ActionScript/project/lib/._FlexAntTasks.jar.
41109 [main] WARN lipse.emf.mwe.utils.StandaloneSetup - Could not open Jar file /home/qvladum/workspace_shade_new/org.eclipse.xtext.example.arithmetics/../org.eclipse.xtext.example.arithmetics/../../eclipse38/eclipse/p2/org.eclipse.equinox.p2.repository/cache/content-308036385.jar.
43707 [main] WARN lipse.emf.mwe.utils.StandaloneSetup - Could not open Jar file /home/qvladum/workspace_shade_new/org.eclipse.xtext.example.arithmetics/../org.eclipse.xtext.example.arithmetics/../../eclipse37_target/eclipse/p2/org.eclipse.equinox.p2.repository/cache/content-308036385.jar.
49175 [main] ERROR mf.mwe2.launch.runtime.Mwe2Launcher - Problems instantiating module org.eclipse.xtext.example.arithmetics.Arithmetics: java.lang.reflect.InvocationTargetException
java.lang.RuntimeException: Problems instantiating module org.eclipse.xtext.example.arithmetics.Arithmetics: java.lang.reflect.InvocationTargetException
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:95)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:62)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:52)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:74)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:35)
Caused by: org.eclipse.emf.common.util.WrappedException: java.lang.reflect.InvocationTargetException
at org.eclipse.emf.mwe2.language.factory.SettingProviderImpl$1$1.setValue(SettingProviderImpl.java:56)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalApplyAssignments(Mwe2ExecutionEngine.java:143)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.inCase(Mwe2ExecutionEngine.java:114)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:291)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalSwitch(Mwe2ExecutionEngine.java:66)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalApplyAssignments(Mwe2ExecutionEngine.java:142)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.inCase(Mwe2ExecutionEngine.java:114)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:291)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalSwitch(Mwe2ExecutionEngine.java:66)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalApplyAssignments(Mwe2ExecutionEngine.java:142)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.inCase(Mwe2ExecutionEngine.java:114)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:291)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalSwitch(Mwe2ExecutionEngine.java:66)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.inCase(Mwe2ExecutionEngine.java:80)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:291)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalSwitch(Mwe2ExecutionEngine.java:66)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.create(Mwe2ExecutionEngine.java:62)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:93)
... 4 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.emf.mwe2.language.factory.SettingProviderImpl$1$1.setValue(SettingProviderImpl.java:54)
... 37 more
Caused by: org.eclipse.xtext.resource.ClasspathUriResolutionException: java.lang.IllegalStateException: Couldn't find resource on classpath. URI was 'classpath:/org/eclipse/xtext/example/arithmetics/Arithmetics.xtext'
at org.eclipse.xtext.resource.ClassloaderClasspathUriResolver.resolve(ClassloaderClasspathUriResolver.java:48)
at org.eclipse.xtext.resource.XtextResourceSet.resolveClasspathURI(XtextResourceSet.java:69)
at org.eclipse.xtext.resource.XtextResourceSet.access$1(XtextResourceSet.java:68)
at org.eclipse.xtext.resource.XtextResourceSet$1.normalize(XtextResourceSet.java:125)
at org.eclipse.xtext.resource.XtextResourceSet.getResource(XtextResourceSet.java:87)
at org.eclipse.xtext.generator.LanguageConfig.setUri(LanguageConfig.java:179)
... 42 more
Caused by: java.lang.IllegalStateException: Couldn't find resource on classpath. URI was 'classpath:/org/eclipse/xtext/example/arithmetics/Arithmetics.xtext'
at org.eclipse.xtext.resource.ClassloaderClasspathUriResolver.findResourceOnClasspath(ClassloaderClasspathUriResolver.java:60)
at org.eclipse.xtext.resource.ClassloaderClasspathUriResolver.resolve(ClassloaderClasspathUriResolver.java:45)
... 47 more
Re: error when generating language [message #874808 is a reply to message #874702] Mon, 21 May 2012 15:30 Go to previous messageGo to next message
Vlad Dumitrescu is currently offline Vlad DumitrescuFriend
Messages: 431
Registered: July 2009
Location: Gothenburg
Senior Member
I tested on several other machines and it works there. So it's not a problem with Xtext itself, but some interaction with the environment. I will dig further, but if anyone has any idea to what could cause this problem, I'll be thankful!

regards,
Vlad
Re: error when generating language [message #875127 is a reply to message #874808] Tue, 22 May 2012 07:43 Go to previous messageGo to next message
Vlad Dumitrescu is currently offline Vlad DumitrescuFriend
Messages: 431
Registered: July 2009
Location: Gothenburg
Senior Member
Ok, with a fresh eclipse and a fresh workspace, it works again. I hope it's not something that will need to be done too often...

regards,
Vlad
Re: error when generating language [message #910975 is a reply to message #875127] Mon, 10 September 2012 18:25 Go to previous message
Michael Bischoff is currently offline Michael BischoffFriend
Messages: 19
Registered: August 2012
Junior Member
Hello,
I had the same problem. It occurred on grammars which worked before, with a fresh git checkout.

For me, the solution was to create the folder src-gen in the DSL project and the DSL.ui project. Afterwards, a rerun of "Run as... create xtext artifacts" on the .xtext file, followed by an Eclipse "clean project & rebuild" worked.

Best regards,
Michael
Previous Topic:code generation in java
Next Topic:change type of problem markers
Goto Forum:
  


Current Time: Thu Apr 18 04:28:31 GMT 2024

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

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

Back to the top