Spartan
Spartan

Reputation: 1174

Perhaps your web.xml contains a typo? omnifaces 1.8.1

I am using Omnifaces 1.8.1 and I got this error while starting Tomcat 7

WebXml failed to initialize. Perhaps your web.xml contains a typo? java.lang.ClassNotFoundException: at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at org.omnifaces.config.WebXml.parseErrorPageLocations(WebXml.java:434) at org.omnifaces.config.WebXml.init(WebXml.java:147) at org.omnifaces.facesviews.FacesViewsInitializerListener.contextInitialized(FacesViewsInitializerListener.java:63) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5016) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5524) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)

web.xml :

<context-param>
    <param-name>org.omnifaces.FACES_VIEWS_SCAN_PATHS</param-name>
    <param-value>/*.xhtml</param-value>
</context-param>




    <filter>
            <filter-name>characterEncodingFilter</filter-name>
            <filter-class>org.omnifaces.filter.CharacterEncodingFilter</filter-class>
    </filter>
    <filter-mapping>
            <filter-name>characterEncodingFilter</filter-name>
            <url-pattern>/*</url-pattern>
    </filter-mapping>

<!--     <filter> -->
<!--             <filter-name>facesExceptionFilter</filter-name> -->
<!--             <filter-class>org.omnifaces.filter.FacesExceptionFilter</filter-class> -->
<!--     </filter> -->
<!--     <filter-mapping> -->
<!--             <filter-name>facesExceptionFilter</filter-name> -->
<!--             <servlet-name>Faces Servlet</servlet-name> -->
<!--     </filter-mapping> -->

    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

Upvotes: 0

Views: 758

Answers (2)

Vrushank
Vrushank

Reputation: 2813

at org.omnifaces.config.WebXml.parseErrorPageLocations(WebXml.java:434)

WebXml is a utility class in omnifaces which provides methods to frequently used web.xml elements.

The above line in the stacktrace shows that you have configured an exception class which does not exist in the classspath.

Please post your <error-page/> tag snippet in web.xml

Upvotes: 1

kachanov
kachanov

Reputation: 2765

ClassNotFoundException means your xml contains a class that cannot be found in the CLASSPATH: either it is a typo - or class is missing because some jar is missing or in wrong place

org.omnifaces.filter.CharacterEncodingFilter ?

Upvotes: 0

Related Questions