Sun Java System Application Server Enterprise Edition 8.1 2005Q2 Release Notes

Classloader Changes

In the current release, the JAR and directory entries added to classpath-prefix, server-classpath, and classpath-suffix attributes of domain.xml (application server configuration file) are available in the JVM system classpath. An application depending on this behavior might be using the following methods from the class java.lang.ClassLoader to access classes or other resources from JVM system classpath:

In the next major release, the JAR and directory entries added to classpath-prefix, server-classpath, and classpath-suffix will no longer be available in the JVM system classpath. If an application uses one of the methods mentioned above, Sun strongly recommends using an equivalent method that does not assume that the resources are available in the system classpath. The equivalent methods that do not rely on the JVM system classpath are available in java.lang.ClassLoader and should be used when possible; for example:


Example 2–1 Old Code

java.net.URL url = ClassLoader.getSystemResource
("com/acme/tools/tools.properties");


Example 2–2 Suggested Change

java.net.URL url = this.getClass().getClassLoader().getResource
("com/acme/tools/tools.properties");

If it is not possible to change the code, then you may choose to use a new configuration option that will be added in the next release to set JVM system classpath.