Summary: | ClassCastException if directory ending with .jar exists in WEB-INF/lib | ||
---|---|---|---|
Product: | Tomcat 6 | Reporter: | Andreas Sahlbach <andreas.sahlbach> |
Component: | Catalina | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | rolf |
Priority: | P2 | ||
Version: | 6.0.18 | ||
Target Milestone: | default | ||
Hardware: | All | ||
OS: | All | ||
Attachments: | Add support for directories with name ending on .jar |
Description
Andreas Sahlbach
2008-09-11 12:22:35 UTC
This has been fixed in trunk and proposed for 6.0.x This has been fixed in 6.0.x and will be included in 6.0.19 onwards. Created attachment 23934 [details]
Add support for directories with name ending on .jar
While the specific case (directory called .jar in WEB-INF/lib) has been fixed, two other cases remain in ExtensionValidator.
Therefore I reopened this bug:
We're using an exploded deployment mechanism which uses extracted jar files in folders called jarname.jar. The eclipse projects build directly into those folders.
However when adding these projects to a jboss launch configuration, which results in a jarname.jar folder (not file) to be part of the classpath, JBoss will fail because ExtensionValidator tries to treat the jarname.jar folder as a file.
ExtensionValidator only checks if a java.io.File endsWith(".jar") but it fails to check if it is an actual file, not a directory.
I attached a proposed fix (I only added the !item.isDirectory() and !files[i].isDirectory() )
I ran into other JBoss problems after fixing this which means that this does not really affect me. It may not be popular to name directories something.jar but in the cases of exploded deployment this seems normal. In any case my patch does not affect the normal usage of actual .jar files so I see no reason not to include it.
Reopened due to additional problems with directories called somename.jar I have fixed trunk and proposed the same fix for 6.0.x based on your patch. Many thanks. This has been fixed in 6.0.21 and will be included in 6.0.21 onwards. Thanks again for the patch. |