如何覆盖 WebSphere“增强型 EAR”配置条目?

发布于 2024-11-29 11:58:10 字数 338 浏览 1 评论 0原文

我正在开发 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

尘曦 2024-12-06 11:58:10

我们使用 python(实际上是 jython)部署脚本来设置所有配置。大多数配置是从 maven 在创建 Ear 的过程中使用的文件中读取的,因此可以最大限度地减少拼写错误的风险

AdminApp.install(earFile,['-MapResRefToEJB',createResRefMap(),'-MapModulesToServers', createModuleMap(), '-MapRolesToUsers', createRoleMap()])
setAppClassLoading()
AdminConfig.save()
AdminControl.invoke(appServer,'startApplication',appName)

。请查看文档中的所有选项。

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

AdminApp.install(earFile,['-MapResRefToEJB',createResRefMap(),'-MapModulesToServers', createModuleMap(), '-MapRolesToUsers', createRoleMap()])
setAppClassLoading()
AdminConfig.save()
AdminControl.invoke(appServer,'startApplication',appName)

Have a look in the documentation for all options.

蓝色星空 2024-12-06 11:58:10

有一个部署选项可用于忽略更新的 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 is update.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 to jdbc/ProductionDataSource in your installed application, and you are updating this application with a version of the EAR file that maps this resource reference to jdbc/TestDataSource in the IBM config files. Using the update.ignore.new option, this resource reference will continue to remain mapped to jdbc/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 to jdbc/TestDataSource in your updated application unless you explicitly overrode it otherwise during the deployment process.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文