Skip to Content
avatar image
Former Member

Problem with JSF

Hello!

I have problem with my JSF project. The error is

<i>java.lang.IllegalStateException: org.apache.myfaces.webapp.webxml.WebXml.init must be called before!</i>

The problem is with SAP WAS SP17 with IBM JDK (XML Parser: Xeces).

It works OK on SAP WAS SP15-16 (Linux, Windows).

List of jars is

commons-beanutils.jar

jdom.jar

commons-codec.jar

jstl.jar

commons-collections-2.1.1.jar

junit.jar

commons-dbcp.jar

log4j-1.2.11.jar

commons-digester.jar

myfaces-api.jar

commons-el-1.0.jar

myfaces-impl.jar

commons-lang.jar

commons-logging-1.0.4.jar

commons-pool.jar

geronimo-spec-jsp-2.0-rc2.jar

tomahawk.jar

When I have deleted geronimo-spec-jsp-2.0-rc2.jar I see another error

<i>java.lang.IllegalStateException: No Factories configured for this Application - typically this is because a context listener is not setup in your web.xml.

A typical config looks like this;

<listener>

<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>

</listener>

at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:84)

at javax.faces.webapp.FacesServlet.init(FacesServlet.java:73)

at com.sap.engine.services.servlets_jsp.server.runtime.context.WebComponents.getServlet(WebComponents.java(Compiled Code))

</i>

The same error appears with <b>Crimson</b> parser.

Could you help me?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Oct 23, 2006 at 10:16 AM

    Dear Denis !

    if you use WAs 6.40, you must know taht listeners are loaded AFTER servlets, so probably problem is somewhere here. I propose you to find

    replace

    "

    <listener>

    <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>

    </listener>

    "

    for something like

    <Servlet>

    <servlet-class>org.apache.myfaces.webapp.StartupServletContextServlet</listener-class>

    <Load on startup> 1 </ load on startup>

    </Servlet>

    I am not sure that StartupServletContextServlet exists in myFaces, so the only way out is to create that one manually and fill it with the functionality of the org.apache.myfaces.webapp.StartupServletContextListener class.

    Good luck !

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 30, 2006 at 03:37 PM

    Hi Denis,

    I encountered the same problem and found with the information of Eugene the following javadoc lines in the class org.apache.myfaces.webapp.FacesServlet in the jar myfaces-impl-1.1.4.jar.

    /**

    • Derived FacesServlet that can be used for debugging purpose

    • and to fix the Weblogic startup issue (FacesServlet is initialized before ServletContextListener).

    *

    [...]

    */

    So that FacesServlet adresses the problem Eugene spoke of. You simply need to replace your servlet declaration in your web.xml to

    <servlet>

    <servlet-name>Faces Servlet</servlet-name>

    <servlet-class>org.apache.myfaces.webapp.MyFacesServlet</servlet-class>

    <load-on-startup>1</load-on-startup>

    </servlet>

    and you're done.

    Best Regards

    Add comment
    10|10000 characters needed characters exceeded