【问题标题】:How to load classes located in Java EE app libs first instead of provided by Java EE App Container如何首先加载位于 Java EE 应用程序库中而不是由 Java EE 应用程序容器提供的类
【发布时间】:2013-05-17 07:58:48
【问题描述】:

我们将在我们的开发中使用 WebSphere 8.0 应用服务器。
我们的网络应用程序使用 Amazon aws java sdk,而后者又使用 Apache http-client 4.1。
但是,WebSphere 在其库中也有 http-client 类,这似乎与位于我们的 web 应用程序中的 http-client 冲突。
我找到了与 WebSphere 一起分发的 http-client 类的下一个列表:

\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

所以,我的问题是:如何首先加载位于我的应用程序中而不是由 WebSphere 应用程序容器提供的类?

【问题讨论】:

    标签: jakarta-ee websphere websphere-8


    【解决方案1】:

    从管理控制台转到:

    应用程序 > Websphere 企业应用程序 > YourApplication > 管理模块 > YourModule

    并将“Class loader order”更改为parent last

    然后重新启动应用程序。

    【讨论】:

    • 我很早就探索过这个选项,但似乎它不起作用。似乎需要使用额外的自定义类加载器。
    • Try Applications > Websphere Enterprise Applications > YourApplication > Manage Modules > YourModule 并将“Class loader order”更改为 parent last。然后重启。
    • 我的上帝!!!我花了将近两天的时间来解决这个问题。我已经红色了很多文件。但似乎我错过了应该为“管理模块”菜单中的模块完成的一点。再次感谢!
    • @trikelef 我建议您编辑原始答案以包含有关“管理模块”菜单的内容。
    • 您好,用户无法更改下拉菜单。最后将类加载器更改为父级的任何其他选项?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多