title: Validation Error while deploying war file in Weblogic
body: <p>I got the following error while deploying war file in weblogic</p>
  
  <blockquote>
    <p>Message icon - Error VALIDATION PROBLEMS WERE FOUND &lt;5:4> problem: cvc->complex-type.2.3: Element 'web-app@<a href="http://java.sun.com/xml/ns/javaee" rel="nofollow">http://java.sun.com/xml/ns/javaee</a>' with element-only content type cannot have text content. &lt;14:5> problem: cvc-complex-type.2.4a: Expected element 'url-pattern@<a href="http://java.sun.com/xml/ns/javaee" rel="nofollow">http://java.sun.com/xml/ns/javaee</a>' instead of 'load-on-startup@<a href="http://java.sun.com/xml/ns/javaee" rel="nofollow">http://java.sun.com/xml/ns/javaee</a>' here in element servlet-mapping@<a href="http://java.sun.com/xml/ns/javaee" rel="nofollow">http://java.sun.com/xml/ns/javaee</a> &lt;18:5> problem: cvc-complex-type.2.4b: Element not allowed: listener-class@<a href="http://java.sun.com/xml/ns/javaee" rel="nofollow">http://java.sun.com/xml/ns/javaee</a> in element listener@<a href="http://java.sun.com/xml/ns/javaee" rel="nofollow">http://java.sun.com/xml/ns/javaee</a></p>
  </blockquote>
  
  <p>Below is my web.xml </p>
  
  <pre><code>&lt;web-app id="WebApp_ID" version="2.4"
  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 "&gt;
  &gt;
  &lt;display-name&gt;Archetype Created Web Application&lt;/display-name&gt;
  &lt;servlet&gt;
      &lt;servlet-name&gt;mvc-dispatcher&lt;/servlet-name&gt;
      &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet
      &lt;/servlet-class&gt;
  &lt;/servlet&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;mvc-dispatcher&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/&lt;/url-pattern&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet-mapping&gt;
  &lt;listener&gt;
      &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
      &lt;listener-class&gt;
          org.springframework.security.web.session.HttpSessionEventPublisher
      &lt;/listener-class&gt;
  &lt;/listener&gt;
      &lt;context-param&gt;
      &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
      &lt;param-value&gt;
          /WEB-INF/mvc-dispatcher-servlet.xml
      &lt;/param-value&gt;
  &lt;/context-param&gt;
  </code></pre>
  
  <p></p>
  
  <p>and here's my weblogic.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
   &lt;weblogic-web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app"
      xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-web-app ht
      tp://xmlns.oracle.com/weblogic/weblogic-web-app/1.4/weblogic-web-app.xsd"&gt;
      &lt;context-root&gt;/&lt;/context-root&gt;
      &lt;container-descriptor&gt;
              &lt;show-archived-real-path-enabled&gt;true&lt;/show-archived-real-path-enabled&gt;
              &lt;prefer-application-packages&gt;
                      &lt;package-name&gt;javax.faces.*&lt;/package-name&gt;
                      &lt;package-name&gt;com.sun.faces.*&lt;/package-name&gt;
                      &lt;package-name&gt;com.bea.faces.*&lt;/package-name&gt;
                      &lt;package-name&gt;org.slf4j.*&lt;/package-name&gt;
                      &lt;package-name&gt;com.google.common.*&lt;/package-name&gt;
              &lt;/prefer-application-packages&gt;
  
              &lt;prefer-application-resources&gt;
                      &lt;resource-name&gt;javax.faces.*&lt;/resource-name&gt;
                      &lt;resource-name&gt;com.sun.faces.*&lt;/resource-name&gt;
                      &lt;resource-name&gt;com.bea.faces.*&lt;/resource-name&gt;
                      &lt;resource-name&gt;com.google.common.*&lt;/resource-name&gt;
                      &lt;resource-name&gt;org/slf4j/impl/StaticLoggerBinder.class&lt;/resource-name&gt;
                      &lt;resource-name&gt;META-INF/services/javax.servlet.ServletContainerInitializer&lt;/resource-name&gt;
              &lt;/prefer-application-resources&gt;
      &lt;/container-descriptor&gt;
      &lt;session-descriptor&gt;
              &lt;cookie-secure&gt;true&lt;/cookie-secure&gt;
              &lt;url-rewriting-enabled&gt;false&lt;/url-rewriting-enabled&gt;
              &lt;!-- &lt;cookie-http-only&gt;true&lt;/cookie-http-only&gt; --&gt;
      &lt;/session-descriptor&gt;
      &lt;virtual-directory-mapping&gt;
              &lt;local-path&gt;/usr/local/WebLogic/wlApps/miDocs&lt;/local-path&gt;
              &lt;url-pattern&gt;/docs/*&lt;/url-pattern&gt;
      &lt;/virtual-directory-mapping&gt;
  </code></pre>
  
  <p></p>
  
  <p>The folder structure matches as per the description in the <a href="https://docs.oracle.com/cd/E13222_01/wls/docs92/webapp/configurewebapp.html" rel="nofollow">oracle website</a></p>
  
  <p>Any help is appreciated</p>