【问题标题】:Spring cannot find jar outside EAR - WebSphere community editionSpring 在 EAR 之外找不到 jar - WebSphere 社区版
【发布时间】:2012-11-19 22:05:46
【问题描述】:

我有一个部署到 WebSphere Application Server Community Edition 的耳朵,它使用 spring 来加载不同的接口。对于生产,所有这些类都加载到耳朵内。我正在尝试用 EAR 之外的 jar 中的另一个类覆盖这些类。

我将我的 jar 放在 /var/shared/lib 中,并有一个部署依赖项,我认为它会将这些文件夹包含到类路径中:

<sys:dependencies>
<sys:dependency>
<sys:groupId>org.apache.geronimo.configs</sys:groupId>
<sys:artifactId>sharedlib</sys:artifactId>
</sys:dependency>
</sys:dependencies>

我错过了什么? spring 导致 NoClassDef 声明找不到类。

【问题讨论】:

    标签: spring shared-libraries geronimo websphere-ce


    【解决方案1】:

    Websphere 具有共享库功能。将您的 jar 添加到共享库中,然后使用 websphere 管理控制台将该库添加到您的应用程序中。

    Using shared libraries at the application level
    To define a shared library named VersionCheckerV2_SharedLib and associate it 
    to our ClassloaderTest application, do the following steps:
    1. In the administrative console, select Environment → Shared Libraries.
    2. Select the scope at which you want this shared library to be defined, such as 
    Cell, and click New
    

    添加

    Select Applications → Application Types→ WebSphere enterprise 
    applications.
    6. Select the ClassloadersExample application.
    7. In References, select Shared library references.
    8. Select AppName in the Application row.
    9. Click Reference shared libraries.
    10.Select the VersionCheckerV2_SharedLib and click the >> button to move it 
    to the Selected column
    

    使用shared library 执行此任务。使用this book 作为指导。

    【讨论】:

      猜你喜欢
      • 2011-06-17
      • 2022-08-08
      • 2014-08-21
      • 1970-01-01
      • 2011-01-04
      • 2019-03-09
      • 1970-01-01
      • 1970-01-01
      • 2018-08-01
      相关资源
      最近更新 更多