Re: Loading a model from a referenced framework in a jar project
Re: Loading a model from a referenced framework in a jar project
- Subject: Re: Loading a model from a referenced framework in a jar project
- From: "Richard Stephens" <email@hidden>
- Date: Sun, 28 Dec 2008 14:47:28 +1000
Hey, thanks
That looks like it might do what I want but doesn't seem to be working.
As it is, my code looks like this:
URL modelUrl =
TblUser.class.getClass().getResource("/Resources/ndbmodel.eomodeld");
System.out.println( modelUrl.toString());
Where TblUser is a class in the framework containing the model i want
to load. However this just throws a null pointer exception
(getResource() returns null)
I also tried a few variants such as getResource("Resources/ndbmodel.eomodeld");
and getResource("ndbmodel.eomodeld");
However I can't see a way to find out the root path that getResource
searches from.
On Sat, Dec 27, 2008 at 11:39 PM, Henrique Prange <email@hidden> wrote:
> Hi Richard,
>
> On Fri, Dec 26, 2008 at 5:49 AM, Richard Stephens <email@hidden> wrote:
>> Hi
>> How do I load a model from a referenced framework in a Jar project?
>
> You can try something like this:
>
> URL modelUrl = getClass().getResource("/Resources/YourModel.eomodeld");
>
> EOModelGroup.defaultGroup().addModelWithPathURL(modelUrl);
>
> Cheers,
>
> Henrique
>
>> --
>> Regards, Richard Stephens Ph: 07 3136 3426 Mob: 0410 111 570 Email:
>> email@hidden
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list (email@hidden)
>> Help/Unsubscribe/Update your Subscription:
>>
>> This email sent to email@hidden
>>
>
--
Regards,
Richard Stephens
Ph: 07 3136 3426
Mob: 0410 111 570
Email: email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden