1.问题: XMLBeans Weblogic8.1冲突
To override the weblogic.jar with your own QName.jar, your need to do the following:
Add the QName JAR file (qname.jar) into the WEB-INF/lib folder in your WAR file
Add a file weblogic.xml into the WEB-INF folder in your WAR file
Below is an example weblogic.xml file:
<!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> <container-descriptor> <prefer-web-
inf-classes>true</prefer-web-inf-classes> </container-descriptor></weblogic-web-app>
注:当WEB-INF目录下的包与系统CLASSPATH所设定的第三方包相同的时候,缺省情况下Weblogic会优先使用CLASSPATH下的那个包。如果想使用
WEB-INF下面的包,需要在weblogic.xml下面配置
<weblogic-web-app>
<container-descriptor>
<prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>
</weblogic-web-app>
2.问题:在生成的xml中加上xsi:schemaLocation attribute
How can I instruct XMLBeans to add the xsi:schemaLocation attribute
to my documents?
Here's how to do it. Assume that you have a document represented by
the doc XmlObject (obtained via TestDocument.Factory.newInstance()
or TestDocument.Factory.parse()) and you need an xsi:schemaLocation
attribute on it, with value from the location String.
加上:
XmlCursor cursor = doc.newCursor();
if (cursor.toFirstChild())
{
cursor.setAttributeText(new QName
("http://www.w3.org/2001/XMLSchema-instance","noNamespaceSchemaLocation"),
location);
}
本文介绍了解决XMLBeans与Weblogic8.1版本冲突的方法,通过在WAR文件的WEB-INF目录下放置特定的QName JAR文件,并配置weblogic.xml来优先使用应用内的类。同时,还提供了如何在XMLBeans生成的XML文件中加入xsi:schemaLocation属性的具体步骤。

2077

被折叠的 条评论
为什么被折叠?



