6 Replies Latest reply on Dec 27, 2007 11:10 AM by Terry

    Catch-22 with Seam2 and converterId in page parameter - bug?

    Terry Apprentice

      Im having a kind of catch-22 problem since upgrading to Seam 2.

      I have date/time fields on xhtml form, and corresponding Seam page parameter in .page.xml file. If I don't assign converterId to date/time page param then
      it throws error (javax.el.ELException: java.lang.IllegalArgumentException: argument type mismatch) and Seam Debug page..

      However, if I give page parameter a convertId then xhtml page works but I get error in log (...Cannot instantiate converter of type org.jboss.seam.ui.converter.DateTimeConverter...).

      I have jboss-seam-ui.jar in my .war\WEB-INF\lib folder. jboss-seam-ui.jar contains class org.jboss.seam.ui.converter.DateTimeConverter.

      I think solution to my problem is to have a converterId - can anyone tell how to get rid of error (JSF1006: Cannot instantiate converter of type...)?

      Seam2+JSF RI+Facelets+Richfaces, JBoss EAP 4.2.

      without converterId in page param of .page.xml
      <!DOCTYPE page PUBLIC
       "-//JBoss/Seam Pages Configuration DTD 2.0//EN"
       "http://jboss.com/products/seam/pages-2.0.dtd">
      
      <page>
       <param name="settlementDateFrom" value="#{paymentReconciliation.settlementDateFrom}"/>
      </page>
      
      ...
      ERROR [SeamPhaseListener] uncaught exception
      javax.el.ELException: java.lang.IllegalArgumentException: argument type mismatch
       at javax.el.BeanELResolver.setValue(BeanELResolver.java:116)
       at javax.el.CompositeELResolver.setValue(CompositeELResolver.java:68)
       at com.sun.faces.el.FacesCompositeELResolver.setValue(FacesCompositeELResolver.java:93)
       at org.jboss.el.parser.AstPropertySuffix.setValue(AstPropertySuffix.java:73)
       at org.jboss.el.parser.AstValue.setValue(AstValue.java:84)
       at org.jboss.el.ValueExpressionImpl.setValue(ValueExpressionImpl.java:249)
       at org.jboss.seam.core.Expressions$1.setValue(Expressions.java:117)
       at org.jboss.seam.navigation.Pages.applyConvertedValidatedValuesToModel(Pages.java:779)
      ...
      
      
      
      with converterId in page param
      <param name="settlementDateFrom" converterId="org.jboss.seam.ui.converter.DateTimeConverter" value="#{paymentReconciliation.settlementDateFrom}"/>
      
      (Similar error is thrown is I use converterId="javax.faces.convert.DateTimeConverter").
      
      FATAL [application] JSF1006: Cannot instantiate converter of type org.jboss.seam.ui.converter.DateTimeConverter
      WARN [Param] could not create converter for: settlementDateFrom
      javax.faces.FacesException: Expression Error: Named Object: org.jboss.seam.ui.converter.DateTimeConverter not found.
       at com.sun.faces.application.ApplicationImpl.createConverter(ApplicationImpl.java:726)
       at org.jboss.seam.jsf.SeamApplication.createConverter(SeamApplication.java:112)
       at org.jboss.seam.navigation.Param.getConverter(Param.java:52)
       at org.jboss.seam.navigation.Param.getStringValueFromModel(Param.java:142)
       at org.jboss.seam.navigation.Pages.updateStringValuesInPageContextUsingModel(Pages.java:820)
       at org.jboss.seam.jsf.SeamStateManager.saveSerializedView(SeamStateManager.java:61)
       at org.ajax4jsf.application.AjaxStateManager.saveSerializedView(AjaxStateManager.java:317)
       at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:615)
       at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
       at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:216)
       at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
       at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
       at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
       at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
       at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
       at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:44)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
       at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
       at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
       at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
       at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
       at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
       at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
       at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
       at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:543)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
       at java.lang.Thread.run(Thread.java:619)
      
      
      



        • 1. Re: Catch-22 with Seam2 and converterId in page parameter -
          Pete Muir Master

          What sort of project structure? EAR? If so, I guess pages.xml is using the EAR classloader, but the DateTimeConverter is on the web classloader. In this case, file a JIRA as we can probably fix this.

          • 2. Re: Catch-22 with Seam2 and converterId in page parameter -
            Terry Apprentice

            Pete, yes it is EAR structure. I have filed JIRA. Is there any workaround while it is being fixed?

            most of my pages have similar problem, causing my user testing to be all but halted.

            http://jira.jboss.org/jira/browse/JBSEAM-2429

            Support Issue: 00020044

            • 3. Re: Catch-22 with Seam2 and converterId in page parameter -
              Pete Muir Master

              Perhaps use the standard JSF date time converter?

              • 4. Re: Catch-22 with Seam2 and converterId in page parameter -
                Terry Apprentice

                I guess you meant, in .page.xml. yes I tried that and get similar error.

                <param name="settlementDateFrom" converterId="javax.faces.convert.DateTimeConverter" value="#{paymentReconciliation.settlementDateFrom}"/>
                
                
                Error:
                10:51:51,939 FATAL [application] JSF1006: Cannot instantiate converter of type javax.faces.convert.DateTimeConverter
                10:51:51,939 WARN [Param] could not create converter for: settlementDateFrom
                javax.faces.FacesException: Expression Error: Named Object: javax.faces.convert.DateTimeConverter not found.
                 at com.sun.faces.application.ApplicationImpl.createConverter(ApplicationImpl.java:726)
                 at org.jboss.seam.jsf.SeamApplication.createConverter(SeamApplication.java:112)
                 at org.jboss.seam.navigation.Param.getConverter(Param.java:52)
                 at org.jboss.seam.navigation.Param.getStringValueFromModel(Param.java:142)
                 at org.jboss.seam.navigation.Pages.updateStringValuesInPageContextUsingModel(Pages.java:820)
                 at org.jboss.seam.jsf.SeamStateManager.saveSerializedView(SeamStateManager.java:61)
                 at org.ajax4jsf.application.AjaxStateManager.saveSerializedView(AjaxStateManager.java:317)
                 at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:615)
                 at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
                 at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:216)
                 at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
                 at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
                 at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
                 at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
                 at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                 at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                 at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:44)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                 at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
                 at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
                 at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                 at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                 at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                 at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                 at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
                 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
                 at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
                 at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
                 at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
                 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
                 at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
                 at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:543)
                 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
                 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                 at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
                 at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
                 at java.lang.Thread.run(Thread.java:619)
                
                


                • 5. Re: Catch-22 with Seam2 and converterId in page parameter -
                  Pete Muir Master

                  Try the id as javax.faces.DateTime - thats what the javadoc tells me.

                  • 6. Re: Catch-22 with Seam2 and converterId in page parameter -
                    Terry Apprentice

                    Pete thanks for that, and it worked too.