Summary: | Tomcat and path with pound sign (#) -> ClassNotFoundException | ||
---|---|---|---|
Product: | Tomcat 6 | Reporter: | Markus Schiegl <apache> |
Component: | Catalina | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | hrendalf |
Priority: | P2 | ||
Version: | 6.0.14 | ||
Target Milestone: | default | ||
Hardware: | All | ||
OS: | All | ||
URL: | http://marc.info/?l=tomcat-user&m=118660647227413&w=2 |
Description
Markus Schiegl
2007-08-16 14:35:07 UTC
I've looked into this problem a bit. Briefly, the exception on startup can be fixed but that reveals problems in other Tomcat components. 1. CNFE on startup (problem reported by Markus): Caused by a problem with File.toURL called from o.a.c.startup.ClassLoaderFactory. Can be fixed by Sun's suggested workaround of using File.toURI and URI.toURL - see http://java.sun.com/j2se/1.5.0/docs/api/java/io/File.html#toURL() 2. After fixing that, Tomcat starts but JSPs won't run because Jasper is putting its output files in the wrong directory. This is caused by some strange-looking code in o.a.jasper.JspCompilationContext.createOutputDir that mixes file and URL syntax together to create the wrong directory. 3, etc. There are several other places in Tomcat where File.toURL is used and I think it could have problems with "#" in pathnames, but I don't know what the effects are. I've noted *potential* problems in: o.a.c.ant, o.a.c.core, o.a.c.ha.deploy, o.a.c.loader, o.a.c.startup, o.a.jasper. I could help fix some of the problems, but there are lots that I haven't figured out. Is it worth the trouble to find and fix all the related problems, or is it better to just tell people not to use unusual directory names? I have fixed the bits that are clearly broken and proposed the patch for 6.0.x As for the rest, if it ain't broke... This has been fixed in 6.0.x and will be included in 6.0.17 onwards. |