Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Couldn't find resource on classpath(My mw2 module can not find my Xtext source file)
Couldn't find resource on classpath [message #1700342] Thu, 02 July 2015 05:06 Go to next message
Olaf Bigalk is currently offline Olaf BigalkFriend
Messages: 155
Registered: July 2009
Location: Berlin
Senior Member
When I try to generate my Xtext project I get this exception:
... 4 more
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at org.eclipse.emf.mwe2.language.factory.SettingProviderImpl$1$1.setValue(SettingProviderImpl.java:54)
	... 37 more
Caused by: org.eclipse.xtext.resource.ClasspathUriResolutionException: org.eclipse.xtext.resource.FileNotFoundOnClasspathException: Couldn't find resource on classpath. URI was 'classpath:/de/mdsd/xtext/swtch/model/SwitchModel.xtext'
	at org.eclipse.xtext.resource.ClassloaderClasspathUriResolver.resolve(ClassloaderClasspathUriResolver.java:49)
	at org.eclipse.xtext.resource.XtextResourceSet.resolveClasspathURI(XtextResourceSet.java:217)
	at org.eclipse.xtext.resource.XtextResourceSet.access$0(XtextResourceSet.java:216)
	at org.eclipse.xtext.resource.XtextResourceSet$1.normalize(XtextResourceSet.java:280)
	at org.eclipse.xtext.resource.XtextResourceSet.getResource(XtextResourceSet.java:235)
	at org.eclipse.xtext.generator.LanguageConfig.setUri(LanguageConfig.java:241)
	... 42 more
Caused by: org.eclipse.xtext.resource.FileNotFoundOnClasspathException: Couldn't find resource on classpath. URI was 'classpath:/de/mdsd/xtext/swtch/model/SwitchModel.xtext'
	at org.eclipse.xtext.resource.ClassloaderClasspathUriResolver.findResourceOnClasspath(ClassloaderClasspathUriResolver.java:61)
	at org.eclipse.xtext.resource.ClassloaderClasspathUriResolver.resolve(ClassloaderClasspathUriResolver.java:46)
	... 47 more

The Xtext file is exactly in this location on the classpath. File permissions are set properly and I do not understand where this exception comes from.
I appreceate any hints for solving this issue.
Re: Couldn't find resource on classpath [message #1700343 is a reply to message #1700342] Thu, 02 July 2015 05:08 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Do you have build path errors (exkl. Mark) on the project

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Couldn't find resource on classpath [message #1700344 is a reply to message #1700342] Thu, 02 July 2015 05:24 Go to previous messageGo to next message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 762
Registered: July 2009
Location: Dortmund, Germany
Senior Member

The actual classpath is the output folder. Is the file really in the bin folder?

Need professional support for Xtext, EMF, Eclipse IDE?
Go to: http://devhub.karakun.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
Re: Couldn't find resource on classpath [message #1700443 is a reply to message #1700343] Thu, 02 July 2015 15:38 Go to previous messageGo to next message
Olaf Bigalk is currently offline Olaf BigalkFriend
Messages: 155
Registered: July 2009
Location: Berlin
Senior Member
Christian Dietrich wrote on Thu, 02 July 2015 01:08
Do you have build path errors (exkl. Mark) on the project


There are no error markers on the project in the package explorer.
Re: Couldn't find resource on classpath [message #1700445 is a reply to message #1700344] Thu, 02 July 2015 15:40 Go to previous messageGo to next message
Olaf Bigalk is currently offline Olaf BigalkFriend
Messages: 155
Registered: July 2009
Location: Berlin
Senior Member
Karsten Thoms wrote on Thu, 02 July 2015 01:24
The actual classpath is the output folder. Is the file really in the bin folder?


Thank you for the hint, but what happened to the project that the xtext file did not get copied to the bin folder ?
Re: Couldn't find resource on classpath [message #1700447 is a reply to message #1700445] Thu, 02 July 2015 15:42 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
this usually happens if there are build path errors or you have build automatically off

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:How to disable OneWhitespaceFormatter
Next Topic:Multiple Cross References in same rule
Goto Forum:
  


Current Time: Tue Mar 19 09:39:58 GMT 2024

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