voyent
Problem using Tiles 2 with Icefaces (FileNotFoundException: Access denied.)  XML
Forum Index -> General Help
Author Message
Rabbithunter

Joined: 19/Dec/2007 00:00:00
Messages: 2
Offline


I have a problem including a icefaces file into the tiles template.

The template looks like this:

Code:
 <%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
 <table>
   <tr>
    <td>This is the template frame.</td>
   </tr>
   <tr>
     <td>
       <tiles:insertAttribute name="body" />
     </td>
   </tr>
 </table>
 


The tiles configuration:

Code:
 <?xml version="1.0" encoding="ISO-8859-1" ?>
 <!DOCTYPE tiles-definitions PUBLIC
        "-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
        "http://tiles.apache.org/dtds/tiles-config_2_0.dtd">
 
 <tiles-definitions>
     <definition name="layout.example" template="/template/test.jsp" >
 		<put-attribute name="body" value="/tiles/test.iface" />
     </definition>
 </tiles-definitions>
 


The icefaces file (called test.jspx, WORKS FINE WHEN CALLING IT DIRECTLY):

Code:
 <f:view xmlns:f="http://java.sun.com/jsf/core"
 		xmlns:h="http://java.sun.com/jsf/html"
 		xmlns:ice="http://www.icesoft.com/icefaces/component">
 
     <ice:outputText value="It works." />
 </f:view>
 


The file including the template (index.jsp):
Code:
 <%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
 <tiles:insertDefinition name="layout.example" />
 


When executing the index.jsp, I only got the response:


<table>
<tr>
<td>This is the template frame.</td>
</tr>
<tr>
<td>

</td>
</tr>

</table> 


The output of the iface-File does not appear there. Instead an exception is thrown:

java.io.FileNotFoundException: D:\tomcat\webapps\smartshops (Access denied.)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at com.icesoft.faces.webapp.http.core.FileServer$1.respond(FileServer.java:35)
at com.icesoft.faces.webapp.http.common.standard.CompressingServer$CompressingRequest$1.respond(CompressingServer.java:49)
at com.icesoft.faces.webapp.http.servlet.ServletRequestResponse.respondWith(ServletRequestResponse.java:161)
at com.icesoft.faces.webapp.http.common.standard.CompressingServer$CompressingRequest.respondWith(CompressingServer.java:45)
at com.icesoft.faces.webapp.http.core.FileServer.service(FileServer.java:28)
at com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer$Matcher.serviceOnMatch(PathDispatcherServer.java:50)
at com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer.service(PathDispatcherServer.java:19)
at com.icesoft.faces.webapp.http.common.standard.CompressingServer.service(CompressingServer.java:29)
at com.icesoft.faces.webapp.http.core.ResourceServer.service(ResourceServer.java:30)
at com.icesoft.faces.webapp.http.servlet.BasicAdaptingServlet.service(BasicAdaptingServlet.java:16)
at com.icesoft.faces.webapp.http.servlet.PathDispatcher$Matcher.serviceOnMatch(PathDispatcher.java:52)
at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:29)
at com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:79)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:654)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:557)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:481)
at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:968)
at org.apache.jasper.runtime.PageContextImpl.doInclude(PageContextImpl.java:638)
at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:632)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.tiles.jsp.context.JspUtil.doInclude(JspUtil.java:87)
at org.apache.tiles.jsp.context.JspTilesRequestContext.include(JspTilesRequestContext.java:88)
at org.apache.tiles.jsp.context.JspTilesRequestContext.dispatch(JspTilesRequestContext.java:82)
at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:465)
at org.apache.tiles.jsp.taglib.InsertAttributeTag.render(InsertAttributeTag.java:140)
at org.apache.tiles.jsp.taglib.InsertAttributeTag.render(InsertAttributeTag.java:117)
at org.apache.tiles.jsp.taglib.RenderTagSupport.execute(RenderTagSupport.java:171)
at org.apache.tiles.jsp.taglib.RoleSecurityTagSupport.doEndTag(RoleSecurityTagSupport.java:75)
at org.apache.tiles.jsp.taglib.ContainerTagSupport.doEndTag(ContainerTagSupport.java:80)
at org.apache.jsp.template.test_jsp._jspx_meth_tiles_005finsertAttribute_005f0(test_jsp.java:96)
at org.apache.jsp.template.test_jsp._jspService(test_jsp.java:65)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:654)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:557)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:481)
at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:968)
at org.apache.jasper.runtime.PageContextImpl.doInclude(PageContextImpl.java:638)
at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:632)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.tiles.jsp.context.JspUtil.doInclude(JspUtil.java:87)
at org.apache.tiles.jsp.context.JspTilesRequestContext.include(JspTilesRequestContext.java:88)
at org.apache.tiles.jsp.context.JspTilesRequestContext.dispatch(JspTilesRequestContext.java:82)
at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:419)
at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:370)
at org.apache.tiles.jsp.taglib.InsertDefinitionTag.render(InsertDefinitionTag.java:63)
at org.apache.tiles.jsp.taglib.RenderTagSupport.execute(RenderTagSupport.java:171)
at org.apache.tiles.jsp.taglib.RoleSecurityTagSupport.doEndTag(RoleSecurityTagSupport.java:75)
at org.apache.tiles.jsp.taglib.ContainerTagSupport.doEndTag(ContainerTagSupport.java:80)
at org.apache.jsp.index_jsp._jspx_meth_tiles_005finsertDefinition_005f0(index_jsp.java:86)
at org.apache.jsp.index_jsp._jspService(index_jsp.java:59)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
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.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:595) 


Does anyone know how avoid the FileNotFoundException?
Thanks for your help.
balavenky


Joined: 04/Apr/2008 00:00:00
Messages: 37
Offline


check your web.xml file (or take one from the sample)
WolfBenz

Joined: 31/Jan/2008 00:00:00
Messages: 19
Offline


I've got the same problem - same exception is thrown.
Cf. post "IceFaces1.7 & Facelets: page (tags) question (facelets not working)".
IceFaces throws this exception although the directory DOES exist.

-Wolf
Rabbithunter

Joined: 19/Dec/2007 00:00:00
Messages: 2
Offline


First of all thanks for your replies.

I checked the web.xml and compared it to the one of the tiles sample delivered with icefaces 1.7.0.

The web.xml looks like this:
Code:
<?xml version="1.0" encoding="UTF-8"?>
 <web-app 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" version="2.4">
   <description>Smartshops web.xml</description>
   <context-param>
     <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
     <param-value>server</param-value>
   </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>true</param-value>
   </context-param>
   <context-param>
     <param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
     <param-value>true</param-value>
   </context-param>
  
   <context-param>
     <param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
     <param-value>false</param-value>
   </context-param>
   <context-param>
     <param-name>org.apache.myfaces.PRETTY_HTML</param-name>
     <param-value>true</param-value>
   </context-param>
   <context-param>
 	<param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
     <param-value>true</param-value>
   </context-param>
   
     <context-param>
     	<param-name>org.apache.myfaces.SECRET</param-name>
         <param-value>NzY1NDMyMTA=</param-value>
     </context-param>
     
     <context-param>
   		<param-name>org.apache.myfaces.VALIDATE</param-name>
        	<param-value>true</param-value>
     </context-param>
   <context-param>
     <param-name>org.apache.myfaces.ADD_RESOURCE_CLASS</param-name>
     <param-value>org.apache.myfaces.renderkit.html.util.DefaultAddResource</param-value>
     <!--param-value>org.apache.myfaces.component.html.util.StreamingAddResource</param-value-->
   </context-param>
 
   <context-param>
     <param-name>org.apache.myfaces.CHECK_EXTENSIONS_FILTER</param-name>
     <param-value>true</param-value>
   </context-param>
   
   <context-param>
     <param-name>org.apache.myfaces.RESOURCE_VIRTUAL_PATH</param-name>
     <param-value>/faces/extensionResource</param-value>
   </context-param>
 
   <context-param>
     <param-name>javax.faces.PARTIAL_STATE_SAVING_METHOD</param-name>
     <param-value>false</param-value>
   </context-param>
 
   <context-param>
     <param-name>javax.faces.PARTIAL_STATE_SAVING_DISPATCH_EVERY_TIME</param-name>
     <param-value>true</param-value>
   </context-param>
   
   <context-param>
     <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
     <param-value>.jspx</param-value>
   </context-param>
 
   <context-param>
 		<param-name>
 			org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG
 		</param-name>
 		<param-value>/WEB-INF/tiles.xml</param-value>
 	</context-param>
 
 
 <!-- Specifies to the ICEfaces framework that synchronous update mode is to be 
      used.  By default, ICEfaces uses asynchronous update mode to support 
      server-initiated updates (AJAX push).  Setting to true will enable 
      synchronous update mode and disable AJAX push features. -->
 	    <context-param>
 	        <param-name>com.icesoft.faces.synchronousUpdate</param-name>
 	        <param-value>true</param-value>
 	    </context-param>
 
 <!-- Specifies to the ICEfaces framework whether to support multiple views of a 
 	     single application from the same browser.  When running in a Portlet 
 	     environment, this parameter must be set to true. -->
 	  <context-param>
 	    <param-name>com.icesoft.faces.concurrentDOMViews</param-name>
 	    <param-value>true</param-value>
 	  </context-param>
 
 	  <context-param>
 	    <param-name>com.icesoft.faces.heartbeatInterval</param-name>
 	    <param-value>60000</param-value>
 	  </context-param>
 
 
 	
   <filter>
     <filter-name>extensionsFilter</filter-name>
     <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
     <init-param>
       <description>Set the size limit for uploaded files.
                 Format: 10 - 10 bytes
                         10k - 10 KB
                         10m - 10 MB
                         1g - 1 GB</description>
       <param-name>uploadMaxFileSize</param-name>
       <param-value>100m</param-value>
     </init-param>
     <init-param>
       <description>Set the threshold size - files
                     below this limit are stored in memory, files above
                     this limit are stored on disk.
 
                 Format: 10 - 10 bytes
                         10k - 10 KB
                         10m - 10 MB
                         1g - 1 GB</description>
       <param-name>uploadThresholdSize</param-name>
       <param-value>100k</param-value>
     </init-param>
   </filter>
   <filter-mapping>
     <filter-name>extensionsFilter</filter-name>
     <url-pattern>*.iface</url-pattern>
   </filter-mapping>
   <filter-mapping>
     <filter-name>extensionsFilter</filter-name>
     <url-pattern>/faces/*</url-pattern>
   </filter-mapping>
   
   <servlet>
     <servlet-name>Faces Servlet</servlet-name>
     <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
     <load-on-startup>1</load-on-startup>
   </servlet>
   <servlet>
 	<servlet-name>Persistent Faces Servlet</servlet-name>
    	<servlet-class>com.icesoft.faces.webapp.xmlhttp.PersistentFacesServlet</servlet-class>
     <load-on-startup>1</load-on-startup>
   </servlet>
   <servlet>
   	<servlet-name>Blocking Servlet</servlet-name>
    	<servlet-class>com.icesoft.faces.webapp.xmlhttp.BlockingServlet</servlet-class>
     <load-on-startup>1</load-on-startup>
   </servlet> 
   
 	<listener>
   		<listener-class>org.apache.tiles.web.startup.TilesListener</listener-class>
 	</listener>
   
   <servlet-mapping>
     <servlet-name>Faces Servlet</servlet-name>
     <url-pattern>*.faces</url-pattern>
   </servlet-mapping>
   <servlet-mapping>
       <servlet-name>Persistent Faces Servlet</servlet-name>
       <url-pattern>/faces/*</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>
   
   <welcome-file-list>
     <welcome-file>index.jsp</welcome-file>
   </welcome-file-list>
   
   <error-page>
 	<error-code>500</error-code>
 	<location>/error.jsp</location>
   </error-page>
 </web-app>
 


The result is that it is in case nearly the same except the fact that I use the "org.apache.tiles.web.startup.TilesListener" of tiles 2 instead of the struts' tiles 1 implementation "org.apache.struts.tiles.TilesServlet". But I guess that this is not the reason for the filenotfoundexception (access denied.) because the configuration of the tiles 2 container is completed.

@WOLFBENZ: Your problem seems to be similar but in your case the file/directory is not found, isn't it?

Anyone else an idea how to solve the problem?
WolfBenz

Joined: 31/Jan/2008 00:00:00
Messages: 19
Offline


Indeed Rabbithunter.
For info, I'll give my web.xml here.
I don't use tiles but purely facelets. (which is off course tiles on steroids ;-)
Tomcat boots my app without error, yet when I try to access the first page in the browser, it gives me the error I posted in thread "IceFaces1.7 & Facelets: page (tags) question (facelets not working)"
If you need more info/files, please let me know.
--Wolf


<?xml version="1.0" encoding="UTF-8"?>
<web-app id="Braunfusor" 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">

<!-- First the Spring-Integration context parameters: -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/META-INF/applicationContext.xml</param-value>
</context-param>

<!-- Log4J is also loaded by Spring: -->
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>/META-INF/log4j.properties</param-value>
</context-param>

<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>/META-INF/faces-config.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>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</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.uploadDirectory</param-name>
<param-value>upload</param-value>
</context-param>

<context-param>
<param-name>com.icesoft.faces.uploadMaxFileSize</param-name>
<param-value>4048576</param-value>
</context-param>

<context-param>
<description>To Enable IceFaces enable asynchronous update mode</description>
<param-name>com.icesoft.faces.synchronousUpdate</param-name>
<param-value>false</param-value>
</context-param>

<listener>
<listener-class>com.icesoft.faces.util.event.servlet.ContextEventRepeater</listener-class>
</listener>

<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

<listener>
<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
</listener>

<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>

<servlet>
<servlet-name>FacesServlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>

<servlet>
<description>ICEfaces provides its own version of the FacesServlet (PersistentFacesServlet) </description>
<servlet-name>Persistent Faces Servlet</servlet-name>
<servlet-class>com.icesoft.faces.webapp.xmlhttp.PersistentFacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>

<servlet>
<description>ICEfaces provides also its own Servlet (BlockingServlet) for handling asynchronous updates</description>
<servlet-name>Blocking Servlet</servlet-name>
<servlet-class>com.icesoft.faces.webapp.xmlhttp.BlockingServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>

<servlet>
<servlet-name>uploadServlet</servlet-name>
<servlet-class>com.icesoft.faces.component.inputfile.FileUploadServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>

<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>Persistent Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Persistent Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>uploadServlet</servlet-name>
<url-pattern>/uploadHtml</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>Blocking Servlet</servlet-name>
<url-pattern>/block/*</url-pattern>
</servlet-mapping>

<session-config>
<session-timeout>0</session-timeout>
</session-config>

<welcome-file-list>
<welcome-file>index.xhtml</welcome-file>
</welcome-file-list>
</web-app>
 
Forum Index -> General Help
Go to:   
Powered by JForum 2.1.7ice © JForum Team