[solved] converter-for-class not working anymore in 3.0.1

Splash Forums PrettyFaces Users [solved] converter-for-class not working anymore in 3.0.1

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

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #17758

    geert3
    Participant

    Hi,

    I upgraded to 3.0.1 recently and noticed the following problem.

    I have following pretty-config (snippet):

    <url-mapping id=”edit_customer”>

    <pattern>/customer.xhtml</pattern>

    <query-param name=”id”>#{customerBean.selectedCustomer}</query-param>

    <view-id>/faces/secure/customer_detail.xhtml</view-id>

    </url-mapping>

    Where CustomerBean.getSelectedCustomer() returns a type “Customer”, i.e. not String.

    Additionally I have a converter-for-class set up in faces-config.xml:

    <converter>

    <converter-for-class>cob.extsecurity.data.Customer</converter-for-class>

    <converter-class>cob.securitymanager.CustomerConverter</converter-class>

    </converter>

    This has worked neatly. PrettyFaces somehow used this converter to convert the String parameter “id” into a Customer object.

    In 3.0.1 this doesn’t work anymore, and I’m getting this exception:

    2010-07-16 15:13:09,407 WARN [] javax.enterprise.resource.webcontainer.jsf.lifecycle:98 – com.ocpsoft.pretty.faces.beans.ParameterInjector.injectQueryParams(ParameterInjector.java:100)

    com.ocpsoft.pretty.faces.beans.ParameterInjector.injectParameters(ParameterInjector.java:49)

    com.ocpsoft.pretty.faces.event.PrettyPhaseListener.afterPhase(PrettyPhaseListener.java:84)

    com.sun.faces.lifecycle.Phase.handleAfterPhase(Phase.java:175)

    com.sun.faces.lifecycle.Phase.doPhase(Phase.java:114)

    com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:103)

    com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)

    javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)

    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

    org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)

    org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)

    org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)

    org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)

    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

    org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)

    org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)

    org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)

    org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)

    com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:103)

    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

    cob.extsecurity.ExtSecurityFilter.doFilter(ExtSecurityFilter.java:120)

    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)

    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

    org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:558)

    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

    org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:421)

    org.apache.catalina.connector.RemoteIpValve.invoke(RemoteIpValve.java:610)

    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)

    org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)

    org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)

    org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)

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

    Could be that this was an undocumented feature of 1.2.6 but i always thought it was kinda neat.

    Is there a way to do the same in 3.0.1 ?

    #20027

    geert3
    Participant

    sorry this is the stack trace i wanted to include:

    Jul 16, 2010 3:24:33 PM com.sun.faces.lifecycle.Phase handleAfterPhase

    WARNING: JSF1053: (Listener: com.ocpsoft.pretty.faces.event.PrettyPhaseListener.afterPhase(), Phase ID: RESTORE_VIEW 1, View ID: /secure/customer_detail.xhtml) Exception thrown during phase-listener execution: com.ocpsoft.pretty.PrettyException: PrettyFaces: Exception occurred while processing mapping<edit_customer:#{customerBean.selectedCustomer}> for query parameter named<id> Cannot convert COBCON of type class java.lang.String to class cob.extsecurity.data.Customer

    Jul 16, 2010 3:24:33 PM com.sun.faces.lifecycle.Phase handleAfterPhase

    WARNING: com.ocpsoft.pretty.faces.beans.ParameterInjector.injectQueryParams(ParameterInjector.java:100)

    com.ocpsoft.pretty.faces.beans.ParameterInjector.injectParameters(ParameterInjector.java:49)

    com.ocpsoft.pretty.faces.event.PrettyPhaseListener.afterPhase(PrettyPhaseListener.java:84)

    com.sun.faces.lifecycle.Phase.handleAfterPhase(Phase.java:175)

    com.sun.faces.lifecycle.Phase.doPhase(Phase.java:114)

    com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:103)

    com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)

    javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)

    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

    org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)

    org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)

    org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)

    org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)

    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

    org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)

    org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)

    org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)

    org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)

    com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:103)

    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

    cob.extsecurity.ExtSecurityFilter.doFilter(ExtSecurityFilter.java:120)

    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)

    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

    org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:558)

    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

    org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:421)

    org.apache.catalina.connector.RemoteIpValve.invoke(RemoteIpValve.java:610)

    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)

    org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)

    org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)

    org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)

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

    #20028

    geert3
    Participant

    OK so this is not a prettyfaces issue, it appears to be a JSF issue:

    – in JSF 1.2MR1 (1.2_04-b20-p03) it works (with all prettyfaces versions)

    – in JSF 1.2MR2 (1.2_12-b01-FCS) it doesn’t work (with any prettyfaces version)

    *sigh*

    Sorry for the spam.

    #20029

    That’s OK! It’s always good to know what issues people are running in to. This is good to have documented and available on the web!

    And yes, apparently this is an undocumented feature of EL value injection – I’ll have to look in to this!

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

You must be logged in to reply to this topic.

Comments are closed.