0

我有一个部署到 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>

我错过了什么?弹簧导致 NoClassDef 说明找不到类。

4

1 回答 1

0

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此任务。使用本书作为指导。

于 2012-11-19T14:05:46.523 回答