2

I got the following error while deploying war file in weblogic

Message icon - Error VALIDATION PROBLEMS WERE FOUND <5:4> problem: cvc->complex-type.2.3: Element 'web-app@http://java.sun.com/xml/ns/javaee' with element-only content type cannot have text content. <14:5> problem: cvc-complex-type.2.4a: Expected element 'url-pattern@http://java.sun.com/xml/ns/javaee' instead of 'load-on-startup@http://java.sun.com/xml/ns/javaee' here in element servlet-mapping@http://java.sun.com/xml/ns/javaee <18:5> problem: cvc-complex-type.2.4b: Element not allowed: listener-class@http://java.sun.com/xml/ns/javaee in element listener@http://java.sun.com/xml/ns/javaee

Below is my web.xml

<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 ">
>
<display-name>Archetype Created Web Application</display-name>
<servlet>
    <servlet-name>mvc-dispatcher</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet
    </servlet-class>
</servlet>
<servlet-mapping>
    <servlet-name>mvc-dispatcher</servlet-name>
    <url-pattern>/</url-pattern>
    <load-on-startup>1</load-on-startup>
</servlet-mapping>
<listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    <listener-class>
        org.springframework.security.web.session.HttpSessionEventPublisher
    </listener-class>
</listener>
    <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>
        /WEB-INF/mvc-dispatcher-servlet.xml
    </param-value>
</context-param>

and here's my weblogic.xml

<?xml version="1.0" encoding="UTF-8"?>
 <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">
    <context-root>/</context-root>
    <container-descriptor>
            <show-archived-real-path-enabled>true</show-archived-real-path-enabled>
            <prefer-application-packages>
                    <package-name>javax.faces.*</package-name>
                    <package-name>com.sun.faces.*</package-name>
                    <package-name>com.bea.faces.*</package-name>
                    <package-name>org.slf4j.*</package-name>
                    <package-name>com.google.common.*</package-name>
            </prefer-application-packages>

            <prefer-application-resources>
                    <resource-name>javax.faces.*</resource-name>
                    <resource-name>com.sun.faces.*</resource-name>
                    <resource-name>com.bea.faces.*</resource-name>
                    <resource-name>com.google.common.*</resource-name>
                    <resource-name>org/slf4j/impl/StaticLoggerBinder.class</resource-name>
                    <resource-name>META-INF/services/javax.servlet.ServletContainerInitializer</resource-name>
            </prefer-application-resources>
    </container-descriptor>
    <session-descriptor>
            <cookie-secure>true</cookie-secure>
            <url-rewriting-enabled>false</url-rewriting-enabled>
            <!-- <cookie-http-only>true</cookie-http-only> -->
    </session-descriptor>
    <virtual-directory-mapping>
            <local-path>/usr/local/WebLogic/wlApps/miDocs</local-path>
            <url-pattern>/docs/*</url-pattern>
    </virtual-directory-mapping>

The folder structure matches as per the description in the oracle website

Any help is appreciated

2 Answers 2

1

Thinky ou have two Problems here:

xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee ">
>

First a blank at the end of the schemaLocation. Second > is too much

Sign up to request clarification or add additional context in comments.

Comments

0
<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 ">
>
<display-name>Archetype Created Web Application</display-name>
    <servlet>
        <servlet-name>mvc-dispatcher</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet
        </servlet-class>
        <load-on-startup>1</load-on-startup>        
    </servlet>
    <servlet-mapping>
        <servlet-name>mvc-dispatcher</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener
        </listener-class>
    </listener>
    <listener>
        <listener-class>
            org.springframework.security.web.session.HttpSessionEventPublisher
        </listener-class>
    </listener> 
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>
            /WEB-INF/mvc-dispatcher-servlet.xml
        </param-value>
    </context-param>
</web-app>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.