我正在使用JSsp2和Websphere 7。我已成功创建共享库并使用Webpsphere管理控制台指向应用程序,并且它可以成功运行。但是我们真正想要做的是不必通过WAS管理控制台指向该共享库,但是具有某种应用级配置,例如在deployment.xml等中,我们可以指向该共享隔离库的名称并使用它。我已经通过SO和谷歌,但没有发现任何事情做到这一点。然而,我知道有商业应用这样做,但不知道如何。
这从How can I specify a shared library reference at the web module level in Websphere 6.1 deployment descriptors?问题是密切什么我之后,但我不想为答案状态
如何配置EAR以访问现有的Websphere Shared Lib?
6
A
回答
9
我找到了一个方法,只需简单地跟随WAS管理控制台的实际操作。
如果您还没有EAR文件,请在您的EAR文件中创建deployment.xml。 你会发现像下面
<classloader xmi:id="Classloader_1311552732281" mode="PARENT_FIRST">
修改,并添加参考共享Liberary类装入器的引用在服务器上创建类似下面
<classloader xmi:id="Classloader_1311552732281" mode="PARENT_FIRST">
<libraries libraryName="JSF2_SHARED_LIB" sharedClassloader="true"/>
</classloader>
@dbreaux亦呈现方式.Accpeting我自己答案可以更好地满足我的需求,但非常感谢dbreaux的建议。
4
指定版本号或jar名字就是这样,你不希望有单独配置每个应用程序或问题你根本不想使用管理控制台?你可以associate a shared library with an entire server,这可能比每个应用程序更好。
创建这些应用程序关联的另一种方式是在特定于WebSphere的.xmi部署文件中。这些是在部署时创建的,但也可以包含在WAR/EAR文件中。我不知道这是否会对你有所帮助。如果可以的话,提前创建它们的正式方法是使用Deployment Tools之一,但由于它们只是XML,所以您可能会感觉很容易手动创建它们。
2
要追加额外的细节Shahzeb的答案: 我的环境:Websphere 8.5; Windows 7;(Eclipse Luna生成测试.war文件)
我已经在websphere控制台上安装了eclipse在websphere服务器上导出的war文件。 然后再次导出并解压缩以查看自动添加到它以生成EAR的websphere。
[folder]META-INF
[folder]ibmconfig
[file]application.xml
[file]ibm-application-bnd.xmi
[file]ibm-application-runtime.props
[file]MANIFEST.MF
[file]was.module
[file]was.policy
[file]was.webmodule
[file]myWAR.war
和文件deployment.xml中被放置在 .. \ ibmconfig \细胞\ defaultCell \应用程序\ defaultApp \部署\ defaultApp \
,其在形式内容
<?xml version="1.0" encoding="UTF-8"?>
<appdeployment:Deployment xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:appdeployment="http://www.ibm.com/websphere/appserver/schemas/5.0/appdeployment.xmi" xmi:id="Deployment_1417052686904">
<deployedObject xmi:type="appdeployment:ApplicationDeployment" xmi:id="ApplicationDeployment_1417052686904" deploymentId="0" startingWeight="1" binariesURL="$(APP_INSTALL_ROOT)/[server service name]Cell/myWAR.ear" useMetadataFromBinaries="false" enableDistribution="true" createMBeansForResources="true" reloadEnabled="false" appContextIDForSecurity="href:[server service name]Cell/myWAR" filePermission=".*\.dll=755#.*\.so=755#.*\.a=755#.*\.sl=755" allowDispatchRemoteInclude="false" allowServiceRemoteInclude="false" asyncRequestDispatchType="DISABLED" standaloneModule="true" enableClientModule="false">
<targetMappings xmi:id="DeploymentTargetMapping_1417052686904" enable="true" target="ServerTarget_1417052686904"/>
<classloader xmi:id="Classloader_1417052686904" mode="PARENT_FIRST"/>
<modules xmi:type="appdeployment:WebModuleDeployment" xmi:id="WebModuleDeployment_1417052686904" deploymentId="1" startingWeight="10000" uri="myWAR.war" containsEJBContent="0">
<targetMappings xmi:id="DeploymentTargetMapping_1417052686905" target="ServerTarget_1417052686904"/>
<classloader xmi:id="Classloader_1417052686905"/>
</modules>
<properties xmi:id="Property_1417052686904" name="metadata.complete" value="true"/>
</deployedObject>
<deploymentTargets xmi:type="appdeployment:ServerTarget" xmi:id="ServerTarget_1417052686904" name="server1" nodeName="[server service name]"/>
</appdeployment:Deployment>
(由于我没有声望,我必须在文本中完成所有操作。)
相关问题
- 1. Oozie Shared Lib:放置罐子的位置
- 2. Tomcat 6 vs 7 - lib vs shared/lib - jar只?
- 3. 如何使用actionbarsherlock lib配置现有项目的build.gradle文件?
- 4. 如何配置zend以访问netezza
- 5. EAR中的log4j配置
- 6. 如何用websphere配置jbpm?
- 7. 带Java7的Websphere 8.5.5.7:现有配置文件未启动
- 8. WebSphere MQ配置问题
- 9. 的WebSphere 8.5.5 EAR的拓扑
- 10. 无法访问Websphere
- 11. maven EAR插件配置
- 12. 的Websphere EAR模块依赖管理
- 13. 如何更改WebSphere Application Server(只读)配置文件的访问级别
- 14. websphere 8.0.1发布ear error
- 15. 在Websphere上访问EntityManager时出现NullPointerException
- 16. 删除或删除现有的Websphere Application Server的配置文件
- 17. 如何访问剪贴板数据以实现自动化?
- 18. 如何配置visual studio 2008以根据配置选择正确的.lib?
- 19. 访问Websphere变量
- 20. 文件在EAR包装没有发现
- 21. WebSphere Liberty配置文件JAXBContext ClassCastException
- 22. log4j和websphere 6.1配置
- 23. 如何从另一个EAR访问一个EAR中定义的EJB
- 24. 如何访问现有JIRA看板项目中配置的通道?
- 25. 如何克隆WebSphere 8配置文件
- 26. 如何为Websphere配置Oracle JDK?
- 27. 如何配置maven settings.xml以访问apache代理后面的nexus
- 28. 如何配置EnyimMemcachedCore以访问AWS Lambda中的Elasticache?
- 29. WS-Security Websphere配置
- 30. EAR文件和“WebSphere Enhanced EAR”之间的区别是什么?
问题是我们做了不想与整个服务器关联,因为有一些使用JSF1.2的应用程序,并且管理员不想通过服务器控制台进行关联(不知道为什么:))我设法通过创建一个条目来实现管理控制台在场景后面执行的操作标准deployment.xml.Thanks您的答案我已投票。 – Shahzeb
将共享库与整个服务器关联是一个很好的建议。 – Frans