Failed to load configuration

Splash Forums PrettyFaces Users Failed to load configuration

This topic contains 7 replies, has 3 voices, and was last updated by  Lincoln Baxter III 6 years, 9 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #17843

    Robe Eleckers
    Participant

    Hello,

    I’m trying to include prettyfaces in my web project. I followed http://ocpsoft.com/docs/prettyfaces/3.1.0/en-US/html/GettingStarted.html, however I get an exception:

    SEVERE: WebModule[/test]: PWC1321: Error invoking requestInitialized method on ServletRequestListener com.ocpsoft.pretty.faces.config.PrettyConfigListener

    com.ocpsoft.pretty.PrettyException: Failed to load configuration.

    at com.ocpsoft.pretty.faces.config.PrettyConfigurator.configure(PrettyConfigurator.java:112)

    at com.ocpsoft.pretty.faces.config.PrettyConfigListener.requestInitialized(PrettyConfigListener.java:22)

    at org.apache.catalina.core.StandardContext.fireRequestInitializedEvent(StandardContext.java:4525)

    at org.apache.catalina.core.StandardContextValve.preInvoke(StandardContextValve.java:360)

    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)

    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)

    at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)

    at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)

    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)

    at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:325)

    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:226)

    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)

    at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)

    at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)

    at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)

    at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)

    at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)

    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)

    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)

    at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)

    at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)

    at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)

    at com.sun.grizzly.ContextTask.run(ContextTask.java:69)

    at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)

    at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)

    at java.lang.Thread.run(Thread.java:619)

    Caused by: java.lang.NullPointerException

    at org.apache.commons.digester.Digester.getXMLReader(Digester.java:1068)

    at org.apache.commons.digester.Digester.parse(Digester.java:1916)

    at com.ocpsoft.pretty.faces.config.DigesterPrettyConfigParser.parse(DigesterPrettyConfigParser.java:69)

    at com.ocpsoft.pretty.faces.config.PrettyConfigurator.feedWebAppConfig(PrettyConfigurator.java:240)

    at com.ocpsoft.pretty.faces.config.PrettyConfigurator.configure(PrettyConfigurator.java:100)

    My /WEB-INF/pretty-config.xml contains:

    <pretty-config xmlns="http://ocpsoft.com/prettyfaces/3.1.0"

    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

    xsi:schemaLocation="http://ocpsoft.com/prettyfaces/3.1.0

    http://ocpsoft.com/xml/ns/prettyfaces/ocpsoft-pretty-faces-3.1.0.xsd">

    <!-- Begin RewriteRules -->

    <rewrite trailingSlash="append" toCase="lowercase" />

    <rewrite match="^/old-url/(w+)/$" substitute="/new_url/$1/" redirect="301" />

    <!-- Begin UrlMappings -->

    <url-mapping id="custom">

    <pattern value="/custom/#{myBean.ref}/" />

    <view-id>/template.xhtml</view-id>

    </url-mapping>

    </pretty-config>

    My /WEB-INF/web.xml:

    <servlet>

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

    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>

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

    </servlet>

    <servlet-mapping>

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

    <url-pattern>*.xhtml</url-pattern>

    </servlet-mapping>

    <filter>

    <filter-name>MyFilter</filter-name>

    <filter-class>filter.MyFilter</filter-class>

    </filter>

    <filter-mapping>

    <filter-name>MyFilter</filter-name>

    <url-pattern>*.xhtml</url-pattern>

    </filter-mapping>

    <listener>

    <listener-class>webinterface.support.ILCListener</listener-class>

    </listener>

    I also added the following part to my web.xml, but it does not make any difference:

    <filter>

    <filter-name>Pretty Filter</filter-name>

    <filter-class>com.ocpsoft.pretty.PrettyFilter</filter-class>

    </filter>

    <filter-mapping>

    <filter-name>Pretty Filter</filter-name>

    <url-pattern>/*</url-pattern>

    <dispatcher>FORWARD</dispatcher>

    <dispatcher>REQUEST</dispatcher>

    <dispatcher>ERROR</dispatcher>

    </filter-mapping>

    Any ideas? Am I missing something?

    #20561

    Hm, it looks like the Apache commons Digester is not correctly set up. How are you including PrettyFaces? Via Maven?

    Which version of JSF are you using? Which appserver?

    It’s possible that the wrong version of Digester, or perhaps one of its dependencies (Collections, or Logging) is not correctly being included in the project.

    #20562

    Which version of digester do you have in your classpath? There seems to be some NullPointerException inside Digester while PrettyFaces parses your web.xml. Could you check the digester version and post your complete web.xml (including doctype/namespace declarations)?

    #20563

    Robe Eleckers
    Participant

    Thanks. Currently using the following libs (no maven at this moment):

    commons-beanutils-1.8.3

    commons-collections-3.2.1 (also tried with collections-2.1, no difference)

    commons-digester-2.1

    commons-logging-1.1.1

    Running JSF2.0 in Glassfish 3.0.1.

    EDIT: complete web.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
    <context-param>
    <param-name>javax.faces.PROJECT_STAGE</param-name>
    <param-value>Development</param-value>
    </context-param>

    <context-param>
    <param-name>javax.faces.FACELETS_LIBRARIES</param-name>
    <param-value>/WEB-INF/test.taglib.xml</param-value>
    </context-param>

    <filter>
    <filter-name>MyFilter</filter-name>
    <filter-class>filter.MyFilter</filter-class>
    </filter>

    <filter-mapping>
    <filter-name>MyFilter</filter-name>
    <url-pattern>*.xhtml</url-pattern>
    </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>

    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.xhtml</url-pattern>
    </servlet-mapping>

    <filter>
    <filter-name>MyFilter</filter-name>
    <filter-class>filter.MyFilter</filter-class>
    </filter>

    <filter-mapping>
    <filter-name>MyFilter</filter-name>
    <url-pattern>*.xhtml</url-pattern>
    </filter-mapping>

    <listener>
    <listener-class>listener.MYListener</listener-class>
    </listener>

    </web-app>

    #20565

    I had a quick look at the Digester code. It seems like Digester is unable to create a SAXParser. What JDK are you using? Are there any other exceptions thrown earlier?

    #20566

    If he’s on GlassFish 3.0.1, it’s got to be at least a JRE6 environment, I’m betting Sun’s Java, but I could be wrong.

    #20567

    Robe Eleckers
    Participant

    I think I found the problem. I also had an old version of java xml-apis in my classpaths. Updated these to the newest versions. Now I don’t get the errors anymore.

    Thanks for the hints which moved me in the right direction.

    #20568

    Awesome! Glad you got it working :) Let us know if you have other questions!

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.

Comments are closed.