myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vale_java_dev <fabrizi_valent...@yahoo.it>
Subject Problem with spring-security 2.0.6
Date Fri, 13 May 2011 14:36:35 GMT

Hi all!

This is my scenario:
   - jboss_4.2.2
   - myFaces 1.2.8
   - tomahawk 1.1.9
   - trinidad 1.2.10
   - jQuery4Jsf
   - primefaces 1.0
   - spring 2.5
   - spring-security 2.0.6
   - hibernate 3.0

I added into my web-app spring security but I've a faces servlet exception
when I invoke my web-app

EXCEPTION
[CODE]
13-mag-2011 16:11:38,125 ERROR
[org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/GOWeb].[facesServlet]]
Servlet.service() for servlet facesServlet threw exception
java.lang.IllegalStateException: Cannot forward after response has been
committed
	at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:302)
	at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:292)
	at
org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:341)
	at
org.apache.myfaces.trinidad.context.ExternalContextDecorator.dispatch(ExternalContextDecorator.java:44)
	at
org.apache.myfaces.trinidadinternal.context.FacesContextFactoryImpl$OverrideDispatch.dispatch(FacesContextFactoryImpl.java:267)
	at
org.apache.myfaces.application.jsp.JspViewHandlerImpl.buildView(JspViewHandlerImpl.java:486)
	at
org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:337)
	at
javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:48)
	at
org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:188)
	at
org.jquery4jsf.application.JQueryViewHandler.renderView(JQueryViewHandler.java:59)
	at
org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
	at
org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:140)
	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:182)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at
org.jquery4jsf.application.filter.JQueryResourceFilter.doFilter(JQueryResourceFilter.java:113)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at
org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:285)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at
org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:238)
	at
org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:195)
	at
org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:138)
	at
org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at
org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:179)
	at
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
	at
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
	at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at
it.niuma.goWeb.sessionTimeoutFilter.GOWebSessionTimeoutFilter.doFilter(GOWebSessionTimeoutFilter.java:58)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at
org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:341)
	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(Unknown Source)
[/CODE]

WEB.XML
[CODE]
<web-app id="WebApp_ID" version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
	
	<display-name>goWeb</display-name>
	<welcome-file-list>
	<welcome-file>index.html</welcome-file>
	<welcome-file>index.htm</welcome-file>
	<welcome-file>index.jsp</welcome-file>
	<welcome-file>default.html</welcome-file>
	<welcome-file>default.htm</welcome-file>
	<welcome-file>default.jsp</welcome-file>
	</welcome-file-list>
  	  
  <!-- JSF TYPICAL CONTEXT PARAM -->
  <context-param>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>client</param-value>
  </context-param>
  	  
  <!--  MYFACES CONTEXT PARAM -->
 	<context-param>
    <param-name>org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION</param-name>
    <param-value>20</param-value>
  </context-param>
  <context-param>
    <param-name>org.apache.myfaces.SERIALIZE_STATE_IN_SESSION</param-name>
    <param-value>true</param-value>
  </context-param>
  <context-param>
    <param-name>org.apache.myfaces.COMPRESS_STATE_IN_SESSION</param-name>
    <param-value>false</param-value>
  </context-param>	  
	<context-param>
    <param-name>org.apache.myfaces.USE_ENCRYPTION</param-name>
    <param-value>false</param-value>
  </context-param>      
  <context-param>
    <param-name>javax.faces.CONFIG_FILES</param-name>
    <param-value>
    		/WEB-INF/trinidad-config.xml,
    		/WEB-INF/trinidad-skins.xml, 
    		/WEB-INF/faces-config.xml,
    		/WEB-INF/faces-config-toolbar.xml
    </param-value>
  </context-param>
      	  	  
	<!-- TRINIDAD CONTEXT PARAM -->
	<context-param>
	 
<param-name>org.apache.myfaces.trinidad.ENABLE_LIGHTWEIGHT_DIALOGS</param-name>
    <param-value>true</param-value>
  </context-param>
  <context-param>
    <param-name>org.apache.myfaces.trinidad.resource.DEBUG</param-name>
    <param-value>false</param-value>
  </context-param>
	<context-param>
	 
<param-name>org.apache.myfaces.trinidad.USE_APPLICATION_VIEW_CACHE</param-name>
	  <param-value>false</param-value>
	</context-param>
	<context-param>
	 
<param-name>org.apache.myfaces.trinidad.CHECK_FILE_MODIFICATION</param-name>
	  <param-value>false</param-value>
	</context-param>
	<context-param>
	  <param-name>org.apache.myfaces.trinidad.CHANGE_PERSISTENCE</param-name>
	  <param-value>session</param-value>
	</context-param>
	  
	<!-- CHART CREATOR CONTEXT PARAM -->
	<context-param>
	  <param-name>net.sf.jsfcomp.chartcreator.USE_CHARTLET</param-name>
	  <param-value>true</param-value>
	</context-param>
	  
	<!-- SPRING APPLICATION CONTEXT PARAM -->
	<context-param>
  	<param-name>contextConfigLocation</param-name>
   	<param-value>
   		/WEB-INF/spring-properties-from-file-context.xml,
   		/WEB-INF/spring-properties-from-db-context.xml,
   		/WEB-INF/spring-service-context.xml,
   		/WEB-INF/spring-security-context.xml
  	</param-value>
  </context-param>    	  
  	  
	<!-- TRINIDAD FILTER -->
	<filter>
	  <filter-name>trinidad</filter-name>
	 
<filter-class>org.apache.myfaces.trinidad.webapp.TrinidadFilter</filter-class>
	</filter>	 
	<filter-mapping>
	  <filter-name>trinidad</filter-name>
	  <servlet-name>facesServlet</servlet-name>
    <dispatcher>FORWARD</dispatcher>
    <dispatcher>REQUEST</dispatcher>	    
	</filter-mapping>  
  
  <!-- MYFACES FILTER -->
  <filter>
    <filter-name>MyFacesExtensionsFilter</filter-name>
   
<filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
      <init-param>
     		<param-name>maxFileSize</param-name>
     		<param-value>200m</param-value>
    	</init-param>
  </filter>  	
  <filter-mapping>
    <filter-name>MyFacesExtensionsFilter</filter-name>
    <servlet-name>facesServlet</servlet-name>
  </filter-mapping>  
  <filter-mapping>
    <filter-name>MyFacesExtensionsFilter</filter-name>
    <url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
  </filter-mapping>  
  <filter-mapping>
    <filter-name>MyFacesExtensionsFilter</filter-name>
    <url-pattern>*.faces</url-pattern>
  </filter-mapping>  	  
  	  
  <!-- GO WEB SESSIONTIMEOUT FILTER -->
	<filter>
	  <filter-name>SessionTimeoutFilter</filter-name>
	 
<filter-class>it.niuma.goWeb.sessionTimeoutFilter.GOWebSessionTimeoutFilter</filter-class>
	</filter>
	<filter-mapping>
	  <filter-name>SessionTimeoutFilter</filter-name>
	  <url-pattern>*.faces</url-pattern>
	</filter-mapping>	  
	  
	<!-- JQUERY4JSF FILTER -->
	<filter>  
    <filter-name>JQuery4JsfFilter</filter-name>  
   
<filter-class>org.jquery4jsf.application.filter.JQueryResourceFilter</filter-class>
 
  </filter>	  
	<filter-mapping>  
    <filter-name>JQuery4JsfFilter</filter-name>  
    <servlet-name>facesServlet</servlet-name>
    <dispatcher>FORWARD</dispatcher>
    <dispatcher>INCLUDE</dispatcher>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>ERROR</dispatcher>
	</filter-mapping> 	  	  
	  	  
	<!-- SPRING OSIV FILTER -->
	<filter>
	  <filter-name>OSIVFilter</filter-name>
	 
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
	  <init-param>
	    <param-name>sessionFactoryBeanName</param-name>         
	    <param-value>sessionFactory</param-value>
	  </init-param>    
	</filter>
	<filter-mapping>     
	  <filter-name>OSIVFilter</filter-name>   
	  <url-pattern>*.faces</url-pattern>
	</filter-mapping>	  
	  
	<!-- SPRING SECURITY FILTER --> 	  
	<filter>
	  <filter-name>springSecurityFilterChain</filter-name>
	
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
	</filter>
	<filter-mapping>
	  <filter-name>springSecurityFilterChain</filter-name>
		<url-pattern>*.faces</url-pattern>
		<dispatcher>FORWARD</dispatcher>
		<dispatcher>REQUEST</dispatcher>
	</filter-mapping>	  
	  	  
	<!-- MYFACES LISTENER -->
	<listener>
   
<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
  </listener>
  	  
  <!-- SPRING LISTENER -->
  <listener>
   
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  </listener>  	  
  	  
  <!-- SESSION PERSISTANCE LISTENER --> 
  <listener>
   
<listener-class>it.niuma.goWeb.sessionListener.GOWebSessionListener</listener-class>
  </listener> 
  	    	    
	<!-- MYFACES SERVLET -->
	<servlet>
	  <servlet-name>facesServlet</servlet-name>
	  <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
	  <load-on-startup>1</load-on-startup>
	</servlet>	  
	<servlet-mapping>
    <servlet-name>facesServlet</servlet-name>
    <url-pattern>*.faces</url-pattern>
  </servlet-mapping>   	  
  	  
	<!-- TRINIDAD RESOURCE SERVLET -->
	<servlet>
	  <servlet-name>resources</servlet-name>
	 
<servlet-class>org.apache.myfaces.trinidad.webapp.ResourceServlet</servlet-class>
	</servlet>
	<servlet-mapping>
	  <servlet-name>resources</servlet-name>
	  <url-pattern>/adf/*</url-pattern>
	</servlet-mapping>	  
	  
	<!-- JQUERY4JSF SERVLET -->
	<servlet>  
    <servlet-name>JQuery4JsfServlet</servlet-name>  
    <servlet-class>org.jquery4jsf.resource.ResourceServlet</servlet-class>  
	</servlet>	  
	<servlet-mapping>  
	  <servlet-name>JQuery4JsfServlet</servlet-name>  
		<url-pattern>/jquery4jsf_resource/*</url-pattern>  
	</servlet-mapping>
	  	  
	<!-- CHART CREATOR SERVLET -->
	<servlet>
	  <servlet-name>Chartlet</servlet-name>
		<servlet-class>net.sf.jsfcomp.chartcreator.Chartlet</servlet-class>
	</servlet>		
	<servlet-mapping>
	  <servlet-name>Chartlet</servlet-name>
		<url-pattern>*.chart</url-pattern>
	</servlet-mapping>
	  	  	  
	<!-- PRIME FACES SERVLET -->
	<servlet>  
    <servlet-name>PrimeFacesResourceServlet</servlet-name>  
    <servlet-class>org.primefaces.resource.ResourceServlet</servlet-class>  
	</servlet>    
	<servlet-mapping>  
	  <servlet-name>PrimeFacesResourceServlet</servlet-name>  
		<url-pattern>/primefaces_resource/*</url-pattern>  
	</servlet-mapping>  		  
	  	  
	<!-- SESSION DURATION -->
	<session-config>
    <session-timeout>30</session-timeout>
  </session-config> 
</web-app>
[/CODE]

SPRING-SECURITY
[CODE]
<beans xmlns="http://www.springframework.org/schema/beans"
  	   xmlns:security="http://www.springframework.org/schema/security"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-2.0.6.xsd">      
    
  <security:http auto-config='false' session-fixation-protection="none">
    <security:intercept-url pattern="/homepage.faces" filters="none"/>  
    <security:intercept-url pattern="/**" access="ROLE_*" />
    <security:form-login login-page='/homepage.faces'/>
    <security:concurrent-session-control max-sessions="1"
exception-if-maximum-exceeded="true"/>    	
  </security:http>
    
  <bean id="goWebUserDetailsServiceImpl"
class="it.niuma.goWeb.services.goWebUserDetailsService.GoWebUserDetailsServiceImpl">
		<property name="userDAO"><ref bean="userDAO"/></property>
	</bean>
	
  <security:authentication-provider
user-service-ref='goWebUserDetailsServiceImpl'/>    
</beans>
[/CODE]

I hope in your help!
Cheers, Vale
-- 
View this message in context: http://old.nabble.com/Problem-with-spring-security-2.0.6-tp31611965p31611965.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Mime
View raw message