> I hope this is the appropriate place to place this message; please
> let me know if not.

The forum

http://sourceforge.net/forum/forum.php?forum_id=128638

is probably better .... but wha-evah.....

> I have created some hibernate classes for my web application.
> I am attempting to test them in Jbuilder JUnit test library.
> The issue I'm having is that that when I attempt to initialise my
> classes with (from memory):
>
>     Hibernate.storeFile("mapping.xml");
>
> It complains with an error. I can't remember the exact error,
> though from memory it was something to do with being unable to find
> the file.

If you want to use a relative filename, I guess you will have to know
what your current working directory is. Otherwise, why not just use
a fully qualified pathname.

A better way to do this (that only works in 0.9.9) is to use

datastore.storeInputStream(
  someClass.getResourceAsStream("mapping.xml")
);

that way you can just make sure the file is in the classpath.

Also make sure that the XML parser can find the
hibernate-mapping.dtd. If you use the URL

http://hibernate.sourceforge.net/hibernate-mapping.dtd

then hibernate will try to load the DTD using
getResourceAsStream(). If it doesnt find it there,
it will hit the actual URL....

Good Luck!



_______________________________________________
Hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to