集成 – 如何将Weblogic的config.xml迁移到多台机器?

我们的开发团队开发了一个在Weblogic 10.3上运行的J2EE应用程序.每台开发机器都运行自己的Weblogic 10.3应用服务器副本.开发环境的Weblogic域最初是在一台机器上创建的,然后使用Weblogic的配置工具(bea10 / wlserver_10.3 / common / bin / config.cmd)复制到所有机器上.

每台开发机器都有自己的config.xml副本.此文件中的所有密码(JDBC数据源等)都是加密的,加密显然在每台计算机上使用不同的种子,因为相同的密码在不同的计算机上具有不同的加密形式.

问题是每隔一段时间就需要更新config.xml(例如添加新EJB时),并且需要在所有计算机上应用更新.我们该怎么做呢?如果我们只是将文件放在CVS中并从那里更新其他机器,则每台机器上的加密密码都会被覆盖.当服务器尝试解密最初在另一台机器上加密的密码短语时,这会导致难以辨认的paddingexceptions.

是否存在ant任务(我找不到)或类似的机制,可以在不覆盖加密密码的情况下正确合并config.xml中的更改?或者是否有可能以某种方式指定明文中的密码并在第一次启动时加密它们(我有一个微弱的回忆,这在以前的版本中是可能的,但在10.3中却没有).

开发Weblogic的开发团队如何处理这个问题?

BR,

马尔科

解决方法

[…] Each development machine has its own
copy of config.xml. All the
passphrases (those for JDBC
datasources etc.) in this file are
encrypted …

是的,WebLogic Server会加密存储在其域配置XML文件中的所有纯文本密码.这是为了防止访问敏感信息.使用管理控制台或脚本工具输入密码时,它会在存储到配置XML文件之前自动加密.

… and the encryption
apparently uses a different seed on
each machine since the same password
has different encrypted forms on
different machines.

关于encrypt实用程序(来自Oracle WebLogic Server Java实用程序),文档说:

The weblogic.security.Encrypt encrypts cleartext strings for use with WebLogic Server. The utility uses the encryption service of the current directory,or the encryption service for a specified WebLogic Server domain root directory.

Note: An encrypted string must have been encrypted by the encryption service in the WebLogic Server domain where it will be used. If not,the server will not be able to decrypt the string.

这在文档中没有提到,但是,AFAIK,Weblogic使用域的密码salt文件(SerializedSystemIni.dat)来加密明文字符串.

[…] If we just put the file in CVS and update the other machines from there the encrypted passwords on each machine would get overwritten.

您可以选择在VCS中存储的config.xml中使用明文密码(如果这不是问题).实际上,在WebLogic Server 9.0之前,密码将在后续重新启动期间加密.从WebLogic Server 9.0开始,仅在开发域中“完全”支持配置文件中使用明文密码,并且Weblogic不会重新加密密码.在这两种情况下,这将允许人们检查配置文件没有麻烦.

Is there an ant task (I Couldn’t find one) or a similar mechanism that would take care of correctly merging the changes in config.xml without overwriting the encrypted passwords?…

我不确定这会直接回答您的问题,但Oracle WebLogic Server为其大部分(如果不是全部)Java Utilities提供了Ant tasks.也许你会在那里找到有用的东西(查看Configuring a WebLogic Server Domain Using the wlconfig Ant Task)

Or is it possible to somehow specify the passphrases in plaintext and encrypt them on the first start (I have a faint recollection that this was possible in prevIoUs versions but not in 10.3).

正如我上面所写,这是Weblogic Server 9.0之前的“认”行为.我不知道你是否可以为以后的版本强制执行此行为.当然,你总是可以使用ant和encrypt来实现它,但老实说,如果你允许人们一次看到明文密码,我真的没有看到在事实之后加密它们的重点.

相关文章

php输出xml格式字符串
J2ME Mobile 3D入门教程系列文章之一
XML轻松学习手册
XML入门的常见问题(一)
XML入门的常见问题(三)
XML轻松学习手册(2)XML概念