voyent
Problem by integrating icefaces in myFaces/facelets/spring webapplication  XML
Forum Index -> General Help
Author Message
fabatt


Joined: 17/May/2007 00:00:00
Messages: 11
Offline


Hi there,
i'm trying to intergrate iceFaces into an existing webapplication. In this application i use myFaces, spring,facelets and acegi.
At the beginning it seems to be the same problem as discussed on this thread:http://www.icefaces.org/JForum/posts/list/4487.page

But there must be some other probs. In my appl. i want have myFaces pages and iceFaces pages. So I configured 2 viewandler into faces-config.xml:

<view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
<view-handler>
com.icesoft.faces.facelets.D2DFaceletViewHandler </view-handler>

and here is the other relevant part of the faces-config.xml:

<navigation-rule>
<from-view-id></from-view-id>
<navigation-case>
<from-outcome>register</from-outcome>
<to-view-id>/register.iface</to-view-id>
</navigation-case>
</navigation-rule>


here i change from a myFaces page to the iceFaces page.

This are the important parts of my web.xml:
Code:
 <context-param>
 	<param-name>facelets.DEVELOPMENT</param-name>
     	<param-value>true</param-value>
 </context-param>
 	
 <context-param>
    <param-name>javax.faces.application.CONFIG_FILES</param-name>
     	<param-value>/WEB-INF/faces-config.xml</param-value>
 </context-param>	
 
 <context-param>
     	<param-name>facelets.LIBRARIES</param-name>
     	<param-value>/WEB-INF/tomahawk.taglib.xml</param-value>
 </context-param>
     
 <context-param>
 	<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
 	<param-value>.xhtml</param-value> 
 </context-param>
 	
 <context-param>
     	<param-name>com.sun.faces.validateXml</param-name>
     	<param-value>true</param-value>
 </context-param>
 
 <context-param>
     	<param-name>com.sun.faces.verifyObjects</param-name>
     	<param-value>true</param-value>
   	</context-param>
 <context-param>
     	<param-name>com.icesoft.faces.concurrentDOMViews</param-name>
     	<param-value>true</param-value>
   	</context-param>
 <context-param> 
 		<param-name>com.icesoft.faces.delegateNonIface</param-name> 
 	<param-value>true</param-value> 
 </context-param> 
 	
 <context-param>
         <param-name>com.icesoft.faces.connectionTimeout</param-name>
  	<param-value>10000</param-value>
 </context-param> 
 
 <listener>
 <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
 </listener> 
 	
 <listener>		<listener-class>com.icesoft.faces.util.event.servlet.ContextEventRepeater</listener-class>
 </listener>
 
 <context-param>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>server</param-value>
 </context-param>
 ...
 ...
 ...
 <filter>
 	<filter-name>extensionsFilter</filter-name>
 <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
     <init-param>
         <param-name>uploadMaxFileSize</param-name>
         <param-value>100m</param-value>
         <description>Set the size limit for uploaded files.
             Format: 10 - 10 bytes
                     10k - 10 KB
                     10m - 10 MB
                     1g - 1 GB
         </description>
     </init-param>
     <init-param>
       <param-name>uploadThresholdSize</param-name>
       <param-value>100k</param-value>
     </init-param>
 </filter>
 
 <!-- ############# Acegi ################ -->
  <filter>
   <filter-name>Acegi Filter Chain Proxy</filter-name>
   <filter-class>org.acegisecurity.util.FilterToBeanProxy</filter-class>
   <init-param>
    <param-name>targetBean</param-name>
    <param-value>acegiFilterChainProxy</param-value>
   </init-param>
  </filter>
 
  <filter-mapping>
       <filter-name>Acegi Filter Chain Proxy</filter-name>
       <url-pattern>/*</url-pattern>
   </filter-mapping>
 
 <filter-mapping>
     	<filter-name>extensionsFilter</filter-name> 
     	<servlet-name>Faces Servlet</servlet-name>
 </filter-mapping>
 
   <!-- ##### Faces Servlet (faces-config.xml) ##### -->
   	<servlet>
     	<servlet-name>Faces Servlet</servlet-name>
     	<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
     	<load-on-startup>1</load-on-startup>
   	</servlet>
   
     <!-- ########## ICE Faces ########## -->
     <!-- Persistent Faces Servlet -->
 	<servlet>
 		<servlet-name>Persistent Faces Servlet</servlet-name>
 		<servlet-class>com.icesoft.faces.webapp.xmlhttp.PersistentFacesServlet</servlet-class>
 	<load-on-startup>2</load-on-startup>
 	</servlet> 
 	<!-- Blocking Servlet -->
 	<servlet>
 		<servlet-name>Blocking Servlet</servlet-name>
 		<servlet-class>com.icesoft.faces.webapp.xmlhttp.BlockingServlet</servlet-class>
 		<load-on-startup>2</load-on-startup>
 	</servlet> -->  
 	
 	<!-- Servlet Mappings -->
   	<servlet-mapping>
    	 	<servlet-name>Faces Servlet</servlet-name>
     	<url-pattern>*.jsf</url-pattern>
   	</servlet-mapping>	
 
 	<servlet-mapping>
 		<servlet-name>Persistent Faces Servlet</servlet-name>
 		<url-pattern>/xmlhttp/*</url-pattern>
 	</servlet-mapping>	
 	
   	<servlet-mapping>
     	<servlet-name>Persistent Faces Servlet</servlet-name>
     	<url-pattern>*.iface</url-pattern>
   	</servlet-mapping>
   	
   	<servlet-mapping>
 		<servlet-name>Blocking Servlet</servlet-name>
 		<url-pattern>/block/*</url-pattern>
 	</servlet-mapping>
 
   <!-- Blocking Servlet Mapping -->
  	<servlet-mapping>
     	<servlet-name>Blocking Servlet</servlet-name>
     	<url-pattern>/block/*</url-pattern>
   	</servlet-mapping>   
 


I guess there must be a problems with the jar-files (compatibility), so here you can find a list of all included jar-files:
[list]
acegi-security-1.0.3.jar
antlr-2.7.6rc1.jar
asm.jar
backport-util-concurrent.jar
cglib-2.1.3.jar
commons-beanutils-1.7.0.jar
commons-codec-1.3.jar
commons-collections-3.1.jar
commons-digester-1.6.jar
commons-discovery.jar
commons-el-1.0.jar
commons-fileupload.jar
commons-logging-1.0.4.jar
commons-logging-api.jar
commons-validator-1.1.4.jar
dom4j-1.6.1.jar
ehcache-1.2.4.jar
el-api-1.0.jar
el-ri-1.0.jar
hibernate3.jar
icefaces-comps.jar
icefaces-facelets.jar
icefaces.jar
jstl-1.1.0.jar
jta.jar
junit.jar
just-ice.jar
log4j-1.2.11.jar
myfaces-api-1.1.4.jar
myfaces-impl-1.1.4.jar
oro-2.0.8.jar
oscache-2.3.2.jar
postgresql-8.1-405.jdbc3.jar
spring.jar
struts-1.2.8.jar
tagHandlers-0.9.jar
tomahawk-1.1.3.jar
tomahawk-1.1.5-SNAPSHOT.jar
xalan-2.5.1.jar
xercesImpl.jar
xml-apis.jar
[/list]

When I now start the webapp and call an url with the extension .jsf it works fine. When I now want navigate to the "/register.iface" as configured into faces-config.xml i receive following exception:

Code:
 javax.servlet.ServletException: org.apache.myfaces.context.servlet.ServletFacesContextImpl
 	javax.faces.webapp.FacesServlet.service(FacesServlet.java:152)
 	org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)
 	org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264)
 	org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
 	org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
 	org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
 	org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110)
 	org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
 	org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81)
 	org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
 	org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:229)
 	org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
 	org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:148)
 	org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
 
 root cause
 
 java.lang.ClassCastException: org.apache.myfaces.context.servlet.ServletFacesContextImpl
 	com.icesoft.faces.facelets.D2DFaceletViewHandler.renderResponse(D2DFaceletViewHandler.java:267)
 	com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:151)
 	org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
 	javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
 	org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)
 	org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264)
 	org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
 	org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
 	org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
 	org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110)
 	org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
 	org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81)
 	org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
 	org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:229)
 	org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
 	org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:148)
 	org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
 


Any help would be very welcome!

Thanks, fabatt
yoannlt

Joined: 20/Jul/2007 00:00:00
Messages: 2
Offline


Hi fabatt,
I've got the same problem. Did you find response on this problem ?
mark.collette


Joined: 07/Feb/2005 00:00:00
Messages: 1692
Offline


Refer to this document (you have to be logged-in to www.icefaces.org) to see how to have ICEfaces and non-ICEfaces pages working together in a single application.

Integrating ICEfaces With Existing Applications
http://www.icesoft.com/developer_guides/icefaces/htmlguide/devguide/keyConcepts12.html
[Email]
fabatt


Joined: 17/May/2007 00:00:00
Messages: 11
Offline


Hy yoannlt,
to be honest I had a lot of problem to integrate my webapp. After spending a lot of time I decide to replace all the tomahawk-tags by IceFaces tags. Using tomahawk-tags and IceFaces tags didn't work for me. If you find a solution for this please let me know!
Now I have my webapp running with IceFaces/jsf/facelets/spring and acegi.

If you need more information regarding this topics don't hesitate to ask.

regards Fabio
yoannlt

Joined: 20/Jul/2007 00:00:00
Messages: 2
Offline


Many thx,
I've find a workaround, use jmaki implementation. But i will try your solution
 
Forum Index -> General Help
Go to:   
Powered by JForum 2.1.7ice © JForum Team