2012-11-07 46 views
0

我有一个部署到WebSphere Application Server Community Edition的应用程序,它使用spring来加载不同的接口。为了生产,所有这些类都装入耳内。我试图用EAR外的jar中的另一个类来覆盖这些类。Spring在EAR外部找不到jar - WebSphere社区版

我把我在/ var JAR /共享/ lib和有我本以为这包括那些文件夹的到classpath中部署的依赖:

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

我缺少什么?该弹簧导致NoClassDef声明无法找到该类。

回答

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这项任务。使用this book作为指导。