6

We are going to use WebSphere 8.0 app server in our development.
Our web app uses Amazon aws java sdk, that in turns uses Apache http-client 4.1.
But WebSphere also has http-client classes in its libraries that seems clash with http-client located in our web-app.
I've found next list of http-client classes distributed with WebSphere:

\WebSphere\AppServer\plugins\com.ibm.ws.prereq.jaxrs.jar (http-client 4.0.1)
\WebSphere\AppServer\runtimes\com.ibm.jaxrs.thinclient_8.0.0.jar

So, my question is: How to load classes located in my app first instead of provided by WebSphere app container?

Piotr Nowicki
  • 17,914
  • 8
  • 63
  • 82
Oleksandr_DJ
  • 1,454
  • 2
  • 14
  • 26

1 Answers1

7

From Admin Console go to:

Applications > Websphere Enterprise Applications > YourApplication > Manage Modules > YourModule

and change the "Class loader order" to parent last.

Then restart the application.

trikelef
  • 2,192
  • 1
  • 22
  • 39
  • I had explored this option early, but seems it does not work. Seems additional custom class loader need to be used. – Oleksandr_DJ May 17 '13 at 14:26
  • 1
    Try Applications > Websphere Enterprise Applications > YourApplication > Manage Modules > YourModule and change the "Class loader order" to parent last. Then restart. – trikelef May 17 '13 at 14:44
  • O my God!!! I've spent almost two days for solving this issue. I've red a lot of documentations. But seems I've missed a point that it should be done for Module in "Manage Modules" menu. Thanks again! – Oleksandr_DJ May 17 '13 at 15:07
  • @trikelef I suggest you edit your original answer to include the bit about the "Manage Modules" menu. – Isaac Jun 09 '14 at 00:32
  • Hi the drop down is disabled for users to change. Any other option to change the classloader to parent last? – bks4line Mar 05 '15 at 04:34
  • Built it in your app by using the deployment.xml document: http://stackoverflow.com/q/813202/940299 – trikelef Mar 05 '15 at 12:21
  • If the drop down is disabled, very possibly is because you are deploying from RAD. Or Eclipse. In that case, change the classloader order in the application's deployment descriptor (expand the EAR project in RAD and you should see it, if not right click on it, Java EE and Open deployment descriptor or similar). – pfernandom Dec 03 '15 at 20:28