2012-11-07 79 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作爲指導。