Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » MWE generator can't find resource
MWE generator can't find resource [message #1076790] Wed, 31 July 2013 21:39 Go to next message
Erick Fonseca is currently offline Erick FonsecaFriend
Messages: 68
Registered: December 2011
Member
I got most of my DSL working fine on a Windows environment, and then went to test it on Linux. As soon as I hit "Generate Language Infrastructure", I got an org.eclipse.xtext.resource.FileNotFoundOnClasspathException.FileNotFoundOnClasspathException. The MWE generator couldn't find my dsl.xtext file.

At first, I noticed that the name of the DSL file had an initial uppercase letter and the variable grammarURI inside my .mwe2 file did not. I changed the grammarURI, cleaned the workspace, but the problem continues.

The error I get is utterly caused by:

Caused by: org.eclipse.xtext.resource.FileNotFoundOnClasspathException: Couldn't find resource on classpath. URI was 'classpath:/my/company/Dsl.xtext'
	at org.eclipse.xtext.resource.ClassloaderClasspathUriResolver.findResourceOnClasspath(ClassloaderClasspathUriResolver.java:60)
	at org.eclipse.xtext.resource.ClassloaderClasspathUriResolver.resolve(ClassloaderClasspathUriResolver.java:45)
	... 47 more


The URI is right, the .classpath file is right:

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
	<classpathentry kind="src" path="src"/>
	<classpathentry kind="src" path="src-gen"/>
	<classpathentry kind="src" path="xtend-gen"/>
	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
	<classpathentry kind="output" path="bin"/>
</classpath>


I tried to create a new Xtext Hello World project, and it shows the same error if I change the grammarURI or the .xtext filename. But once I correct them, it works fine.

Any suggestions?
Re: MWE generator can't find resource [message #1076793 is a reply to message #1076790] Wed, 31 July 2013 21:42 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13661
Registered: July 2009
Senior Member
Hi,

sure you have build automatically on? and the file is copied to the bin folder?

~Christian


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

[Updated on: Wed, 31 July 2013 21:45]

Report message to a moderator

Re: MWE generator can't find resource [message #1076821 is a reply to message #1076793] Wed, 31 July 2013 22:46 Go to previous messageGo to next message
Erick Fonseca is currently offline Erick FonsecaFriend
Messages: 68
Registered: December 2011
Member
Build automatically is on, but the file wasn't copied to the bin folder. It worked when I changed the URI to "file:/full/path/to/Dsl.xtext", so I guess it's a classpath issue?
Re: MWE generator can't find resource [message #1076854 is a reply to message #1076821] Thu, 01 August 2013 00:06 Go to previous messageGo to next message
Erick Fonseca is currently offline Erick FonsecaFriend
Messages: 68
Registered: December 2011
Member
I found the reason. I needed to create a src-gen directory, because without it, apparently the classpath verification didn't work (since src-gen is in the classpath).

The reason I didn't have a src-gen folder was because I pulled the project from my code repository, which ignore -gen folders. Now I added an empty file just to create them.
Re: MWE generator can't find resource [message #1076919 is a reply to message #1076821] Thu, 01 August 2013 02:38 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13661
Registered: July 2009
Senior Member
Sure there are no errors on the project?

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


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: MWE generator can't find resource [message #1077465 is a reply to message #1076919] Thu, 01 August 2013 18:59 Go to previous messageGo to next message
Erick Fonseca is currently offline Erick FonsecaFriend
Messages: 68
Registered: December 2011
Member
Yes, it works fine on both platforms now.
Re: MWE generator can't find resource [message #1220679 is a reply to message #1076919] Fri, 13 December 2013 03:15 Go to previous messageGo to next message
Nicolás Passerini is currently offline Nicolás PasseriniFriend
Messages: 1
Registered: December 2013
Junior Member
Hi, I have the exact same problem, I checked out a project from a Mercurial repository, with the *-gen folders ignored.

I tried to run de MWE2 workflow but it produces the same error:

Caused by: org.eclipse.xtext.resource.FileNotFoundOnClasspathException: Couldn't find resource on classpath. URI was 'classpath:/org/uqbar/research/languages/Base.xtext'
at org.eclipse.xtext.resource.ClassloaderClasspathUriResolver.findResourceOnClasspath(ClassloaderClasspathUriResolver.java:60)
at org.eclipse.xtext.resource.ClassloaderClasspathUriResolver.resolve(ClassloaderClasspathUriResolver.java:45)
... 47 more


I created the src-gen and xtend-gen source folders, but it did not solve my problem.

The project has errors?
Right, because there are ScopeProviders and other tools that can not be compiled if I do not generate the model classes first.

Re: MWE generator can't find resource [message #1220780 is a reply to message #1220679] Fri, 13 December 2013 14:44 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13661
Registered: July 2009
Senior Member
Hi,

i meant errors that prevents the eclipse compiler to copy the grammar (and other stuff) to the bin (or what ever the classes location is) in your case.


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:How does this compare with other frameworks?
Next Topic:Trying to use JavaIoFileSystemAccess directly
Goto Forum:
  


Current Time: Sun Nov 29 08:40:48 GMT 2020

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

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

Back to the top