2 Replies Latest reply on Mar 24, 2009 6:59 PM by Norman Richards

    Seam 2.0.1.GA and hot-deploy

    Guillaume Jeudy Master

      Hi guys,


      I have an exploded WAR and i'm trying the hotdeploy feature. Since seam components can only be deployed when copied under WEB-INF/dev and since classes in that folder cannot be seen by other classloader I decided to put all Seam components (no entities) including JSF validators and JSF converters in that folder.


      When I regression test the application validator components are causing problems. No exceptions thrown when rendering the page initially but then I get the following exception on postback:


      2009-03-23 16:59:26,757 WARN  [javax.enterprise.resource.webcontainer.jsf.lifecycle] executePhase(RESTORE_VIEW 1,com.sun.faces.context.FacesContextImpl@d78a87) threw exception
      java.lang.IllegalStateException: a.b.reference.action.validator.ValidityPeriodValidator
           at javax.faces.component.StateHolderSaver.restore(StateHolderSaver.java:90)
           at javax.faces.component.UIComponentBase.restoreAttachedState(UIComponentBase.java:1406)
           at javax.faces.component.UIInput.restoreState(UIInput.java:1249)
           at javax.faces.component.html.HtmlInputHidden.restoreState(HtmlInputHidden.java:76)
           at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1141)
           at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1157)
           at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1157)
           at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1157)
           at org.ajax4jsf.application.AjaxStateManager.restoreView(AjaxStateManager.java:236)
           at com.sun.faces.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:290)
           at org.jboss.seam.jsf.SeamViewHandler.restoreView(SeamViewHandler.java:93)
           at com.sun.facelets.FaceletViewHandler.restoreView(FaceletViewHandler.java:316)
           at org.ajax4jsf.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:116)
           at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:141)
           at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
           at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
           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.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           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:45)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:154)
           at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:260)
           at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:366)
           at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:493)
           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.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 a.b.reference.web.filter.ProfilingFilter.doFilter(ProfilingFilter.java:43)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at jcifs.http.NtlmHttpFilter.doFilter(NtlmHttpFilter.java:118)
           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.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
           at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
           at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
           at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
           at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
           at java.lang.Thread.run(Thread.java:595)
      2009-03-23 16:59:26,788 ERROR [org.jboss.seam.web.ExceptionFilter] handling uncaught exception
      javax.servlet.ServletException: a.b.reference.action.validator.ValidityPeriodValidator
           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:256)
           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.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           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:45)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:154)
           at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:260)
           at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:366)
           at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:493)
           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.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 a.b.reference.web.filter.ProfilingFilter.doFilter(ProfilingFilter.java:43)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at jcifs.http.NtlmHttpFilter.doFilter(NtlmHttpFilter.java:118)
           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.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
           at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
           at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
           at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
           at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
           at java.lang.Thread.run(Thread.java:595)
      Caused by: java.lang.IllegalStateException: a.b.reference.action.validator.ValidityPeriodValidator
           at javax.faces.component.StateHolderSaver.restore(StateHolderSaver.java:90)
           at javax.faces.component.UIComponentBase.restoreAttachedState(UIComponentBase.java:1406)
           at javax.faces.component.UIInput.restoreState(UIInput.java:1249)
           at javax.faces.component.html.HtmlInputHidden.restoreState(HtmlInputHidden.java:76)
           at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1141)
           at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1157)
           at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1157)
           at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1157)
           at org.ajax4jsf.application.AjaxStateManager.restoreView(AjaxStateManager.java:236)
           at com.sun.faces.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:290)
           at org.jboss.seam.jsf.SeamViewHandler.restoreView(SeamViewHandler.java:93)
           at com.sun.facelets.FaceletViewHandler.restoreView(FaceletViewHandler.java:316)
           at org.ajax4jsf.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:116)
           at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:141)
           at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
           at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
           ... 44 more
      2009-03-23 16:59:26,804 ERROR [org.jboss.seam.web.ExceptionFilter] exception root cause
      java.lang.IllegalStateException: a.b.reference.action.validator.ValidityPeriodValidator
           at javax.faces.component.StateHolderSaver.restore(StateHolderSaver.java:90)
           at javax.faces.component.UIComponentBase.restoreAttachedState(UIComponentBase.java:1406)
           at javax.faces.component.UIInput.restoreState(UIInput.java:1249)
           at javax.faces.component.html.HtmlInputHidden.restoreState(HtmlInputHidden.java:76)
           at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1141)
           at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1157)
           at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1157)
           at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1157)
           at org.ajax4jsf.application.AjaxStateManager.restoreView(AjaxStateManager.java:236)
           at com.sun.faces.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:290)
           at org.jboss.seam.jsf.SeamViewHandler.restoreView(SeamViewHandler.java:93)
           at com.sun.facelets.FaceletViewHandler.restoreView(FaceletViewHandler.java:316)
           at org.ajax4jsf.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:116)
           at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:141)
           at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
           at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
           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.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           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:45)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:154)
           at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:260)
           at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:366)
           at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:493)
           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.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 a.b.reference.web.filter.ProfilingFilter.doFilter(ProfilingFilter.java:43)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at jcifs.http.NtlmHttpFilter.doFilter(NtlmHttpFilter.java:118)
           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.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
           at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
           at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
           at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
           at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
           at java.lang.Thread.run(Thread.java:595)



      This only happens when hot-deployment is enabled.


      Does hot-deploy support seam components that are also JSF converters or JSF validators ?

        • 1. Re: Seam 2.0.1.GA and hot-deploy
          Guillaume Jeudy Master

          Ok I discovered by trial and error that you cannot hot-deploy Seam JSF Converter or validator because JSF classes (loaded by WAR classloader) cannot see hot-deployed converters/validators. The below code snippet in StateHolder class throws a ClassNotFoundException:


          // else the object to save did implement StateHolder
                  
                  try {
                      toRestoreClass = loadClass(className, this);
                  }
                  catch (ClassNotFoundException e) {
                   throw new IllegalStateException(e.getMessage());
                  }
          



          Can any Seam developers comment on the exact eligibility of Seam components for hot-deployment? To me it seems like only vanilla Seam POJOs are eligible and moreover they must not be referenced by classes outside the hotdeploy folder...

          • 2. Re: Seam 2.0.1.GA and hot-deploy
            Norman Richards Expert

            Yes, only pojo Seam components and support classes for them are eligible for hot deploy.