如何覆盖 WebSphere“增强型 EAR”配置条目?
我正在开发 WebSphere 6.1 EAR 应用程序,我需要覆盖 META-INF/ibconfig 目录中指定的配置条目。存在额外的配置文件,用于描述各种服务器对象 - 从 JDBC 到共享库和链接。问题是这些设置会覆盖服务器上已定义的设置。
具体来说,如果我已经在服务器上安装了一个应用程序,并且已经创建了共享库和引用,并且安装了增强型 EAR 作为该应用程序的更新,那么来自 EAR 的应用程序将优先并清除以前创建的内容。
我寻求的是一些部署选项 - 用于管理控制台或 wsadmin - 允许忽略这些配置条目,而无需实际从 EAR 文件中删除它们。
最好,提前谢谢你。
I am developing WebSphere 6.1 EAR app and I need to override configuration entries specified in META-INF/ibconfig directory. There reside extra configuration files, that describe various server objects - from JDBC to shared libraries and links. The problem is that these settings override those already defined at server.
Specifically, if I have an application already installed on server and Shared libraries and refs already created and install Enhanced EAR as update to that application, those from EAR will prevail and will purge previously created.
What I seek is some deployment options - for admin console or for wsadmin - that will allow to ignore these configuration entries without actually deleting them from EAR file.
Best, and thank you in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我们使用 python(实际上是 jython)部署脚本来设置所有配置。大多数配置是从 maven 在创建 Ear 的过程中使用的文件中读取的,因此可以最大限度地减少拼写错误的风险
。请查看文档中的所有选项。
We use a python (actually jython) deploy script where all our configuration is set. Most of the configuration is read from files which are also used by maven in the process of creating the ear, and so minimizing the risk of typo's
Have a look in the documentation for all options.
有一个部署选项可用于忽略更新的 EAR 文件中的应用程序绑定,这样安装的 EAR 中的现有配置优先。当 使用
wsadmin
更新您的应用程序,选项为update.ignore.new
。如果使用管理控制台更新您的应用程序,可以通过从 "准备应用程序update” 更新过程中的步骤。这应该可以实现您正在寻找的目标。例如,假设您的应用程序中有一个名为“
jdbc/MyDataSource
”的资源引用,该引用映射到您安装的安装中的jdbc/ProductionDataSource
应用程序,并且您正在使用 EAR 文件版本更新此应用程序,该版本将此资源引用映射到 IBM 配置文件中的jdbc/TestDataSource
。使用update.ignore.new
选项,在您完成应用程序更新后,此资源引用将继续保持映射到jdbc/ProductionDataSource
的状态。 (请注意,WAS 中的默认部署行为是,不使用此选项,资源引用将映射到更新后的jdbc/TestDataSource
除非您在部署过程中明确覆盖它。)There is a deployment option that can be used to ignore the application bindings in your updated EAR file, such that the existing configuration in your installed EAR takes precedence. When updating your application using
wsadmin
, the option isupdate.ignore.new
. If updating your application using the admin console, this option is available by selecting the "use existing bindings" option from the "Preparing for the application update" step during the update.This should accomplish what it seems that you are looking for. For example, consider that you have a resource reference in your application named "
jdbc/MyDataSource
" that is mapped tojdbc/ProductionDataSource
in your installed application, and you are updating this application with a version of the EAR file that maps this resource reference tojdbc/TestDataSource
in the IBM config files. Using theupdate.ignore.new
option, this resource reference will continue to remain mapped tojdbc/ProductionDataSource
after you have completed your application update. (Note that the default deployment behavior in WAS is that, without using this option, the resource reference would map tojdbc/TestDataSource
in your updated application unless you explicitly overrode it otherwise during the deployment process.)