prettyfaces-jsf2-3.3.1 cannot work in Tomcat6.0.33

Splash Forums PrettyFaces Users prettyfaces-jsf2-3.3.1 cannot work in Tomcat6.0.33

This topic contains 2 replies, has 2 voices, and was last updated by  Lincoln Baxter III 5 years, 11 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #18082

    xuzhike
    Participant

    Hi, I download prettyfaces-jsf2-3.3.1 and use it in Tomcat 6.0.33 basing on prettyfaces user guide. but it cannot work due to


    严重: Servlet.service() for servlet Faces Servlet threw exception

    java.lang.NoSuchMethodError: javax.servlet.http.HttpServletRequest.getServletContext()Ljavax/servlet/ServletContext;

    at com.ocpsoft.pretty.faces.config.reload.PrettyConfigReloader.onNewRequest(PrettyConfigReloader.java:69)

    at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:73)


    here is my web.xml setting (servlet 2.5):

    <?xml version=”1.0″ encoding=”UTF-8″?>

    <web-app version=”2.5″ xmlns=”http://java.sun.com/xml/ns/javaee&#8221;

    xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221;

    xsi:schemaLocation=”

    http://java.sun.com/xml/ns/javaee

    http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd“>

    <display-name>SIMS</display-name>

    <context-param>

    <param-name>javax.faces.PROJECT_STAGE</param-name>

    <param-value>Development</param-value>

    </context-param>

    <context-param>

    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>

    <param-value>client</param-value>

    </context-param>

    <context-param>

    <param-name>javax.faces.DEFAULT_SUFFIX</param-name>

    <param-value>.xhtml</param-value>

    </context-param>

    <context-param>

    <param-name>com.ocpsoft.pretty.CONFIG_FILES</param-name>

    <param-value>/WEB-INF/pretty-config.xml</param-value>

    </context-param>

    <context-param>

    <param-name>com.ocpsoft.pretty.DEVELOPMENT</param-name>

    <param-value>true</param-value>

    </context-param>

    <listener>

    <listener-class>org.jboss.weld.environment.servlet.Listener</listener-class>

    </listener>

    <!– Begin Spring Config –>

    <context-param>

    <param-name>contextConfigLocation</param-name>

    <param-value>

    classpath:/applicationContext*.xml

    </param-value>

    </context-param>

    <listener>

    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>

    </listener>

    <listener>

    <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>

    </listener>

    <!– End Spring Config –>

    <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>

    <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>

    <session-config>

    <session-timeout>10000</session-timeout>

    </session-config>

    <welcome-file-list>

    <welcome-file>index.xhtml</welcome-file>

    </welcome-file-list>

    <!– <resource-env-ref> <description>Object factory for the CDI Bean Manager</description>

    <resource-env-ref-name>BeanManager</resource-env-ref-name> <resource-env-ref-type>javax.enterprise.inject.spi.BeanManager</resource-env-ref-type>

    </resource-env-ref> –>

    </web-app>

    2: here is faces-config.xml

    <pretty-config xmlns=”http://ocpsoft.com/prettyfaces/3.3.0&#8243;

    xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221;

    xsi:schemaLocation=”http://ocpsoft.com/prettyfaces/3.3.0

    http://ocpsoft.com/xml/ns/prettyfaces/ocpsoft-pretty-faces-3.3.0.xsd“>

    <rewrite match=”.*/” trailingSlash=”remove”/>

    <!– Content Pages –>

    <url-mapping id=”index”>

    <pattern value=”/”></pattern>

    <view-id value=”/index.xhtml”></view-id>

    </url-mapping>

    </pretty-config>

    but per checking that error, seems the method:

    javax.servlet.http.HttpServletRequest.getServletContext()

    is introduced in servlet3.0.

    so how can I use the prettyfaces in servlet 2.5 env?

    thx for your help.

    #21673

    xuzhike
    Participant

    I found an associated post and get 3.3.2 jar to test, it works now.

    #21674

    Awesome. Glad you found this. We just released 3.3.2 which fixes this bug. We had accidentally referenced the servlet 3.3.1 APIs :) Let us know if you have any other problems, thanks for reporting this!

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

You must be logged in to reply to this topic.

Comments are closed.