Your Ad Here
首页 | 编程语言 | 网站建设 | 游戏天堂 | 冲浪宝典 | 网络安全 | 操作系统 | 软件时空 | 硬件指南 | 病毒相关 | IT 认证
软讯网络 > 编程语言 > Java > Weblogic 9.2 部署 8.1 下运行的 EAR 出错的部分解决方法
【标  题】:Weblogic 9.2 部署 8.1 下运行的 EAR 出错的部分解决方法
【关键字】:Weblogic,9.2,8.1,EAR
【来  源】:http://www.blogjava.net/beansoft/archive/2007/02/02/97610.html

Weblogic 9.2 部署 8.1 下运行的 EAR 出错的部分解决方法

Your Ad Here

下个月是我们的 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 可以如此定义:

<? xml?version="1.0"?encoding="UTF-8" ?>
<! DOCTYPE?weblogic-web-app?PUBLIC?"-//BEA?Systems,?Inc.//DTD?Web?Application?8.1//EN"?"http://www.bea.com/servers/wls810/dtd/weblogic810-web-jar.dtd" >
< weblogic-web-app >
??
< security-role-assignment >
????
< role-name > adminGroup </ role-name >
??????
< principal-name > admin </ principal-name >
??
</ security-role-assignment >
??
< init-as >
????
< servlet-name > action </ servlet-name >
????
< principal-name > system </ principal-name >
??
</ init-as >
</ weblogic-web-app >

这段代码死活就过不去, Console 一直报错:

Error Unable to access the selected application. Error Exception in AppMerge flows' progression.

结果只能根据官方的 http://www.bea.com/ns/weblogic/90/weblogic-web-app.xsd 中的定义改成下面的格式:


<?xml?version='1.0'?encoding='UTF-8'?>
<weblogic-web-app?xmlns="http://www.bea.com/ns/weblogic/90"?xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"?xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee?http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd?http://www.bea.com/ns/weblogic/90?http://www.bea.com/ns/weblogic/90/weblogic-web-app.xsd">
??
<security-role-assignment>
????
<role-name>adminGroup</role-name>
????
<principal-name>admin</principal-name>
??
</security-role-assignment>
??
<servlet-descriptor>
????
<servlet-name>action</servlet-name>
????
<init-as-principal-name>system</init-as-principal-name>
??
</servlet-descriptor>
</weblogic-web-app>

这样才通过了 WAR 的发布. 参考: http://edocs.bea.com/wls/docs90/webapp/weblogic_xml.htmlhttp://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.


It's up to you!
Portable JSPWiki 1.1 简体中文版 下载:【上一篇】
编写一个启动同名 BAT 文件的 C 程序, 把 JAR 包进 EXE:【下一篇】
【相关文章】
  • JSP 文件下载的相对完整代码(解决中文问题和Weblogic报错)
  • 最近开始玩turbogears
  • Windows下安装、配置Weblogic
  • Learn to use Class in Javascript
  • Learn to be defensive
  • “让技术改变世界”,更要用技术打造中国的国际化!-写过园子里面一些类似Nbear的团队和一切承认自己是中国...
  • Creating OpenSearch plugins for Firefox
  • Python 流行 WEB FrameWork 之一《TurboGears快速入门》翻译
  • Learning----Advanced Bash-Scripting Guide
  • Learning----Advanced Bash-Scripting Guide 2
  • 【随机文章】
  • show modem test
  • CSS实用教程
  • 弹出窗口window.open的用法
  • 第二代BT软件eXeem全面使用攻略
  • 《程序员,建立你的商业意识》(二)
  • 利用VB实现浮动按钮
  • 王垠:离开是为了获得力量后再回来
  • hpux启动过程
  • Bootloader简介及UBOOT移植
  • 静态分析工具及使用总结(二)
  • 【相关评论】
    没有相关评论
    【发表评论】
    姓名:
    邮件:
    随机码*
    评论*
          
    |  首 页  |  版权声明  |  联系我们   |  网站地图  |
    CopyRight © 2004-2007 软讯网络 All Rigths Reserved.