开发者

Deploy war problem

What does the following error error mean? I'm use eclipse and export web project as war file then I deploy to weblogic there is error message that I don't understand.

Message icon - Error Unable to access the selected application.
Message icon - Error Exception in AppMerge flows' progression
Message icon - Error Exception in AppMerge flows' progression
Message icon - Error VALIDATION PROBLEMS WERE FOUND problem: cvc-complex-type.2.4a: Expected elements 'description@http://java.sun.com/xml/ns/javaee display-name@http://java.sun.com/xml/ns/javaee icon@http://java.sun.com/xml/ns/javaee distributable@http://java.sun.com/xml/ns/javaee context-param@http://java.sun.com/xml/ns/javaee filter@http://java.sun.com/xml/ns/javaee filter-mapping@http://java.sun.com/xml/ns/javaee listener@http://java.sun.com/xml/ns/javaee servlet@http://java.sun.com/xml/ns/javaee servlet-mapping@http://java.sun.com/xml/ns/javaee session-config@http://java.sun.com/xml/ns/javaee mime-mapping@http://java.sun.com/xml/ns/javaee welcome-file-list@http://java.sun.com/xml/ns/javaee problem-page@http://java.sun.com/xml/ns/javaee jsp-config@http://java.sun.com/xml/ns/javaee security-constraint@http://java.sun.com/xml/ns/javaee login-config@http://java.sun.com/xml/ns/javaee security-role@http://java.sun.com/xml/ns/javaee env-entry@http://java.sun.com/xml/ns/javaee ejb-ref@http://java.sun.com/xml/ns/javaee ejb-local-ref@http://java.sun.com/xml/ns/javaee service-ref@http://java.sun.com/xml/ns/javaee resource-ref@http://java.sun.com/xml/ns/javaee resource-env-ref@http://java.sun.com/xml/ns/javaee message-destination-ref@http://java.sun.com/xml/ns/javaee persistence-context-ref@http://java.sun.com/xml/ns/javaee persistence-unit-ref@http://java.sun.com/xml/ns/javaee post-construct@http://java.sun.com/xml/ns/javaee pre-destroy@http://java.sun.com/xml/ns/javaee message-destination@http://java.sun.com/xml/ns/javaee locale-encoding-mapping-list@http://java.sun.com/xml/ns/javaee' instead of 'taglib@http://java.sun.com/xml/ns/javaee' here in element web-app@http://java.sun.com/xml/ns/javaee:<null> problem: cvc-complex-type.2.4a: Expected elements 'description@http://java.sun.com/xml/ns/javaee display-name@http://java.sun.com/xml/ns/javaee icon@http://java.sun.com/xml/ns/javaee distributable@http://java.sun.com/xml/ns/javaee context-param@http://java.sun.com/xml/ns/javaee filter@http://java.sun.com/xml/ns/javaee filter-mapping@http://java.sun.com/xml/ns/javaee listener@http://java.sun.com/xml/ns/javaee servlet@http://java.sun.com/xml/ns/javaee servlet-mapping@http://java.sun.com/xml/ns/javaee session-config@http://java.sun.com/xml/ns/javaee mime-mapping@http://java.sun.com/xml/ns/javaee welcome-file-list@http://java.sun.com/xml/ns/javaee problem-page@http://java.sun.com/xml/ns/javaee jsp-config@http://java.sun.com/xml/ns/javaee security-constraint@http://java.sun.com/xml/ns/javaee login-config@http://java.sun.com/xml/ns/javaee security-role@http://java.sun.com/xml/ns/javaee env-entry@http://java.sun.com/xml/ns/javaee ejb-ref@http://java.sun.com/xml/ns/javaee ejb-local-ref@http://java.sun.com/xml/ns/javaee service-ref@http://java.sun.com/xml/ns/javaee resource-ref@http://java.sun.com/xml/ns/javaee resource-env-ref@http://java.sun.com/xml/ns/javaee message-destination-ref@http://java.sun.com/xml/ns/javaee persistence-context-ref@http://java.sun.com/xml/ns/javaee persistence-unit-ref@http://java.sun.com/xml/ns/javaee post-construct@http://java.sun.com/xml/ns/javaee pre-destroy@http://java.sun.com/xml/ns/javaee message-destination@http://java.sun.com/xml/ns/javaee locale-encoding-mapping-list@http://java.sun.com/xml/ns/javaee' instead of 'taglib@http://java.sun.com/xml/ns/javaee' here in element web-app@http://java.sun.com/xml/ns/javaee:<null>
Message icon - Error VALIDATION PROBLEMS WERE FOUND problem: cvc-complex-type.2.4a: Expected elements 'description@http://java.sun.com/xml/ns/javaee display-name@http://java.sun.com/xml/ns/javaee icon@http://java.sun.com/xml/ns/javaee distributable@http://java.sun.com/xml/ns/javaee context-param@http://java.sun.com/xml/ns/javaee filter@http://java.sun.com/xml/ns/javaee filter-mapping@http://java.sun.com/xml/ns/javaee listener@http://java.sun.com/xml/ns/javaee servlet@http://java.sun.com/xml/ns/javaee servlet-mapping@http://java.sun.com/xml/ns/javaee session-config@http://java.sun.com/xml/ns/javaee mime-mapping@http://java.sun.com/xml/ns/javaee welcome-file-list@http://java.sun.com/xml/ns/javaee problem-page@http://java.sun.com/xml/ns/javaee jsp-config@http://java.sun.com/xml/ns/javaee security-constraint@http://java.sun.com/xml/ns/javaee login-config@http://java.sun.com/xml/ns/javaee security-role@http://java.sun.com/xml/ns/javaee env-entry@http://java.sun.com/xml/ns/javaee ejb-ref@http://java.sun.com/xml/ns/javaee ejb-local-ref@http://java.sun.com/xml/ns/javaee service-ref@http://java.sun.com/xml/ns/javaee resource-ref@http://java.sun.com/xml/ns/javaee resource-env-ref@http://java.sun.com/xml/ns/javaee message-destination-ref@http://java.sun.com/xml/ns/javaee persistence-context-ref@http://java.sun.com/xml/ns/javaee persistence-unit-ref@http://java.sun.com/xml/ns/javaee post-construct@http://java.sun.com/xml/ns/javaee pre-destroy@http://java.sun.com/xml/ns/javaee message-destination@http://java.sun.com/xml/ns/javaee locale-encoding-mapping-list@http://java.sun.com/xml/ns/javaee' instead of 'taglib@http://java.sun.com/xml/ns/javaee' here in element web-app@http://java.sun.com/xml/ns/javaee:<null> problem: cvc-complex-type.2.4a: Expected elements 'description@http://java.sun.com/xml/ns/javaee display-name@http://java.sun.com/xml/ns/javaee icon@http://java.sun.com/xml/ns/javaee distributable@http://java.sun.com/xml/ns/javaee context-param@http://java.sun.com/xml/ns/javaee filter@http://java.sun.com/xml/ns/javaee filter-mapping@http://java.sun.com/xml/ns/javaee listener@http://java.sun.com/xml/ns/javaee servlet@http://java.sun.com/xml/ns/javaee servlet-m开发者_如何学运维apping@http://java.sun.com/xml/ns/javaee session-config@http://java.sun.com/xml/ns/javaee mime-mapping@http://java.sun.com/xml/ns/javaee welcome-file-list@http://java.sun.com/xml/ns/javaee problem-page@http://java.sun.com/xml/ns/javaee jsp-config@http://java.sun.com/xml/ns/javaee security-constraint@http://java.sun.com/xml/ns/javaee login-config@http://java.sun.com/xml/ns/javaee security-role@http://java.sun.com/xml/ns/javaee env-entry@http://java.sun.com/xml/ns/javaee ejb-ref@http://java.sun.com/xml/ns/javaee ejb-local-ref@http://java.sun.com/xml/ns/javaee service-ref@http://java.sun.com/xml/ns/javaee resource-ref@http://java.sun.com/xml/ns/javaee resource-env-ref@http://java.sun.com/xml/ns/javaee message-destination-ref@http://java.sun.com/xml/ns/javaee persistence-context-ref@http://java.sun.com/xml/ns/javaee persistence-unit-ref@http://java.sun.com/xml/ns/javaee post-construct@http://java.sun.com/xml/ns/javaee pre-destroy@http://java.sun.com/xml/ns/javaee message-destination@http://java.sun.com/xml/ns/javaee locale-encoding-mapping-list@http://java.sun.com/xml/ns/javaee' instead of 'taglib@http://java.sun.com/xml/ns/javaee' here in element web-app@http://java.sun.com/xml/ns/javaee:<null>

This is my web.xml file

<?xml version="1.0" encoding="ISO-8859-1"?>


<web-app xmlns="http://java.sun.com/xml/ns/j2ee" 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"
 version="2.4">

  <display-name>Welcome to Tomcat</display-name>
   <description>
     Welcome to Tomcat
  </description>

    <servlet>
        <servlet-name>ServletLogin</servlet-name> 
        <servlet-class>com.ko.servlet.action.ServletLogin</servlet-class> 
    </servlet>
    <servlet-mapping>
        <servlet-name>ServletLogin</servlet-name>
        <url-pattern>/ServletLogin</url-pattern>  
    </servlet-mapping>

    <servlet>
        <servlet-name>TombolInfoGenerator</servlet-name> 
        <servlet-class>com.ko.servlet.action.TambolInfoGenerator</servlet-class> 
    </servlet>
    <servlet>
     <description>
     </description>
     <display-name>ArrestAction</display-name>
     <servlet-name>ArrestAction</servlet-name>
     <servlet-class>
     com.ko.servlet.ArrestAction</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>TombolInfoGenerator</servlet-name>
        <url-pattern>/TombolInfoGenerator</url-pattern>  
    </servlet-mapping>
    <servlet-mapping>
     <servlet-name>ArrestAction</servlet-name>
     <url-pattern>/ArrestAction</url-pattern>
    </servlet-mapping>


 <taglib>
  <taglib-uri>
   http://jsptags.com/tags/navigation/pager
    </taglib-uri>
    <taglib-location>
     /WEB-INF/jsp/pager-taglib.tld
    </taglib-location>
 </taglib>

 <taglib>
  <taglib-uri>
   http://java.sun.com/jstl/core
  </taglib-uri>
  <taglib-location>
   /WEB-INF/jstl/c.tld
  </taglib-location>

 </taglib>

 <welcome-file-list>
  <welcome-file>main.jsp</welcome-file>
 </welcome-file-list>

</web-app>


according to the XSD, the first description must come before the display name: (description*, display-name*, icon*)


according to the XSD you should include the inside a as follows:

<jsp-config>
    <taglib>
        <taglib-uri>http://jsptags.com/tags/navigation/pager</taglib-uri>
        <taglib-location>/WEB-INF/jsp/pager-taglib.tld</taglib-location>
    </taglib>
    <taglib>
        <taglib-uri>http://java.sun.com/jstl/core</taglib-uri>
        <taglib-location>/WEB-INF/jstl/c.tld</taglib-location>
    </taglib>
</jsp-config>

WebLogic performs XSD validation on the web.xml where other application servers like Tomcat do not. you can simply right click on your web.xml file inside eclipse and click on validate to fix all the problems before exporting a WAR.


This error occurred was due to the web.xml of the application contained special character in the file. Before redeploy the application, do make sure the web.xml and weblogic.xml does not contain any special characters, unsupported tag or symbol in the file.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜