users@glassfish.java.net

Issues with Class Loader on SJSAS 9.1_01 (GlassFish build b09d-fcs)

From: <glassfish_at_javadesktop.org>
Date: Sun, 18 May 2008 06:42:57 PDT

Hi,
We are experiencing class loader issues in the web component deployed in Sun Java System Application Server 9.1_01 ([b]GlassFish [/b]build b09d-fcs).

And the requirement is to reload the modified configuration files with out restarting above App server or redeploying the web application.
We are bundling all the configuration files ( [b].[/b]properties and [b].[/b]xml files) in a separate JAR as part of application WAR.

After the application is deployed all the configuration files were loaded successfully.
We made changes to few configuration files and bundled as JAR. Now this JAR file contains both modified and unmodified configuration files. And then placed the above JAR in the WEB-INF/lib folder under App server's "applications\j2ee-modules\x-application".

And now when we try to load the configuration files it is loading only one modified file and failing to load the rest of the files.

Initially we tried with just one configuration file in the JAR and the class loader was able to load the file successfully before and after the changes to the file. But once we added more than one file to the JAR it is unable to all the files except any one modified file.

Please find the code snippet below and let me know your comments. Please let me know if I'm missing anything or is there any different approach to reload the configuration files without restarting the App server or redeploying the application.

public Properties getResource(String fileName) throws IOException {
Properties configProperties = null;
try {
Enumeration<URL> enrn = this.getClass().getClassLoader().getResources(fileName);
URL url = null;

while (enrn.hasMoreElements()) {
url = enrn.nextElement();
}
InputStream theInputStream = null;

if (url != null) {
URLConnection connection = url.openConnection();
if (connection != null) {
connection.setUseCaches(false);
theInputStream = connection.getInputStream();
if (theInputStream != null) {
configProperties = new Properties();
configProperties.load(theInputStream);
}
}
}
} catch (IOException ie) {
throw ie;
}
return configProperties;
}

Appreciate your time.
Regards,
Venkata
[Message sent by forum member 'kvkrishna' (kvkrishna)]

http://forums.java.net/jive/thread.jspa?messageID=275051