Hi all,
I am upgrading a project which was written in
JSF
1.2 ,apache tiles 2.0.6 and other libraries; now I'm using JSF 2.1. First of all, can I use apache tiles 2.0.6 with JSF 2.1?
In JSF 2.1, where I am having xhtml and
jsp
(only for apache tiles -/tiles/layout-wide.jsp) pages, I'm getting following error, because of which my home page does not render properly and it displays only some portion of the page:
oracle-glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=40;_ThreadName=Thread-2;|ApplicationDispatcher[/specialist-directory] PWC1231: Servlet.service() for
servlet
jsp threw exception
java.lang.IllegalArgumentException: Cannot find a factory to create the request context
at org.apache.tiles.context.ChainedTilesContextFactory.createRequestContext(ChainedTilesContextFactory.java:140)
at org.apache.tiles.impl.BasicTilesContainer.getRequestContext(BasicTilesContainer.java:498)
at org.apache.tiles.impl.BasicTilesContainer.getAttributeContext(BasicTilesContainer.java:166)
at org.apache.tiles.jsp.taglib.InsertAttributeTag.startContext(InsertAttributeTag.java:125)
at org.apache.tiles.jsp.taglib.ContainerTagSupport.doStartTag(ContainerTagSupport.java:69)
at org.apache.tiles.jsp.taglib.RenderTagSupport.doStartTag(RenderTagSupport.java:138)
at org.apache.jsp.tiles.layout_002dwide_jsp._jspx_meth_tiles_insertAttribute_0(layout_002dwide_jsp.java from :395)
at org.apache.jsp.tiles.layout_002dwide_jsp._jspService(layout_002dwide_jsp.java from :286)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:411)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:473)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:377)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:809)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:671)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:505)
at org.apache.catalina.core.ApplicationDispatcher.doDispatch(ApplicationDispatcher.java:476)
at org.apache.catalina.core.ApplicationDispatcher.dispatch(ApplicationDispatcher.java:355)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:305)
at org.apache.tiles.servlet.context.ServletTilesRequestContext.forward(ServletTilesRequestContext.java:198)
at org.apache.tiles.servlet.context.ServletTilesRequestContext.dispatch(ServletTilesRequestContext.java:179)
at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:606)
at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:246)
at ca.bc.gov.hlth.template.filter.TilesDecoratorFilter.doFilter(TilesDecoratorFilter.java:165)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:662)
|#]
[#|2013-02-14T13:53:05.499-0600|INFO|oracle-glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=40;_ThreadName=Thread-2;|2013-02-14 13:53:05 ERROR BasicTilesContainer:612 - Error rendering tile
org.apache.tiles.util.TilesIOException: ServletException including path '/tiles/layout-wide.jsp'.
at org.apache.tiles.servlet.context.ServletTilesRequestContext.wrapServletException(ServletTilesRequestContext.java:298)
at org.apache.tiles.servlet.context.ServletTilesRequestContext.forward(ServletTilesRequestContext.java:200)
at org.apache.tiles.servlet.context.ServletTilesRequestContext.dispatch(ServletTilesRequestContext.java:179)
at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:606)
at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:246)
at ca.bc.gov.hlth.template.filter.TilesDecoratorFilter.doFilter(TilesDecoratorFilter.java:165)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.IllegalArgumentException: Cannot find a factory to create the request context
at org.apache.tiles.context.ChainedTilesContextFactory.createRequestContext(ChainedTilesContextFactory.java:140)
at org.apache.tiles.impl.BasicTilesContainer.getRequestContext(BasicTilesContainer.java:498)
at org.apache.tiles.impl.BasicTilesContainer.getAttributeContext(BasicTilesContainer.java:166)
at org.apache.tiles.jsp.taglib.InsertAttributeTag.startContext(InsertAttributeTag.java:125)
at org.apache.tiles.jsp.taglib.ContainerTagSupport.doStartTag(ContainerTagSupport.java:69)
at org.apache.tiles.jsp.taglib.RenderTagSupport.doStartTag(RenderTagSupport.java:138)
at org.apache.jsp.tiles.layout_002dwide_jsp._jspx_meth_tiles_insertAttribute_0(layout_002dwide_jsp.java from :395)
at org.apache.jsp.tiles.layout_002dwide_jsp._jspService(layout_002dwide_jsp.java from :286)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:411)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:473)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:377)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:809)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:671)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:505)
at org.apache.catalina.core.ApplicationDispatcher.doDispatch(ApplicationDispatcher.java:476)
at org.apache.catalina.core.ApplicationDispatcher.dispatch(ApplicationDispatcher.java:355)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:305)
at org.apache.tiles.servlet.context.ServletTilesRequestContext.forward(ServletTilesRequestContext.java:198)
... 29 more
Apache Tiles is a horrible invention that I never could manage to love. JSF2 added Facelets, which can do tiling in a much more sensible way.
While I don't think that JSF 2.x actually forbids Tiles, it does drop support for "jsp" pages, which might be a problem for you.
"Disappointing" and "Utterly Horrible" are not equal.
I'm not sure what you mean about JSF 2.1 supporting JSP. You can mix JSPs (and servlets) and JSF Views in a JSF webapp, but you could always do that.
The most significant difference between JSF 1.x and 2.x, however is removal of JSP as the View Definition Language. Or View Template Langage, as it's also known.
In JSF1, you defined Views as JSPs, which went through the JSP Compiler to produce servlet code that interacted with the FacesServlet. In JSF2, the Facelets View compiler takes over that function, and doesn't produce any servlet code of its own.
Actually, you could use Facelets that way in JSF1, but it was an optional add-on. In JSF2, it became part of the core implementation, and completely replaced JSPs for View templating.
"Disappointing" and "Utterly Horrible" are not equal.
Thanks Tim,
But in this project I'm still getting following error:
So far I could not find the cause of this problem. Could you help?