weblogic.xml 中的错误:cvc-complex-type.2.4.a:发现以元素“prefer-application-packages"开头的无效内容

2022-01-10 00:00:00 xml xml-parsing spring java spring-mvc

我正在使用 springs 源工具套件.我在 weblogic.xml 文件中遇到错误--

I am using springs source tool suite. I am getting an error in weblogic.xml file--

cvc-complex-type.2.4.a: Invalid content was found starting with element 'prefer-   
application-packages'. One of '{"http://www.bea.com/ns/weblogic/weblogic-web-app":retain-
original-url, "http://www.bea.com/ns/weblogic/weblogic-web-app":show-archived-real-path-
enabled, "http://www.bea.com/ns/weblogic/weblogic-web-app":require-admin-traffic,    
"http://www.bea.com/ns/weblogic/weblogic-web-app":access-logging-disabled}' is expected.
enter code here

我的 weblogic.xml 看起来像这样

and my weblogic.xml looks like this

<?xml version="1.0"?>
<weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/weblogic-web-app"     
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-web-app   
http://www.bea.com/ns/weblogic/weblogic-web-app/1.0/weblogic-web-app.xsd">
<jsp-descriptor>
    <keepgenerated>true</keepgenerated>
    <page-check-seconds>60</page-check-seconds>
    <precompile>true</precompile>
    <precompile-continue>true</precompile-continue>
</jsp-descriptor>
<container-descriptor>
    <optimistic-serialization>true</optimistic-serialization>
    <prefer-application-packages>
        <package-name>antlr.*</package-name>
        <package-name>javax.persistence.*</package-name>
        <package-name>org.apache.commons.*</package-name>  
    </prefer-application-packages>
    <show-archived-real-path-enabled>true</show-archived-real-path-enabled>
</container-descriptor>

</weblogic-web-app>

错误显示在标签的开头..

the error is shown at the beginning of tag..

推荐答案

weblogic-web-app
xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-web-app"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd
http://xmlns.oracle.com/weblogic/weblogic-web-app
http://xmlns.oracle.com/weblogic/weblogic-web-app/1.4/weblogic-web-app.xsd">

将命名空间更改为上述命名空间..现在可以使用..

changed the namespace to the above one.. it worked now..

相关文章