下个月是我们的 Weblogic 9 升级主题月.
1) 关于元素定义唯一性的问题
Weblogic 9.2 是 BEA 最新推出的应用服务器, 据说性能一流, 我发现除了占用内存有点多以外, 还有别的问题: 8.1 下的应用发布上去总是多少报错, 甚至根本就通不过第一关: 验证配置文件有效性.
例如今天同事发现的问题, 发布一个8.1下好好的 MDB, 就是过不去, 报错如下:
Caused by: java.io.IOException: [J2EE Deployment SPI:260106]Failed to parse desc
riptor at 'META-INF/weblogic-ejb-jar.xml' for module 'RDSEJBs.jar': weblogic.des
criptor.BeanAlreadyExistsException: Bean already exists: "weblogic.j2ee.descript
or.CmpFieldBeanImpl@e7da3855(//[ReportEntity]/CmpFields[reportNo])"
??????? at weblogic.deploy.api.spi.config.DescriptorParser.getWeblogicDescriptor
Bean(DescriptorParser.java:519)
其它相关的错误信息还有好几个, 例如: weblogic.application.ModuleException: Unmarshaller failed at weblogic.servlet.internal.WebAppModule.loadDescriptor(WebAppModule.java:766).
最后 Google 了一把, 发现这个问题的解决方案还真是少, 最后还好 BEA 的 DEV2DEV 搞定了我的疑问:
http://forums.bea.com/bea/message.jspa?messageID=600019564&tstart=0
他们的答案就是: 虽然不用升级 XML 文件的格式, 但是还是得保证元素的定义不能重复, 例如: 重复的 servlet-mapping, 重复的 CMP Mapping ID 声明.
BEA 的文档说道:
In this release of WebLogic Server, weblogic-ejb-jar.xml is XML Schema-based XSD). In prior releases, weblogic-ejb-jar.xml was Document Type Definition-based (DTD). For backward compatibility, this release of WebLogic Server supports XSD- or DTD-based EJB descriptors. In this release of WebLogic Server, the EJB container still supports all older DTD-based descriptors; you can deploy applications that use DTD-based descriptors in this release of WebLogic Server without modifying the descriptors.
In http://e-docs.bea.com/wls/docs92/ejb/DDreference-ejb-jar.html
你看这段,bea说虽然9变成用xsd但是用以前的dtd也支持的still supports all older DTD-based descriptors!!
最后怎么办呢, 经过细致检查, 果然发现他们在 ejb-jar.xml 和 weblogic-rdbms.xml (哈,记不清了,大致这个名字) 重复生成了两次 CMP Mapping 定义. 删除其中一个, 搞定.
2) 关于安全声明的变动
例如 8.1 中的 WAR 包中的 weblogic.xml 可以如此定义:
Error Unable to access the selected application. Error Exception in AppMerge flows' progression.
结果只能根据官方的 http://www.bea.com/ns/weblogic/90/weblogic-web-app.xsd 中的定义改成下面的格式:
这样才通过了 WAR 的发布. 参考: http://edocs.bea.com/wls/docs90/webapp/weblogic_xml.html
http://www.bea.com/ns/weblogic/90/weblogic-web-app.xsd.
3. JMS 的变化
JMS 已经变的面目全非了, 基本上不改就能 Run 的应用貌似还没吧... 参考:
Weblogic 9 中的 JMS 管理文档:
http://e-docs.bea.com/wls/docs90/jms_admin/index.html
New and Changed JMS Features In This Release? http://e-docs.bea.com/wls/docs90/jms_admin/intro.html#1059096
最后给大家一个升级实施描述符的小诀窍:Using BEA Workshop to upgrade the weblogic.xml: Create an EAR project, within
it is a war project, then open the weblogic.xml, right click and select "Upgrade
Source File(s) ...", then the report will display what errors in this file.