2 Replies Latest reply on Jun 13, 2011 10:33 AM by Diego Coronel

    Problems trying ViewConfig security

    Diego Coronel Apprentice

      Hi,


      Im trying Seam3 with faces and security modules, i tried to use ViewConfig and im getting this exception:



      15:10:10,211 FATAL [org.jboss.seam.faces.view.SeamViewMetadata] Error Parsing /denied.xhtml: Premature end of file.
      15:10:10,213 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/DiegoWeb].[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception: java.lang.IllegalArgumentException: null source
           at java.util.EventObject.<init>(EventObject.java:38) [:1.6.0_24]
           at javax.faces.event.SystemEvent.<init>(SystemEvent.java:67) [:2.0.3-]
           at javax.faces.event.ComponentSystemEvent.<init>(ComponentSystemEvent.java:69) [:2.0.3-]
           at javax.faces.event.PostRestoreStateEvent.<init>(PostRestoreStateEvent.java:69) [:2.0.3-]
           at com.sun.faces.lifecycle.RestoreViewPhase.deliverPostRestoreStateEvent(RestoreViewPhase.java:256) [:2.0.3-]
           at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:245) [:2.0.3-]
           at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97) [:2.0.3-]
           at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:107) [:2.0.3-]
           at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:114) [:2.0.3-]
           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:308) [:2.0.3-]
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324) [:6.0.0.Final]
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.Final]
           at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:67) [:6.0.0.Final]
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274) [:6.0.0.Final]
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.Final]
           at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [:6.0.0.Final]
           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) [:6.0.0.Final]
           at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181) [:6.0.0.Final]
           at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285) [:1.1.0.Final]
           at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261) [:1.1.0.Final]
           at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88) [:6.0.0.Final]
           at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100) [:6.0.0.Final]
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) [:6.0.0.Final]
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [:6.0.0.Final]
           at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) [:6.0.0.Final]
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [:6.0.0.Final]
           at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53) [:6.0.0.Final]
           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [:6.0.0.Final]
           at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [:6.0.0.Final]
           at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:654) [:6.0.0.Final]
           at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951) [:6.0.0.Final]
           at java.lang.Thread.run(Thread.java:662) [:1.6.0_24]
      
      15:10:10,216 ERROR [org.jboss.web.tomcat.service.jca.CachedConnectionValve] Application error: Faces Servlet did not complete its transaction



      and my code is:




      @ViewConfig
      public interface Pages {
      
            static enum Pages1 {
      
                   @ViewPattern("/faces/cidade/*")
                   @CidadeRestriction
                   CIDADE,
      
                   @FacesRedirect
                   @ViewPattern("/*")
                   @AccessDeniedView("/denied.xhtml")
                   @LoginView("/index.xhtml")
      
                   ALL;
      
               }
           
      }



      and my denied.xhtml where the error is occurring




      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml"
            xmlns:f="http://java.sun.com/jsf/core"      
            xmlns:h="http://java.sun.com/jsf/html"
            xmlns:ui="http://java.sun.com/jsf/facelets"
            xmlns:p="http://primefaces.prime.com.tr/ui">
      
          <h:body>
               <ui:composition template="/faces/template/layout.xhtml">
               
                    <ui:define name="content">
                          Acesso Negado
                     </ui:define>
                    
               </ui:composition>
          </h:body>
      </html>



      is it wrong ?