Using a resource name of "file:/META-INF/database.xml" does not make sense
as this is asking for the file located at the absolute path /META-INF/database.xml.
I created a test of loading a resource from a service start and parsing the resulting
xml doc using a contruct like:
 
      URL url0 = loader.getResource("META-INF/config.xml");
      if( url0 != null )
      {
         InputStream is = url0.openStream();
         SAXParserFactory factory = SAXParserFactory.newInstance();
         SAXParser parser = factory.newSAXParser();
         parser.parse(is, new DefaultHandler());
         log.debug("Successfully parsed url0");
         is.close();
      }
 
where loader could be either the service class ClassLoader or the thread
context ClassLoader. I did find a problem when multiple services are included
in a deployment and use the same config file name even though it is located
in distinct paths. See Bug #558525 for more info on that but this not the
issue you are seeing with the FileNotFoundException.
 
xxxxxxxxxxxxxxxxxxxxxxxx
Scott Stark
Chief Technology Officer
JBoss Group, LLC
xxxxxxxxxxxxxxxxxxxxxxxx
----- Original Message -----
Sent: Monday, May 20, 2002 2:50 PM
Subject: Re: [JBoss-dev] MBean ClassLoader ?revisited?

Not a problem.  Hopefully this email will contain the requested info.  BTW, I'm not even sure I was asking for a new ClassLoader.  I saw a significant amount of code in MBeanServerImpl.invoke() and ServiceCreator.install() that seemed to imply that the intention was to have a ClassLoader for each deployed SAR.  This made sense considering the issues I think I am running into.  Although the below SAR info is for the Castor MBean, I also have several MBean(s) I have been writing to convert from my DeploymentNotification approach under JBoss 2.4.x.  The problem is being able to read configuration files from the startService() method of an MBean such as CastorJDOImpl.java (in the varia module).  My aiab-common.sar has the following files in it:

aiab-common.jar
castor-jdo-plugin.jar            <---including this file or putting in in jboss/lib makes no difference.
meta-inf/jboss-service.xml
meta-inf/Manifest.mf
meta-inf/database.xml
meta-inf/mapping.xml

The jboss-service.xml file is:

Reply via email to