Hi Avi,
you should always be able to call:
MyClass.class.getClassLoader().getResource("castor_map.xml")
Having said that we are not able to change that behaviour as changing it
will break things in other areas of castor.
Regards
Ralf
CastorJDO, committer
Wiesenfeld, Avi schrieb:
Hi all (Adam, Werner, Bill and all others),
Many thanks for the help. I tried Adam suggestion to use
customMapping.loadMapping(getClass().getClassLoader().getResource("casto
r_map.xml"));
and it works fine.
1) Now I would like to go on with this problem and sharpen my question -
I would like to use a static module (all methods are static) in order to
use a singleton - how would I call load license than? (The getClass will
not work that way....).
2) Do you know if the latest castor (guess it's 9.9) solves this issue?
Best Regards,
Avi Wiesenfeld, CISSP
-----Original Message-----
From: Adam Kramer [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 21, 2005 6:01 PM
To: [email protected]
Subject: Re: [castor-user] loadMapping does not work in Castor 9.5.4
If the mapping file is in your classpath, try using the classloader
again like:
customMapping.loadMapping(getClass().getClassLoader().getResource("casto
r_map.xml"));
Adam
Wiesenfeld, Avi wrote:
Hi all,
I am trying to load castor map file using loadMapping as follows:
File mapFileName = new File(configDir, "castor_map.xml");
String mapFile = mapFileName.getAbsolutePath();
Mapping customMapping;
customMapping = new Mapping();
try
{
customMapping.loadMapping (mapFile);
.......
}
The mapFile contains full path name of
"d:\p4client\ctsa_home\ctsa\weblogic\tango-license\conf\castor_map.xml"
When using Castor 9.4.1 - everything worked fine.
Now - when I use Castor 9.5.4 the following exception is raised:
"
java.io.FileNotFoundException:
d:\p4client\ctsa_home\ctsa\weblogic\tango-license\conf\d:\p4client\ctsa_
home\ctsa\weblogic\tango-license\conf\castor_map.xml
(The filename, directory name, or volume label syntax is incorrect)"
I've tried to remove the path name and to add it to the classpath, to
use the following constructor:
New Mapping (getClass().getClassLoader());
But nothing helped.
Can you help?
Regards,
Avi Wiesenfeld
-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:
[EMAIL PROTECTED]
-------------------------------------------------
-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:
[EMAIL PROTECTED]
-------------------------------------------------
-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:
[EMAIL PROTECTED]
-------------------------------------------------