Details
Description
When packaged into a WAR, web site that otherwise works well (on 5 & 6) fails to work at all.
org.apache.jasper.JasperException: PWC6180: Unable to initialize TldLocationsCache
at org.apache.jasper.compiler.TldLocationsCache.init(TldLocationsCache.java:347)
at org.apache.jasper.compiler.TldLocationsCache.getLocation(TldLocationsCache.java:293)
at org.apache.jasper.JspCompilationContext.getTldLocation(JspCompilationContext.java:582)
at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:469)
at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:546)
at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1612)
at org.apache.jasper.compiler.Parser.parse(Parser.java:154)
at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:210)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:111)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:267)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:620)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:602)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:618)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:440)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:335)
at redcondor.web.servlets.jsp.JasperServlet$Compiler.compile(JasperServlet.java:115)
at redcondor.web.servlets.jsp.JasperServlet$Compiler.run(JasperServlet.java:152)
-
Hide
- jetty-jsp-bug.zip
- 08/Oct/06 4:35 PM
- 5.95 MB
- Jeffrey Aguilera
-
- jetty-jsp-bug/jetty/jetty-6.0.1.jar 420 kB
- jetty-jsp-bug/jetty/jetty-util-6.0.1.jar 105 kB
- jetty-jsp-bug/jetty/.../ant-1.6.5.jar 1010 kB
- jetty-jsp-bug/jetty/.../core-3.1.1.jar 3.40 MB
- jetty-jsp-bug/jetty/jsp-2.1/jsp-2.1.jar 617 kB
- jetty-jsp-bug/jetty/.../jsp-api-2.1.jar 498 kB
- jetty-jsp-bug/.../servlet-api-2.5-6.0.1.jar 133 kB
- jetty-jsp-bug/jetty.xml 3 kB
- jetty-jsp-bug/Test.class 0.7 kB
- jetty-jsp-bug/test.cmd 0.2 kB
- jetty-jsp-bug/Test.java 0.3 kB
- jetty-jsp-bug/test.war 249 kB
- jetty-jsp-bug/webdefault.xml 21 kB
Activity
JasperServlet is a simple wrapper around JspServlet that precompiles resources using ?jsp_precompile query string.
If I remove my precompiler, remove all filters, I still get the same result, but this time only when I navigate to a page containing taglibs. The top 16 stack frames are identical, but this time everything is in the realm of Jetty and Jasper.
2006-10-07 11:36:26.062::WARN: EXCEPTION
org.apache.jasper.JasperException: PWC6180: Unable to initialize TldLocationsCache
at org.apache.jasper.compiler.TldLocationsCache.init(TldLocationsCache.java:347)
at org.apache.jasper.compiler.TldLocationsCache.getLocation(TldLocationsCache.java:293)
at org.apache.jasper.JspCompilationContext.getTldLocation(JspCompilationContext.java:582)
at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:469)
at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:546)
at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1612)
at org.apache.jasper.compiler.Parser.parse(Parser.java:154)
at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:210)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:111)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:267)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:620)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:602)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:618)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:440)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:335)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:445)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:356)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:226)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:627)
at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:266)
at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126)
at org.mortbay.jetty.servlet.DefaultServlet.doGet(DefaultServlet.java:411)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:445)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:356)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:226)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:627)
at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:149)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:123)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:141)
at org.mortbay.jetty.Server.handle(Server.java:269)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:430)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:687)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:492)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:199)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:339)
at org.mortbay.jetty.nio.HttpChannelEndPoint.run(HttpChannelEndPoint.java:270)
at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)
Again, this configuration works fine if the WAR is unpacked.
The Jasper setup is fairly simple:
<servlet>
<servlet-name>JasperServlet</servlet-name>
<servlet-class>redcondor.web.servlets.jsp.JasperServlet</servlet-class>
<!-<init-param>->
<!-<param-name>development</param-name>->
<!-<param-value>false</param-value>->
<!-</init-param>->
<!-<init-param>->
<!-<param-name>mappedfile</param-name>->
<!-<param-value>true</param-value>->
<!-</init-param>->
<init-param>
<param-name>compilerSourceVM</param-name>
<param-value>1.5</param-value>
</init-param>
<init-param>
<param-name>compilerTargetVM</param-name>
<param-value>1.5</param-value>
</init-param>
<init-param>
<param-name>scratchdir</param-name>
<param-value>jasper/web</param-value>
</init-param>
<init-param>
<param-name>trimSpaces</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>JasperServlet</servlet-name>
<url-pattern>*.html</url-pattern>
</servlet-mapping>
(JasperServlet extends JspServlet. It ensures that the scratchdir exists before calling super.init() and then spawns a precompile thread. I get the same results if I use JspServlet directly.) I am using the jsp-2.1 servlet libraries (ant-1.6.5.jar, core-3.1.1.jar, jsp-2.1.jar, and jsp-api-2.1.jar .. and not the jsp-2.0 stuff.)
I will try to narrow this down further. Thanks for your help. --jeff
I just wanted to clarify (after re-reading your 07/Oct/06 02:41 AM comment):
The JSPs seem to work find. The problem occurs on pages containing tag libraries.
Jeffry,
I've also tested pages that have taglib references in them. If you build jetty, you should get a webapp called "test" in the $jetty.home/webapps directory. That webapp (jar'ed up into a war file) deploys without problems, and I can hit the pages with taglib references in them. Can you try and see what happenst? Click on the "Other JSP Tests" for a list of test jsp pages, and click on the ones with "Tag" in the title.
cheers
Jan
Jan,
I have attached an archive that demonstrates the problem using the test web app shipped with 6.0.1.
When run with setExtractWAR true, the test application displays all pages correctly. When setExtractWAR is set to false, three of the JSP examples fail with the following exceptions:
----------------------------------------------------------------------------------------------------------
BodyTag Demo
----------------------------------------------------------------------------------------------------------
HTTP ERROR: 500
/jsp/tag.jsp(4,58) PWC6117: File "/WEB-INF/acme-taglib.tld" not found
RequestURI=/jsp/tag.jsp
Caused by:
org.apache.jasper.JasperException: /jsp/tag.jsp(4,58) PWC6117: File "/WEB-INF/acme-taglib.tld" not found
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:60)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:463)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:129)
at org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:174)
at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:471)
at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:546)
at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1612)
at org.apache.jasper.compiler.Parser.parse(Parser.java:154)
at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:210)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:111)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:267)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:620)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:602)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:618)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:440)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:335)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:445)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1050)
at com.acme.TestFilter.doFilter(TestFilter.java:70)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:354)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:179)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:226)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:627)
at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:149)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:123)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:141)
at org.mortbay.jetty.Server.handle(Server.java:269)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:430)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:687)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:492)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:199)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:339)
at org.mortbay.jetty.nio.HttpChannelEndPoint.run(HttpChannelEndPoint.java:270)
at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)
Powered by Jetty://
----------------------------------------------------------------------------------------------------------
SimpleTag Demo
----------------------------------------------------------------------------------------------------------
HTTP ERROR: 500
/jsp/tag2.jsp(4,59) PWC6117: File "/WEB-INF/acme-taglib2.tld" not found
RequestURI=/jsp/tag2.jsp
Caused by:
org.apache.jasper.JasperException: /jsp/tag2.jsp(4,59) PWC6117: File "/WEB-INF/acme-taglib2.tld" not found
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:60)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:463)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:129)
at org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:174)
at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:471)
at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:546)
at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1612)
at org.apache.jasper.compiler.Parser.parse(Parser.java:154)
at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:210)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:111)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:267)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:620)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:602)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:618)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:440)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:335)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:445)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1050)
at com.acme.TestFilter.doFilter(TestFilter.java:70)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:354)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:179)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:226)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:627)
at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:149)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:123)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:141)
at org.mortbay.jetty.Server.handle(Server.java:269)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:430)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:687)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:492)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:199)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:339)
at org.mortbay.jetty.nio.HttpChannelEndPoint.run(HttpChannelEndPoint.java:270)
at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)
Powered by Jetty://
----------------------------------------------------------------------------------------------------------
Tag File Demo
----------------------------------------------------------------------------------------------------------
HTTP ERROR: 500
/jsp/tagfile.jsp(13,10) PWC6142: No tag "panel" defined in tag library imported with prefix "acme"
RequestURI=/jsp/tagfile.jsp
Caused by:
org.apache.jasper.JasperException: /jsp/tagfile.jsp(13,10) PWC6142: No tag "panel" defined in tag library imported with prefix "acme"
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:49)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:461)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:211)
at org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1373)
at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1635)
at org.apache.jasper.compiler.Parser.parse(Parser.java:154)
at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:210)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:111)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:267)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:620)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:602)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:618)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:440)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:335)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:445)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1050)
at com.acme.TestFilter.doFilter(TestFilter.java:70)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:354)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:179)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:226)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:627)
at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:149)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:123)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:141)
at org.mortbay.jetty.Server.handle(Server.java:269)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:430)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:687)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:492)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:199)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:339)
at org.mortbay.jetty.nio.HttpChannelEndPoint.run(HttpChannelEndPoint.java:270)
at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)
Powered by Jetty://
Jeffrey, I found a problem that was stopping the .tag files from working and I've fixed it in svn trunk (r 1085). So with the test webapp, youll find that the /jsp/tagfile.jsp now works. However, the other jsps using taglibs continue to be a problem.
Historically speaking, with jasper it is has always been recommended that if you want to do on-the-fly compilation, then run with an exploded war. So, I think this advice still applies. I am continuing to look at this problem, but given that it has been a long-known issue with jasper, then for now I'm going to have to prioritize this a bit lower on my time schedule. If you want to look into this more too, then please do and and let me know what you find.
Jeffrey,
I've updated the version of glassfish used by jetty. Could you try again with your packed war and add the results to this issue?
regards
Jan
Which version (of Jetty)? 6.0.2 still exhibits the problem, but that's been on sourceforge since 11/23. Haven't tried the 6.1.0pre3 release on codehaus (also dated 11/23). If there is any specific build you want me try, I would be happy to check it out.
Jeffrey,
Sorry, I should have been more precise. svn trunk or 6.1.0pre3 has the updated glassfish version.
I'm not sure the problem is fixed, however the glassfish guys would like more information on it and suggested to try the most recent.
regards
Jan
This issue still exists with jetty 6.1.7, which uses Jasper from Glassfish at tag number SJSAS-9_1-B58G-FCS-08_Sept_2007.
Bug raised on Glassfish: https://glassfish.dev.java.net/issues/show_bug.cgi?id=3953
Jan
Moved to jsp.dev.net at KinMan Chung's request: https://jsp.dev.java.net/issues/show_bug.cgi?id=1
I've hit this recently moving over from an Eclipse+Ant+Tomcat integration to Eclipse-Maven-Jetty.
Looking at the glassfish.dev.java.net issue linked it is marked as WONTFIX which is a bit disturbing.. Any ideas here? I'm using the maven-jetty-plugin 6.1.12.rc3.
My only suggestion is that you request the issue to be reopened at Glassfish. The JSP developers need to see that there is need to support this before they'll prioritize it.
cheers
Jan
moving out to next release again...have contacted the glassfish jsp folks again and hoping we can get something worked out eventually
Given the venerable age that this issue has acquired, I hesitate to declare this one actually resolved, but I tried deploying the packed test.war onto jetty-7.5.1 (which has updated the version of jsp) and with extractWAR(false) and copyWebInf(false), I could access all of the jsps that use tags.
So, I'm closing this issue, as something seems to have changed that means that at least in some circumstances, jsps using taglibs can be used from a packed war.
If someone retests and can find definitive proof of a problem, please reopen and attach a war file that demonstrates the problem. Even more interesting if you can point at a version of Tomcat on which deploying the packed war (not extracted) does work (as we are always evaluating whether it would be better to switch to Apache's jsp impl).
cheers
Jan
Running with an unextracted war file containing jsps is working fine for me with our standard test webapp. From your trace, it looks like perhaps you are doing something special with the your own JspServlet compilation. I'd double check that you are setting up jasper correctly.
regards
Jan