Skip to main content

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

1 reply [Last post]
kvkrishna
Offline
Joined: 2008-05-17
Points: 0

Hi,
We are experiencing class loader issues in the web component deployed in Sun Java System Application Server 9.1_01 (GlassFish 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 ( .properties and .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 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

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jluehe
Offline
Joined: 2004-12-01
Points: 0