When running in WebSphere, why can my servlet find my PCML files?
When running servlets under WebSphere, at least two different class loaders are at work: The system class loader, and the servlets or WebSphere class loader. A common practice is to have the Toolbox jar file (jt400.jar) in the system class loader’s classpath. That way, all instances of WebSphere can share a single copy of the Toolbox. The application’s servlets and .pcml files are typically in the servlet class loader’s classpath. When the Toolbox tries to load the .pcml files, it uses the class loader that loaded the Toolbox (that is, the system class loader). The directory that holds the .pcml files is not in this classpath, however, so the system class loader cannot find the .pcml files.
When running servlets under WebSphere, at least two different class loaders are at work: The system class loader, and the servlets or WebSphere class loader. A common practice is to have the Toolbox jar file (jt400.jar) in the system class loader’s classpath. That way, all instances of WebSphere can share a single copy of the Toolbox. The application’s servlets and .pcml files are typically in the servlet class loader’s classpath. When the Toolbox tries to load the .pcml files, it uses the class loader that loaded the Toolbox (that is, the system class loader). The directory that holds the .pcml files is not in this classpath, however, so the system class loader cannot find the .pcml files. For example, suppose the system classpath is /jt400/jt400.jar:/otherCommonStuff/, and the WebSphere classpath is /myServlets/. The application provider will put her servlets and .pcml files in /myServlets/ . The Toolbox will use the system class loader to find .pcml files, so it will only look in jt