Project

General

Profile

Bug #1453

Unable to process recursive tag files

Added by Udo Offermann about 11 years ago. Updated about 11 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
z2-base
Target version:
Start date:
23.07.2013
Due date:
05.08.2013
% Done:

0%

Estimated time:
origin:

Description

The following tag file works in plain jetty (version 8.1.8) but not in z2:

loop.tag
<%@ taglib prefix="tag" tagdir="/WEB-INF/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ attribute name="num" type="java.lang.Integer" rtexprvalue="true" required="true" %>

<c:if test="${num > 0}">
    <li>${num}</li>
    <tag:loop num="${num -1}"/>    
</c:if>

index.jsp

<%@ taglib prefix="tag" tagdir="/WEB-INF/tags" %>
<html>
    <head><title>Recursive Tag Files</title></head>
    <body>
        <ul>
            <tag:loop num="10"/>
        </ul>
    </body>
</html>

See also the attached war file.

Launching the webapp on z2 yields to this exception:

07/23 09:49:39 [28]...ent/webWorker@0.2 [800]: org.apache.jasper.JasperException: PWC6033: Error in Javac compilation for JSP
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:634)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.apache.jasper.servlet.JspServletWrapper.loadTagFile(JspServletWrapper.java:280)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.apache.jasper.compiler.TagFileProcessor.loadTagFile(TagFileProcessor.java:660)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.apache.jasper.compiler.TagFileProcessor.access$000(TagFileProcessor.java:91)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.apache.jasper.compiler.TagFileProcessor$TagFileLoaderVisitor.visit(TagFileProcessor.java:719)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1502)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2297)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2347)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2353)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.apache.jasper.compiler.Node$Root.accept(Node.java:499)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2297)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.apache.jasper.compiler.TagFileProcessor.loadTagFiles(TagFileProcessor.java:737)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:235)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:625)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:492)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:378)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:598)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:486)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:542)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1065)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at com.zfabrik.impl.servletjsp.webapp.WebAppContextWrapper.access$6(WebAppContextWrapper.java:1)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at com.zfabrik.impl.servletjsp.webapp.WebAppContextWrapper$1.run(WebAppContextWrapper.java:72)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at com.zfabrik.impl.work.ThreadPoolImpl$2.call(ThreadPoolImpl.java:303)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at com.zfabrik.impl.work.ThreadPoolImpl$2.call(ThreadPoolImpl.java:301)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at com.zfabrik.work.WorkUnit.work(WorkUnit.java:373)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at com.zfabrik.impl.work.ThreadPoolImpl.doIt(ThreadPoolImpl.java:257)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at com.zfabrik.impl.work.ThreadPoolImpl.executeAs(ThreadPoolImpl.java:324)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at com.zfabrik.impl.work.ThreadPoolImpl.executeAs(ThreadPoolImpl.java:301)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at com.zfabrik.impl.servletjsp.webapp.WebAppContextWrapper.doHandle(WebAppContextWrapper.java:67)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:413)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:999)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:271)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:98)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.eclipse.jetty.servlet.DefaultServlet.doGet(DefaultServlet.java:557)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at javax.servlet.http.HttpServlet.service(HttpServlet.java:735)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:598)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:486)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:499)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1065)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at com.zfabrik.impl.servletjsp.webapp.WebAppContextWrapper.access$6(WebAppContextWrapper.java:1)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at com.zfabrik.impl.servletjsp.webapp.WebAppContextWrapper$1.run(WebAppContextWrapper.java:72)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at com.zfabrik.impl.work.ThreadPoolImpl$2.call(ThreadPoolImpl.java:303)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at com.zfabrik.impl.work.ThreadPoolImpl$2.call(ThreadPoolImpl.java:301)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at com.zfabrik.work.WorkUnit.work(WorkUnit.java:373)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at com.zfabrik.impl.work.ThreadPoolImpl.doIt(ThreadPoolImpl.java:257)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at com.zfabrik.impl.work.ThreadPoolImpl.executeAs(ThreadPoolImpl.java:343)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at com.zfabrik.impl.work.ThreadPoolImpl.executeAs(ThreadPoolImpl.java:301)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at com.zfabrik.impl.servletjsp.webapp.WebAppContextWrapper.doHandle(WebAppContextWrapper.java:67)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:413)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:999)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.eclipse.jetty.server.Server.handle(Server.java:350)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:454)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:890)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:944)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:630)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:620)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:46)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:603)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:538)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at java.lang.Thread.run(Thread.java:680)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]: Caused by: java.io.FileNotFoundException: no such file: /Users/udoo/dev/hd-mobil/hippo/z2_hippo/workspace/z2-core/work/repos/7ea65360/pkg/recursive-tag-files/web/1400a813698/gen/jetty/jsp/org/apache/jsp/tag/web/loop_tag.class
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.apache.jasper.compiler.SmapUtil$SDEInstaller.<init>(SmapUtil.java:262)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.apache.jasper.compiler.SmapUtil$SDEInstaller.install(SmapUtil.java:234)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.apache.jasper.compiler.SmapUtil.installSmap(SmapUtil.java:162)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:406)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.apache.jasper.compiler.Compiler.compile(Compiler.java:453)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:625)
07/23 09:49:39 [28]...ent/webWorker@0.2 [800]:     ... 76 more


Files

rtf.war (1.7 KB) rtf.war Udo Offermann, 23.07.2013 10:07
#1

Updated by Udo Offermann about 11 years ago

  • Description updated (diff)
#2

Updated by Udo Offermann about 11 years ago

  • Due date set to 05.08.2013
#3

Updated by Henning Blohm about 11 years ago

  • Status changed from New to In Progress
#4

Updated by Henning Blohm about 11 years ago

  • Status changed from In Progress to Rejected

Tested on two machines with latest z2_base from Git (in that case Jetty 8.1.11) and works fine. Suggest re-test after transport.

#5

Updated by Henning Blohm about 11 years ago

  • Target version set to 2.2
#6

Updated by Udo Offermann about 11 years ago

  • Status changed from Rejected to In Progress

still reproducible on Mac OS on a Z2 clean room installation

#7

Updated by Udo Offermann about 11 years ago

  • Status changed from In Progress to Resolved

The bug occurs only on Udo's system but not on Henning's system.
The difference between Henning's and Udo's system is that Henning is using JDK 1.7 while Udo is using 1.6.

In org.apache.jasper.EmbeddedServletOptions the keepgenerated parameter is set as:

   ...
   keepGenerated = getBoolean(config, ! isJDK6(), "keepgenerated");

   ...

   private boolean isJDK6() {
        return "1.6".equals(System.getProperty("java.specification.version"));
   }

Thus the default for keepgenerated is true in JDK 1.7.

Setting keepgenerated to true inside default-web.xml seems to solve the problem.

Nevertheless it is unclear why the bug does not occur on a plain jetty installation with JDK 1.6.

#8

Updated by Udo Offermann about 11 years ago

Found the reason why plain Jetty does not have the problem!

Jetty 8 uses JSR199JavaCompiler by default. z2 favors the Eclipse Java compiler because JSR199JavaCompiler requires a JDK while z2 only needs a JRE (see also Jetty #1126)

z2/jetty can be configured to use JSR199JavaCompiler. Just comment the following section inside environemnt/webServer/jetty.xml:

   ...
   <!-- let jetty use the ECJ rather than looking for a JDK 
        See also http://wiki.eclipse.org/Jetty/Howto/Configure_JSP
   <Call class="java.lang.System"  name="setProperty">
      <Arg>org.apache.jasper.compiler.disablejsr199</Arg>
      <Arg>false</Arg>
   </Call>
   -->

Make sure that you have a JDK installed.

Also available in: Atom PDF