Null Pointer Exception at com.ocpsoft.pretty.PrettyContext.getCurrentMapping …

Splash Forums PrettyFaces Users Null Pointer Exception at com.ocpsoft.pretty.PrettyContext.getCurrentMapping …

This topic contains 9 replies, has 3 voices, and was last updated by  clercmedia 11 years, 1 month ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
  • #17840


    Hello guy’s , im new to PrettyFaces, and I want to put this nice features in my new project.

    Well , im having some difficulties now to make this work. Its not simple like in the little video for me and I dont understand what happened.

    This is the stack trace :

    at com.ocpsoft.pretty.PrettyContext.getCurrentMapping(
    at com.ocpsoft.pretty.PrettyContext.isPrettyRequest(
    at com.ocpsoft.pretty.PrettyContext.shouldProcessDynaview(
    at com.ocpsoft.pretty.faces.event.PrettyPhaseListener.beforePhase(
    at com.sun.faces.lifecycle.Phase.handleBeforePhase(
    at com.sun.faces.lifecycle.Phase.doPhase(
    at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(
    at com.sun.faces.lifecycle.LifecycleImpl.execute(
    at javax.faces.webapp.FacesServlet.service(
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(
    at org.apache.catalina.core.StandardWrapperValve.invoke(
    at org.apache.catalina.core.StandardContextValve.invoke(
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(
    at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(
    at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(
    at org.apache.catalina.core.StandardHostValve.invoke(
    at org.apache.catalina.valves.ErrorReportValve.invoke(
    at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(
    at org.apache.catalina.core.StandardEngineValve.invoke(
    at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(
    at org.apache.catalina.connector.CoyoteAdapter.service(
    at org.apache.coyote.http11.Http11Processor.process(
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(

    Im using Jboss 6 with JSF2 and ICEFaces2.0.

    This is the content of my web-inf/lib










    I’ve got the file :


    The file is empty tough, I just want to make it work without any rewrite.

    So it’s like :

    <pretty-config xmlns=""


    Well I ran the code in debug and i can see that in (line : 125)

    PrettyConfig prettyConfig = (PrettyConfig) request.getSession().getServletContext()

    prettyConfig is null so this is where my null pointer exception is coming from.

    So finally my question is : Why the value of prettyConfig is null ??

    Can anybody is able to help me with this, im kind of stuck here :( !


    Christian Leclerc,CSSLP,SCJP,OCBCD,ZCE


    I’m guessing you have either incorrectly configured web.xml, or you are not using a Servlet 3.0 compliant container. What server are you using? I could be wrong :)


    Lincoln, wasn’t there an issue with one of the latest JBoss 6 milestones that caused our filter not being picked up? I remember a ticket you created in the JBoss JIRA.



    Hello guy’s,

    Thanks for your reply,

    I use : Jboss-6.0.0.CR1 but its the same on Jboss 4.2.3.

    JBoss 6 M2 supports Servlet 3 so I dont think this is a problem.

    Its maybe in the web.xml. I think iv’e done nothing in web.xml for PrettyFace.

    Its not in the little video. What I have to do in web.xml ?

    I will paste the content of my web.xml soon , im @ work and I use PF, for a personal project so …



    Well Im lucky have access to the content here,

    <?xml version="1.0" encoding="UTF-8"?>
    <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
    license agreements. See the NOTICE file distributed with this work for additional
    information regarding copyright ownership. The ASF licenses this file to
    You under the Apache License, Version 2.0 (the "License"); you may not use
    this file except in compliance with the License. You may obtain a copy of
    the License at Unless required
    by applicable law or agreed to in writing, software distributed under the
    License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
    OF ANY KIND, either express or implied. See the License for the specific
    language governing permissions and limitations under the License. -->

    <!-- - This is the Cocoon web-app configurations file - - $Id$ -->
    <web-app version="2.4" xmlns=""

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


    <!-- Sample Security Constraint -->








    <description>admin roles</description>



    Could you try to add this to your web.xml:

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

    This should not be necessary with a Servlet 3.0 container, but you could try it! :-)



    hey I try to add the line in the web.xml but I had to ommit async-supported and ASYNC in the dispatcher because eclipse warn me that this is not in the dtd.

    Well now i’ve got error trying to start the filter :

    Exception starting filter Pretty Filter: java.lang.NoClassDefFoundError: org/apache/commons/digester/Digester

    at this point , it seam to be that iv’e got some dependencies problems.

    I will make this work and I will post back to tell you if I still got the null pointer exception. It should not happened again tough because the filter will be started and the value of the PrettyConfig will not be null … but just in case I will post back ;)

    Thanks !



    Yeah, there was a strange issue with M4, I believe, that cause PrettyFaces to be ignored at boot time. I haven’t had this issue for a while, though, so if that’s it, I’d be surprised.

    I notice you said you’re using IceFaces, though, which historically does bad things to PrettyFaces. Hopefully that’s not the issue here; i know people have gotten icefaces working.


    If the digester is missing, that would be a reason why PrettyConfig is not properly initialized. The prettyfaces dependencies (if not using maven) are listed on the home-page :)



    Fix the dependencies problems,

    The NullPointerException is gone !

    Thanks for the help

    Have a nice day


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

The forum ‘PrettyFaces Users’ is closed to new topics and replies.

Comments are closed.