简体   繁体   English

Spring无法在EAR之外找到jar-WebSphere Community Edition

[英]Spring cannot find jar outside EAR - WebSphere community edition

I have an ear deployed to WebSphere Application Server Community Edition which uses spring to load different interfaces. 我已经部署到WebSphere Application Server Community Edition,它使用spring来加载不同的接口。 For production all those classes are loaded inside the ear. 为了生产,所有这些类别都装入了耳朵内部。 I'm trying to override those classes with another class in a jar outside the EAR. 我试图用EAR外部jar中的另一个类重写这些类。

I placed my jar in /var/shared/lib and have a deployment dependency which I thought would include those folder's into the classpath: 我将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>

What am I missing? 我想念什么? The spring results in a NoClassDef stating the class cannot be found. 弹簧导致NoClassDef指出找不到该类。

Websphere has a shared library feature. Websphere具有共享库功能。 Add your jar in shared library and then add that library in your application usin websphere admin console. 将您的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

To add 加上

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

Use shared library for this task. 使用shared library执行此任务。 Use this book for guidence. 这本书作为指导。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM