Thanks Richard.

Thanks for the reply.

I've tried the following with the same results:
   java.net.URL url = this.getClass().getResource("database.xml");
   jdo.setDatabaseName("membership");
   jdo.setClassLoader(this.getClass().getClassLoader());
   jdo.setConfiguration(url.toString());

It looks like it is working with respect to finding the files.  I can cause
an exception by introducing a error in my mapping file, and when I inspect
the jdo object in my debugger, the config looks to be set.

I get the 'no configuration loaded' response when I invoke
jdo.getDatabase();

Thanks for your help.

craig


----- Original Message -----
From: "Richard Lawson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, February 22, 2003 2:29 PM
Subject: Re: [castor-dev] no configuration loaded problem


> Hi Craig,
> I don't know exactly where all your files are, but try changing the arg of
> setConfiguration to the URL of database.xml as a String and see if that
> helps.
>
> jdo.setConfiguration( getClass().getResource(
"database.xml" ).toString());
>
> works for me -richard
>
>
> -----Original Message-----
> From: Craig Johnson [mailto:[EMAIL PROTECTED]
> Sent: February 21, 2003 12:12 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [castor-dev] no configuration loaded problem
>
>
> Bruce, thanks for your quick reply.
>
> It's in the directory where  the class file is located.  When I look at
jdo
> with my debugger after the call to jdo.setConfiguration the dbConfig value
> is set as expected with a complete file path.
>
> I'll have a look at the threa you suggest.
>
> Craig
> ----- Original Message -----
> From: "Bruce Snyder" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, February 21, 2003 3:51 PM
> Subject: Re: [castor-dev] no configuration loaded problem
>
>
> > This one time, at band camp, Craig Johnson said:
> >
> > CJ>When I run the following code I get a "no configuration loaded for
> database
> > CJ>problem".
> > CJ>
> > CJ>My mapping file seems to be valid; ie, I can cause a mapping
exception
> by
> > CJ>introducing an error.
> > CJ>
> > CJ>I assume it's something environmental, but every thing I've looked at
> seems
> > CJ>ok.
> > CJ>
> > CJ>
> > CJ>JDO jdo = new JDO();
> > CJ>jdo.setDatabaseName( "sogn_membership" );
> > CJ>jdo.setConfiguration( "database.xml" );
> > CJ>jdo.setClassLoader( getClass().getClassLoader() );
> > CJ>org.exolab.castor.jdo.Database db = jdo.getDatabase();
> >
> > Craig,
> >
> > Where does the database descriptor reside on the filesystem? Based on
the
> code
> > above, it will ONLY look for it in the directory from where the code is
> > executed.
> >
> > I always recommend loading it from the CLASSPATH. See the following
thread
> > regarding this:
> >
> >     http://www.mail-archive.com/[EMAIL PROTECTED]/msg07008.html
> >
> > Even though the suggestion is for a web container and a J2EE container,
> > either one will work in standalone code.
> >
> > Bruce
> > --
> > perl -e 'print
> unpack("u30","<0G)[EMAIL PROTECTED]&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");'
> >
> > -----------------------------------------------------------
> > If you wish to unsubscribe from this mailing, send mail to
> > [EMAIL PROTECTED] with a subject of:
> > unsubscribe castor-dev
> >
>
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
> unsubscribe castor-dev
>
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
> unsubscribe castor-dev
>

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to