2 Replies Latest reply on May 16, 2007 6:57 AM by jcruise

    problem with 1.2.1 / tomcat upgrade

    jcruise

      Hola!

      I upgraded my 1.2.0PATCH1 tomcat installation with 1.2.1 GA. I basically upgraded the seam libs and any other libs that were newer in the lib directory, including the jsf-facelets and el implementations.

      I initially had a problem with the switch from cglib to javassist in that one of my classes derived from HibernateEntityHome had overrided the getPersistentContext method in the generic base clase, which gave me a duplicate method error. I switched to overriding the non-generic getSession method and that problem disappeared.

      Now I am stuck with another tricky problem that might be related to Javassist ...

      Basically, I have a selectOneMenu on my login page which includes a custom converter. The converter gets called correctly but the model does not seem to update. It fails with the following error:

      08:12:30,895 ERROR [[/XStreamline]] Cannot convert Streamline of type class com.volantice.site.model.Zone to class com.volantice.site.model.Zone_$$_javassist_1
      java.lang.IllegalArgumentException: Cannot convert Streamline of type class com.volantice.site.model.Zone to class com.volantice.site.model.Zone_$$_javassist_1
       at com.sun.el.lang.ELSupport.coerceToType(ELSupport.java:368)
       at com.sun.el.parser.AstIdentifier.setValue(AstIdentifier.java:109)
       at com.sun.el.ValueExpressionImpl.setValue(ValueExpressionImpl.java:258)
       at com.sun.facelets.el.TagValueExpression.setValue(TagValueExpression.java:93)
       at com.sun.facelets.el.LegacyValueBinding.setValue(LegacyValueBinding.java:68)
       at javax.faces.component.UIInput.updateModel(UIInput.java:269)
       at javax.faces.component.UIInput.processUpdates(UIInput.java:206)
       at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:645)
       at javax.faces.component.UIForm.processUpdates(UIForm.java:87)
       at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:645)
       at javax.faces.component.UIViewRoot.processUpdates(UIViewRoot.java:157)
       at org.ajax4jsf.framework.ajax.AjaxViewRoot.access$101(AjaxViewRoot.java:53)
       at org.ajax4jsf.framework.ajax.AjaxViewRoot$2.invokeRoot(AjaxViewRoot.java:278)
       at org.ajax4jsf.framework.ajax.JsfOneOneInvoker.invokeOnRegionOrRoot(JsfOneOneInvoker.java:54)
       at org.ajax4jsf.framework.ajax.AjaxContext.invokeOnRegionOrRoot(AjaxContext.java:176)
       at org.ajax4jsf.framework.ajax.AjaxViewRoot.processUpdates(AjaxViewRoot.java:291)
       at org.apache.myfaces.lifecycle.LifecycleImpl.updateModelValues(LifecycleImpl.java:302)
       at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:81)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:137)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:96)
       at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:220)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63)
       at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:60)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
       at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
       at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:53)
       at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:79)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
       at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
       at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
       at java.lang.Thread.run(Unknown Source)
      


      Any ideas?

      Cheers
      J

        • 1. Re: problem with 1.2.1 / tomcat upgrade
          jcruise

          So here's the line that's causing the failure in the ELSupport class:

           if (obj != null && type.isAssignableFrom(obj.getClass())) {
           return obj;
           }
          


          My JSF code looks like this:
           <h:selectOneMenu id="zone" value="#{_zone}" converter="Zone">
           <f:selectItems value="#{_zones}" />
           </h:selectOneMenu>
          


          where zones is created using:
           @SelectItems(value = "_zones", labelMethod = "getLabel", valueStrategy = Strategy.OBJECT)
           public List<Zone> getZones() {
           return zones;
           }
          


          So basically the values are a bunch of Zone POJOs.

          And therefore I guess that the problem is that a Zone POJO is not assignable to a Zone seam component. This worked when seam components were using cglib for proxying but I guess Javassist has fixed that mistake ;)

          What is the correct strategy here?

          Cheers
          J



          • 2. Re: problem with 1.2.1 / tomcat upgrade
            jcruise

            Talking to myself in public is such fun.

            On reflection (and by that I mean the human rather than the virtual form of introspection) I can now see that directly assigning the seam component would be problematic as the component value must be set in a seam context, and the EL RI isn't seam aware.

            To workaround this I simply added a zone property to another component and had that component outject the new zone value.

            so, for all you seamasochists (or is that seamonistas?) who have followed me this far and are still awake, my xhtml now looks like :

             <h:selectOneMenu id="zone" value="#{_site.zone}" converter="Zone">
             <f:selectItems value="#{_zones}" />
             </h:selectOneMenu>
            
            



            Cheers
            J