简体   繁体   中英

Config WebSpshere application to use specific class loader

In WebSphere I have configured two custom server class loader for shared libraries(A and B). Is it any way to config to my EAR to use only the A class loader and not the the B?

Server-level shared library class loaders are visible to all applications on the server, and that cannot be changed (assuming here that your configuration is similar to the "Associating the shared library with the server" section of this tech note: https://www.ibm.com/support/pages/how-create-shared-library-and-associate-it-application-server-or-enterprise-application-websphere-application-server ).

If you'd prefer to have your shared libraries associated with specific applications, you would want to associate the library with the application (or one of its web modules), rather than with the server class loader - the configuration steps for that are in the following sections of the above tech note.

If you require a separate class loader for the shared library for some reason (for example, because something in the shared library needs to be used in preference to something in the EAR/WAR, or multiple apps need to access the same Class instance), you can select the "Use an isolated class loader" option when configuring the shared library. That will give the library its own class loader, which will be searched in preference to both the EAR/WAR libraries AND the server libraries, so you need to be careful that it does not include any APIs that you intend to load from the server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM