BEA-Portal 异常解决案例分析

一、异常信息:
当在生产环境中登录portalAdmin应用时,左边的树无法展现,后台报错如下(测试环境正常):
<2008-6-23 下午03时06分21秒 CST> <Error> <Delegation> <BEA-403108>
<Exception while parsing DA hierarchy. DA Hierarchy XML:
<?xml version="1.0" encoding="UTF-8"?>
<hierarchy xmlns="http://www.bea.com/servers/p13n/xsd/delegation/hierarchy/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/servers/p13n/xsd/delegation/hierarchy/1.0.0 delegation-hierarchy-1_0_0.xsd"> <node name="PortalSystemDelegator" />
</hierarchy>
org.xml.sax.SAXParseException: Document is invalid: no grammar found.
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:76)
at com.bea.p13n.delegation.management.internal.DelegationHierarchyParser.
getDelegationHierarchy(DelegationHierarchyParser.java:102)
at com.bea.p13n.delegation.management.internal.DelegationHierarchyLDAPPersistenceManager.
parseData(DelegationHierarchyLDAPPersistenceManager.java:254)
at com.bea.p13n.delegation.management.internal.DelegationHierarchyLDAPPersistenceManager.
get(DelegationHierarchyLDAPPersistenceManager.java:228)
at com.bea.p13n.delegation.management.internal.DelegationHierarchyDelegate.
getHierarchyRoot(DelegationHierarchyDelegate.java:87)
at com.bea.p13n.delegation.management.DelegationRoleManager.getHierarchyRoot
(DelegationRoleManager.java:62)
at com.bea.jsptools.delegation.Pruner.isRootDARole(Pruner.java:143)

二、处理步骤:
1.异常定位:
通过后台所报异常为:
org.xml.sax.SAXParseException: Document is invalid: no grammar found.
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:76)
可初步判断为解析XML文件出错
2.解析器配置:
了解Weblogic在解析XML文件时寻找解析器的顺序:
(1)寻找JDK_Home/jre/lib目录下的JAXP.properties文件,而JDK1.4没有这个配置文件。一般JAXP.properties配置文件内容为:
javax.xml.transform.TransformerFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
javax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl
javax.xml.parsers.DocumentBuilderFactory=org.apache.xalan.processor.TransformerFactoryImpl
(2)通过Weblogic启动脚本CLASSPATH中寻找(在Weblogic启动脚本里没有发现,一般通过配置文件引入。常用解析器:xml-apis.jar;xercesImpl.jar)
(3)使用Weblogic默认解析器,位于weblogic.jar/META-INF/services/下的3个配置文件
3.通过后台日志输出的配置信息检查根因:
通过比较两个不同环境的后台nohup.out日志信息,发现在CLASSPATH有区别:
生产环境-CLASSPATH中指定了解析器:
/export/home/bea/imep/frameweb/WEB-INF/lib/xml-apis.jar:
/export/home/bea/imep/frameweb/WEB-INF/lib/xercesImpl.jar:
而测试环境中没有进行指定,进一步说明这两个jar包有问题,通过寻找jar包路径发现在/export/home/bea/imep/frameweb/WEB-INF/lib/路径下丢失了xml-apis.jar包,故解析XML出现异常

你可能感兴趣的:(java,apache,Web,xml,weblogic)