This article mainly solves the problem that under the same web module (web project), there are two classes with the same package name and class name in two jar packages, causing the loaded class error (others can also be solved)
(provided in the attachment, see the jsp where the class is loaded)
In fact, the easiest way to solve this problem is to decompress the jar package you want to load first into a class, and load the class first.
The order of loading jar packages under a web module in websphere can only be seen, not changed. It seems that you can try to adjust the loading order of jar packages by changing the jar name.
For websphere linux and windows versions, the loading order may be different for different patch versions, some are out of order, and some are sorted by file name. Out of order is bad enough.
1. View the class loading order
was console
Enterprise Applications > jartest_war > Manage Modules > jartest.war
The default class loader order
is: the class is loaded and the parent class loader is used first
The other is: the class is loaded and the local class loader is used first (parent class last)
(When the server1 class loader strategy is multiple, the default class loading method is that the class has been loaded and the parent class loader is used first. It is gray and cannot be changed. The class loader strategy is single and can be modified. )
Applications -- Enterprise Applications > jartest_war > Manage Modules > jartest.war > Classloader Viewer
The second way to view:
Troubleshooting -- Classloader Viewer
When the class is loaded and the parent class loader is used first
1.jdk extension, loaded first
You can put the jar package under this
D:/Program Files/IBM/WebSphere/AppServer/java/jre/lib/ext/
This has a greater impact,
I once put hibernate-jpa-2.0-api-1.0.1.Final.jar into this directory
5. The use of shared libraries on server1 will affect this
6. The use of shared libraries on the application ear will affect this
7. The order of classes and jar packages loaded by the web module war The use of shared libraries on web modules seems to have no effect
Here you can see the loading order of the jar package. Some versions are loaded out of order, and some are loaded in the order of file names. The order can only be seen and cannot be changed.
It seems to try to adjust the order by that jar package name.
The problems that can be solved with the ear shared library do not need to be solved on server1
Create shared library
websphere7.0 creates a shared library and references the shared library
http://happyqing.iteye.com/blog/2323338
Troubleshooting WebSphere class loading problems
http://www.blogjava.net/jjshcc/archive/2014/05/13/413618.html
This article mainly solves the problem that under the same web module (web project), there are two classes with the same package name and class name in two jar packages, causing the loaded class error (others can also be solved)
(provided in the attachment, see the jsp where the class is loaded)
In fact, the easiest way to solve this problem is to decompress the jar package you want to load first into a class, and load the class first.
The order of loading jar packages under a web module in websphere can only be seen, not changed. It seems that you can try to adjust the loading order of jar packages by changing the jar name.
For websphere linux and windows versions, the loading order may be different for different patch versions, some are out of order, and some are sorted by file name. Out of order is bad enough.
1. View the class loading order
was console
Enterprise Applications > jartest_war > Manage Modules > jartest.war
The default class loader order
is: the class is loaded and the parent class loader is used first
The other is: the class is loaded and the local class loader is used first (parent class last)
(When the server1 class loader strategy is multiple, the default class loading method is that the class has been loaded and the parent class loader is used first. It is gray and cannot be changed. The class loader strategy is single and can be modified. )
Applications -- Enterprise Applications > jartest_war > Manage Modules > jartest.war > Classloader Viewer
The second way to view:
Troubleshooting -- Classloader Viewer
When the class is loaded and the parent class loader is used first
1.jdk extension, loaded first
You can put the jar package under this
D:/Program Files/IBM/WebSphere/AppServer/java/jre/lib/ext/
This has a greater impact,
I once put hibernate-jpa-2.0-api-1.0.1.Final.jar into this directory
5. The use of shared libraries on server1 will affect this
6. The use of shared libraries on the application ear will affect this
7. The order of classes and jar packages loaded by the web module war The use of shared libraries on web modules seems to have no effect
Here you can see the loading order of the jar package. Some versions are loaded out of order, and some are loaded in the order of file names. The order can only be seen and cannot be changed.
It seems to try to adjust the order by that jar package name.
The problems that can be solved with the ear shared library do not need to be solved on server1
Create shared library
websphere7.0 creates a shared library and references the shared library
http://happyqing.iteye.com/blog/2323338
Troubleshooting WebSphere class loading problems
http://www.blogjava.net/jjshcc/archive/2014/05/13/413618.html