Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-dev] [jetty-users] JSP pages are recompiled at runtime

Could you provide documentation with examples to use jetty precompiled jsps without war file please ?

On Fri, Sep 15, 2017 at 1:52 PM, Joakim Erdfelt <joakim@xxxxxxxxxxx> wrote:
ServletContextHandler does not use jetty-web.xml, that's a feature of full blown webapps, wars, and WebAppContext.

If the periodic temp directory cleanup scripts/crons are a problem (which is very common), then don't use the system temp directory for long running webapps that need a valid working directory (the #1 solution to this issue is to select a sane work directory).

Either use a different work directory location that tmpwatch doesn't care about, 
or disable tmpwatch, 
or configure tmpwatch to ignore/exclude certain paths/patterns.


Joakim Erdfelt / joakim@xxxxxxxxxxx

On Fri, Sep 15, 2017 at 9:46 AM, upendar devu <devulapalli8@xxxxxxxxx> wrote:
I ran tmpwatch  and it got deleted /tmp/embedded-jetty-jsp  folder , I 'm still able to access the portal without issues as I dont see /tmp/embedded-jetty-jsp is created this time , really confused how its working without the compiled pages in /tmp location ? 

is it referring from the precompiled pages which are exist in one of the jar file  then why it creates /tmp/embedded-jetty-jsp sometime then ?
But If I restart the jetty server then its creating /tmp/embedded-jetty-jsp

On Fri, Sep 15, 2017 at 12:11 PM, upendar devu <devulapalli8@xxxxxxxxx> wrote:
Thanks much for quick responses . Here I added more details.
We are not using maven-war-plugin . Also not using war file and web.xml file hence  webfrag.xml  is not merged into web.xml . 

Our application uses jetty-web.xml file and all the precompiled pages (jetty-jspc-maven-plugin) are packaged into jar file along with other model classes for both versions 8.1.4 and 9.4.5

With Jetty version : 8.1.4  :  we still seeing a /tmp/jetty-0.0.0.0-9010-webapp-_core-any-/jsp  is getting created with 0 files under it. No issues seen.

With Jetty version 9.4.5 :  We see /tmp/embedded-jetty-jsp/jsp/org/apache/jsp/pages is getting created with .class jsp pages.  The issues we encountered is linux  tmpwatch cron job is deleting these files older than 10days . when we access the portal later then the JSP pages are recompiled and located in /tmp location but the problem is we dont see all .class files are generated for all pages /tmp location though we navigate all the pages in portal.   Hence we are getting IOException and no class defin found errors.

Error // this caused error due to only 2 folders were created with .class pages - not sure why it could not create other folders as listed below
[ ~]$ cd /tmp/embedded-jetty-jsp/jsp/org/apache/jsp/pages/
[]$ ls -lrt
total 8
drwxr-xr-x 2 xx xx 4096 Sep  7 19:16 product
drwxr-xr-x 2 xxx xx 4096 Sep 14 22:01 model

Expected :  if tmp location has all these below folders then we dont encounter any errors 
[/tmp/embedded-jetty-jsp/jsp/org/apache/jsp/pages]$ ls -lrt
total 28
drwxr-xr-x 2 ccc ccc 4096 Sep 15 07:39 auth
drwxr-xr-x 2 ccc ccc 4096 Sep 15 08:36 model
drwxr-xr-x 2 ccc ccc 4096 Sep 15 09:44 user
drwxr-xr-x 2 ccc ccc 4096 Sep 15 09:45 role
drwxr-xr-x 2 ccc ccc 4096 Sep 15 15:36 common
drwxr-xr-x 2 ccc ccc 4096 Sep 15 15:36 account
drwxr-xr-x 2 ccc ccc 4096 Sep 15 15:36 product


Please help us on these.
1. why the jetty has recompiled only few pages as shown above when tmpwatch cleaned up /tmp folder ? 
2. How to make sure the application uses precompiled jsps only and stop creating .class jsps in /tmp location ? I want application use only precompiled pages - without using web.xml file and war deployment model


Thank you


On Fri, Sep 15, 2017 at 8:35 AM, Joakim Erdfelt <joakim@xxxxxxxxxxx> wrote:
The embedded-jetty-jsp example project uses ServletContextHandler, not WebAppContext.
No WEB-INF/web.xml is in use that way.

Joakim Erdfelt / joakim@xxxxxxxxxxx

On Wed, Sep 13, 2017 at 1:24 PM, upendar devu <devulapalli8@xxxxxxxxx> wrote:
We recently upgraded from Jetty version 8 to 9.4.6  ; The embedded Jetty server recompiling the JSP pages and creating a folder /tmp/embedded-jetty-jsp despite the configuration attribute Development is set to false.

In my lower env   - the folder embedded-jetty-jsp is getting created and we see all the recompiled JSP pages .

in Production env -  the folder embedded-jetty-jsp is getting created and we see ONLY few of the JSP pages are getting recompiled . Due to this we are getting below error on clicking the page in the portal - the page associated to jSP is recompiled in that tmp folder.

We need your help to find the rootcause and fix for this issue. 

Error :

07 Sep 2017 16:26:28,153 [qtp1043351526-50615] ERROR biz.xxxx.xxxx.common.struts.ExceptionInterceptor (intercept:31) - JSPException including path '/pages/theme/xxxx.jsp'. org.apache.tiles.request.render.CannotRenderException: JSPException including path '/pages/theme/xxxx.jsp'. at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:399) at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:238) at org.apache.tiles.TilesContainerWrapper.render(TilesContainerWrapper.java:103) at org.apache.tiles.impl.mgmt.CachingTilesContainer.render(CachingTilesContainer.java:126) at org.apache.struts2.views.tiles.TilesResult.doExecute(TilesResult.java:161) at org.apache.struts2.result.StrutsResultSupport.execute(StrutsResultSupport.java:208) at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:373) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:277) at com.opensymphony.xwork2.interceptor.annotations.AnnotationWorkflowInterceptor.intercept(AnnotationWorkflowInterceptor.java:133) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.doIntercept(ConversionErrorInterceptor.java:139) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:133) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:88) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:174) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:171) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) at biz.xxxx.xxxx.common.struts.PreBindInterceptor.intercept(PreBindInterceptor.java:19) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) at biz.xxxx.xxxx.core.web.interceptor.LiteResultInterceptor.intercept(LiteResultInterceptor.java:51) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) at biz.xxxx.xxxx.core.web.interceptor.FragmentInterceptor.intercept(FragmentInterceptor.java:35) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:246) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) at biz.xxxx.xxxx.common.struts.NoCacheInterceptor.intercept(NoCacheInterceptor.java:39) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) at biz.xxxx.xxxx.core.web.interceptor.SecurityInterceptor.intercept(SecurityInterceptor.java:70) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) at biz.xxxx.xxxx.common.struts.ExceptionInterceptor.intercept(ExceptionInterceptor.java:23) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) at org.apache.struts2.factory.StrutsActionProxy.execute(StrutsActionProxy.java:54) at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:564) at org.apache.struts2.dispatcher.ExecuteOperations.executeAction(ExecuteOperations.java:81) at org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:143) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637) at biz.xxxx.xxxx.common.filter.BaseFilter$WrappedFilterChain.doFilter(BaseFilter.java:108) at biz.xxxx.xxxx.common.filter.BaseFilter.doFilter(BaseFilter.java:64) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637) at biz.xxxx.xxxx.common.filter.BaseFilter$WrappedFilterChain.doFilter(BaseFilter.java:108) at biz.xxxx.xxxx.common.filter.ResponseUrlFilter.onDynamic(ResponseUrlFilter.java:14) at biz.xxxx.xxxx.common.filter.BaseFilter.doFilter(BaseFilter.java:49) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637) at biz.xxxx.xxxx.common.filter.BaseFilter$WrappedFilterChain.doFilter(BaseFilter.java:108) at biz.xxxx.xxxx.common.filter.PerformanceFilter.onDynamic(PerformanceFilter.java:17) at biz.xxxx.xxxx.common.filter.BaseFilter.doFilter(BaseFilter.java:49) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637) at biz.xxxx.xxxx.common.filter.BaseFilter$WrappedFilterChain.doFilter(BaseFilter.java:108) at biz.xxxx.xxxx.common.filter.SecurityContextFilter.onDynamic(SecurityContextFilter.java:18) at biz.xxxx.xxxx.common.filter.BaseFilter.doFilter(BaseFilter.java:49) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:190) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595) at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1253) at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564) at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1155) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) at org.eclipse.jetty.server.Server.handle(Server.java:564) at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:317) at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251) at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279) at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:110) at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124) at org.eclipse.jetty.util.thread.Invocable.invokePreferred(Invocable.java:128) at org.eclipse.jetty.util.thread.Invocable$InvocableExecutor.invoke(Invocable.java:222) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:294) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:199) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:672) at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:590) at java.lang.Thread.run(Thread.java:748) Caused by: java.io.IOException: JSPException including path '/pages/theme/xxxx.jsp'. at org.apache.tiles.request.servlet.ServletUtil.wrapServletException(ServletUtil.java:61) at org.apache.tiles.request.jsp.JspRequest.doInclude(JspRequest.java:125) at org.apache.tiles.request.AbstractViewRequest.dispatch(AbstractViewRequest.java:47) at org.apache.tiles.request.render.DispatchRenderer.render(DispatchRenderer.java:47) at org.apache.tiles.request.render.ChainedDelegateRenderer.render(ChainedDelegateRenderer.java:68) at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:259) at org.apache.tiles.TilesContainerWrapper.render(TilesContainerWrapper.java:108) at org.apache.tiles.template.InsertAttributeModel.renderAttribute(InsertAttributeModel.java:188) at org.apache.tiles.template.InsertAttributeModel.execute(InsertAttributeModel.java:132) at org.apache.tiles.jsp.taglib.InsertAttributeTag.doTag(InsertAttributeTag.java:299) at org.apache.jsp.pages.common.layout_jsp._jspx_meth_tiles_005finsertAttribute_005f10(layout_jsp.java:1645) at org.apache.jsp.pages.common.layout_jsp._jspx_meth_c_005fotherwise_005f0(layout_jsp.java:1614) at org.apache.jsp.pages.common.layout_jsp._jspx_meth_c_005fchoose_005f1(layout_jsp.java:1527) at org.apache.jsp.pages.common.layout_jsp._jspx_meth_c_005fwhen_005f0(layout_jsp.java:1010) at org.apache.jsp.pages.common.layout_jsp._jspx_meth_c_005fchoose_005f0(layout_jsp.java:915) at org.apache.jsp.pages.common.layout_jsp._jspService(layout_jsp.java:255) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:443) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:385) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:329) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:833) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:535) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:566) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:190) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595) at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1253) at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564) at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1155) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:203) at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:73) at org.apache.tiles.request.servlet.ServletRequest.forward(ServletRequest.java:265) at org.apache.tiles.request.servlet.ServletRequest.doForward(ServletRequest.java:228) at org.apache.tiles.request.AbstractClientRequest.dispatch(AbstractClientRequest.java:57) at org.apache.tiles.request.render.DispatchRenderer.render(DispatchRenderer.java:47) at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:259) at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:397) ... 85 more Caused by: java.lang.NoClassDefFoundError: org/apache/jsp/tag/web/form_tag at org.apache.jsp.pages.theme.xxxx_jsp._jspx_meth_neu_005fform_005f0(xxxx_jsp.java:378) at org.apache.jsp.pages.theme.xxxx_jsp._jspService(xxxx_jsp.java:301) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:443) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:385) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:329) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:841) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:535) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:566) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:190) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595) at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1253) at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564) at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1155) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) at org.eclipse.jetty.server.Dispatcher.include(Dispatcher.java:124) at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:887) at org.apache.jasper.runtime.PageContextImpl.doInclude(PageContextImpl.java:679) at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:673) at org.apache.tiles.request.jsp.JspRequest.doInclude(JspRequest.java:123) ... 128 more


_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users


_______________________________________________
jetty-dev mailing list
jetty-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-dev



_______________________________________________
jetty-dev mailing list
jetty-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-dev


_______________________________________________
jetty-dev mailing list
jetty-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-dev


Back to the top