Jetty
  1. Jetty
  2. JETTY-476

Jetty Maven Plugin does not parse TLD file correctly when running in jetty:run mode

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 6.1.0
    • Fix Version/s: None
    • Component/s: JSP
    • Labels:
      None
    • Environment:
      Ubuntu Gutsy
      Maven version: 2.0.7
      Java version: 1.6.0_03
      OS name: "linux" version: "2.6.22-14-generic" arch: "i386"
    • Number of attachments :
      0

      Description

      I am using the "randomcoder-taglibs-1.5.2.jar" in my application. It's not in the main repo so I installed it into my local Maven repository and include it as a dependency in my webapp's pom.xml.
      http://randomcoder.com/download?packageName=randomcoder-taglibs&showAll=true

      I include it in the JSPs as:
      <%@ taglib uri="http://randomcoder.com/tags-ui" prefix="ui" %>

      When I run my webapp with "mvn jetty:run" or "mvn jetty:run-war", the pages that include that tag library throw the following exception, but if I run "mvn package" and deploy the WAR file to tomcat 5.5, it works fine - so I'm thinking it may be a problem with how Jetty works with tag libraries and or JAR files. Thanks in advance.

      2007-12-07 20:57:59.056::WARN: Nested in org.apache.jasper.JasperException: /WEB-INF/jsp/index.jsp(1,1) /common/taglibs.jsp(16,60) PWC6132: Unable to read TLD "META-INF/tlds/randomcoder-ui.tld" from JAR file "file:/home/mstralka/.m2/repository/org/randomcoder/taglibs/1.5.2/taglibs-1.5.2.jar": org.apache.jasper.JasperException: PWC6329: TLD specifies invalid body-content (EMPTY) for custom tag calendar-heading:
      org.apache.jasper.JasperException: /common/taglibs.jsp(16,60) PWC6132: Unable to read TLD "META-INF/tlds/randomcoder-ui.tld" from JAR file "file:/home/mstralka/.m2/repository/org/randomcoder/taglibs/1.5.2/taglibs-1.5.2.jar": org.apache.jasper.JasperException: PWC6329: TLD specifies invalid body-content (EMPTY) for custom tag calendar-heading
      at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:73)
      at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:359)
      at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:153)
      at org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:255)
      at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:482)
      at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:562)
      at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1626)
      at org.apache.jasper.compiler.Parser.parse(Parser.java:165)
      at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:223)
      at org.apache.jasper.compiler.ParserController.parse(ParserController.java:140)
      at org.apache.jasper.compiler.Parser.processIncludeDirective(Parser.java:374)
      at org.apache.jasper.compiler.Parser.parseIncludeDirective(Parser.java:411)
      at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:554)
      at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1626)
      at org.apache.jasper.compiler.Parser.parse(Parser.java:165)
      at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:223)
      at org.apache.jasper.compiler.ParserController.parse(ParserController.java:124)
      at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:184)
      at org.apache.jasper.compiler.Compiler.compile(Compiler.java:409)
      at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:592)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:344)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:470)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:364)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
      at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
      at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265)
      at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:97)
      at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
      at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
      at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:166)
      at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
      at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
      at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
      at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
      at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
      at org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81)
      at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
      at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
      at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
      at org.acegisecurity.ui.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
      at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
      at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:198)
      at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
      at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149)
      at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
      at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
      at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
      at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
      at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:722)
      at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:404)
      at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:285)
      at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126)
      at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:167)
      at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:239)
      at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1158)
      at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:900)
      at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:808)
      at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:476)
      at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:431)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
      at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
      at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:413)
      at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
      at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265)
      at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
      at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
      at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
      at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:166)
      at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
      at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
      at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
      at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:135)
      at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
      at org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81)
      at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
      at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
      at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
      at org.acegisecurity.ui.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
      at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
      at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
      at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
      at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149)
      at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
      at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
      at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
      at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
      at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
      at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:722)
      at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:404)
      at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:206)
      at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
      at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
      at org.mortbay.jetty.Server.handle(Server.java:324)
      at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
      at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:828)
      at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
      at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
      at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
      at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
      at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450)

        Activity

        Hide
        Mark Stralka added a comment -

        Correction - Jetty version is 6.1.6: -
        from mvn -X jetty:run

        [DEBUG] maven-compiler-plugin: resolved to version 2.0.2 from repository central
        [DEBUG] Retrieving parent-POM: org.apache.maven.plugins:maven-plugins::8 for project: null:maven-compiler-plugin:maven-plugin:2.0.2 from the repository.
        [DEBUG] Retrieving parent-POM: org.apache.maven:maven-parent::5 for project: org.apache.maven.plugins:maven-plugins:pom:8 from the repository.
        [DEBUG] Retrieving parent-POM: org.apache:apache::3 for project: org.apache.maven:maven-parent:pom:5 from the repository.
        [DEBUG] maven-jetty-plugin: resolved to version 6.1.6 from repository central
        [DEBUG] Retrieving parent-POM: org.mortbay.jetty:project::6.1.6 for project: org.mortbay.jetty:maven-jetty-plugin:maven-plugin:null from the repository.
        [DEBUG] Adding managed dependencies for org.mortbay.jetty:maven-jetty-plugin

        Show
        Mark Stralka added a comment - Correction - Jetty version is 6.1.6: - from mvn -X jetty:run [DEBUG] maven-compiler-plugin: resolved to version 2.0.2 from repository central [DEBUG] Retrieving parent-POM: org.apache.maven.plugins:maven-plugins::8 for project: null:maven-compiler-plugin:maven-plugin:2.0.2 from the repository. [DEBUG] Retrieving parent-POM: org.apache.maven:maven-parent::5 for project: org.apache.maven.plugins:maven-plugins:pom:8 from the repository. [DEBUG] Retrieving parent-POM: org.apache:apache::3 for project: org.apache.maven:maven-parent:pom:5 from the repository. [DEBUG] maven-jetty-plugin: resolved to version 6.1.6 from repository central [DEBUG] Retrieving parent-POM: org.mortbay.jetty:project::6.1.6 for project: org.mortbay.jetty:maven-jetty-plugin:maven-plugin:null from the repository. [DEBUG] Adding managed dependencies for org.mortbay.jetty:maven-jetty-plugin
        Hide
        Jesse McConnell added a comment -

        I have used this kinda functionality with jetty:run before successfully, its no problem to have tld files located in dependencies in the maven repository.

        however, that tld does violate the spec a bit a bit though

        http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd

        <xsd:simpleContent>
        <xsd:restriction base="j2ee:string">
        <xsd:enumeration value="tagdependent"/>
        <xsd:enumeration value="JSP"/>
        <xsd:enumeration value="empty"/>
        <xsd:enumeration value="scriptless"/>
        </xsd:restriction>
        </xsd:simpleContent>

        That file uses <body-content>EMPTY</body-content> which isn't specifically part of the spec so we see jasper throwing that exception.

        org.apache.jasper.compiler.TagLibraryInfoImpl is where the check is located and its checking for equality based on the value in javax.servlet.jsp.tagext.TagInfo which is:

        public static final String BODY_CONTENT_EMPTY = "empty";

        Show
        Jesse McConnell added a comment - I have used this kinda functionality with jetty:run before successfully, its no problem to have tld files located in dependencies in the maven repository. however, that tld does violate the spec a bit a bit though http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd <xsd:simpleContent> <xsd:restriction base="j2ee:string"> <xsd:enumeration value="tagdependent"/> <xsd:enumeration value="JSP"/> <xsd:enumeration value="empty"/> <xsd:enumeration value="scriptless"/> </xsd:restriction> </xsd:simpleContent> That file uses <body-content>EMPTY</body-content> which isn't specifically part of the spec so we see jasper throwing that exception. org.apache.jasper.compiler.TagLibraryInfoImpl is where the check is located and its checking for equality based on the value in javax.servlet.jsp.tagext.TagInfo which is: public static final String BODY_CONTENT_EMPTY = "empty";
        Hide
        Mark Stralka added a comment -

        So I should just need to fix the value of the TLD to be have the word 'empty' in lowercase letters? I'll try that

        Show
        Mark Stralka added a comment - So I should just need to fix the value of the TLD to be have the word 'empty' in lowercase letters? I'll try that
        Hide
        Mark Stralka added a comment -

        Changing the value of the element to 'empty' (lowercase) worked great! You can mark this as fixed/unnecessary. Thanks

        Show
        Mark Stralka added a comment - Changing the value of the element to 'empty' (lowercase) worked great! You can mark this as fixed/unnecessary. Thanks

          People

          • Assignee:
            Jesse McConnell
            Reporter:
            Mark Stralka
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: