Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » "a registered resource factory is needed" error with absolute path
"a registered resource factory is needed" error with absolute path [message #1060915] Wed, 29 May 2013 07:02 Go to next message
chris yo is currently offline chris yo
Messages: 37
Registered: February 2013
Member
I have an xtext.jar file that I try to run in DOS command line.

When I try to use the absolute path for my input file, I am getting an error "Cannot create a resource for 'D:\01\Sample\Test\Mod1\sample.txt'; a registered resource factory is needed." This is the command I used:

java -jar xtext.jar D:\01\Sample\Test\Mod1\sample.txt


But, when I use relative paths, the jar file will work without any error.

java -jar xtext.jar Mod1\sample.txt


Anyone has any idea why this is so?
Re: "a registered resource factory is needed" error with absolute path [message #1060918 is a reply to message #1060915] Wed, 29 May 2013 07:17 Go to previous messageGo to next message
Karsten Thoms is currently offline Karsten Thoms
Messages: 354
Registered: July 2009
Location: Dortmund
Senior Member

Could be that "D:" is recognized as URI scheme. Try to prefix with "file:".

Need professional support for Xtext, Xpand, EMF?
Go to: http://xtext.itemis.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
Re: "a registered resource factory is needed" error with absolute path [message #1060950 is a reply to message #1060918] Wed, 29 May 2013 09:31 Go to previous messageGo to next message
chris yo is currently offline chris yo
Messages: 37
Registered: February 2013
Member
I tried File:\\D:\01\Sample\Test\Mod1\sample.txt, but still the same error. Am I using it the wrong way?

In my workflow, I have disabled these for importURI.
// scoping and exporting API
// fragment = scoping.ImportURIScopingFragment {}
// fragment = exporting.SimpleNamesFragment {}


Could this be the reason?
Re: "a registered resource factory is needed" error with absolute path [message #1061010 is a reply to message #1060950] Wed, 29 May 2013 13:44 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 26137
Registered: July 2009
Senior Member
Chris,

If this API wants a URI, keep in mind that \ is not a segment separator
in a URI (it's treated just like other punctuation as as "-" or "_") ,
so perhaps file:/D:/01/Sample/Test/Mod1/sample.txt would work properly


On 29/05/2013 11:31 AM, chris yo wrote:
> I tried File:\\D:\01\Sample\Test\Mod1\sample.txt, but still the same
> error. Am I using it the wrong way?
>
> In my workflow, I have disabled these for importURI.
> // scoping and exporting API
> // fragment = scoping.ImportURIScopingFragment {}
> // fragment = exporting.SimpleNamesFragment {}
>
> Could this be the reason?
Previous Topic:Automatically adding Xtext nature to project
Next Topic:JvmModelInferrer: multiple input files
Goto Forum:
  


Current Time: Thu Oct 23 13:57:40 GMT 2014

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

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