Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Error reading file
Error reading file [message #427447] Wed, 18 February 2009 11:07 Go to next message
Anna is currently offline AnnaFriend
Messages: 6
Registered: July 2009
Junior Member
In my project, I've got a piece of code that can be seen on this URL:
http://utilitybase.com/paste/12022

The variable loadString is a direct path to a file. I've checked both one
and two times to see that the string isn't empty or anything. However,
when I run my project I always catch the first exception, saying that my
file cannot be found (although I know for a fact that it's there). I've
also tried not to give a direct path, so that loadString only contains the
filename, but then I get the second exception instead...

Any idea why the project can't locate the file when I'm running it? Is
there anything else I should write instead of a direct path/filename?

Sincerely,
Anna
Re: Error reading file [message #427455 is a reply to message #427447] Wed, 18 February 2009 12:08 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33218
Registered: July 2009
Senior Member
Anna,

Comments below.

Anna wrote:
> In my project, I've got a piece of code that can be seen on this URL:
> http://utilitybase.com/paste/12022
>
> The variable loadString is a direct path to a file. I've checked both
> one and two times to see that the string isn't empty or anything.
> However, when I run my project I always catch the first exception,
> saying that my file cannot be found (although I know for a fact that
> it's there). I've also tried not to give a direct path, so that
> loadString only contains the filename, but then I get the second
> exception instead...
>
> Any idea why the project can't locate the file when I'm running it? Is
> there anything else I should write instead of a direct path/filename?
Have you tried invoking "Generate Test Code..." for your model and
looking at the generated XyzExample.java? You'll note that it's careful
to determine the absolute file path and to use URI.createFileURI.
>
> Sincerely,
> Anna
>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Error reading file [message #427459 is a reply to message #427455] Wed, 18 February 2009 12:58 Go to previous message
Anna is currently offline AnnaFriend
Messages: 6
Registered: July 2009
Junior Member
Ed Merks wrote:

> Anna,

> Comments below.

> Anna wrote:
>> In my project, I've got a piece of code that can be seen on this URL:
>> http://utilitybase.com/paste/12022
>>
>> The variable loadString is a direct path to a file. I've checked both
>> one and two times to see that the string isn't empty or anything.
>> However, when I run my project I always catch the first exception,
>> saying that my file cannot be found (although I know for a fact that
>> it's there). I've also tried not to give a direct path, so that
>> loadString only contains the filename, but then I get the second
>> exception instead...
>>
>> Any idea why the project can't locate the file when I'm running it? Is
>> there anything else I should write instead of a direct path/filename?
> Have you tried invoking "Generate Test Code..." for your model and
> looking at the generated XyzExample.java? You'll note that it's careful
> to determine the absolute file path and to use URI.createFileURI.

No, I haven't tried that yet (didn't know that that option existed
actually :)). I'll look into that and see what I can figure out. Thanks!

/Anna
Previous Topic:EDataType and interface
Next Topic:Generator problem with Reflective Delegation
Goto Forum:
  


Current Time: Thu Sep 26 00:19:59 GMT 2024

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

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

Back to the top