https://issues.apache.org/bugzilla/show_bug.cgi?id=47323
Summary: Name clash: o.a.c.Manager class vs. o.a.c.manager package when compiling JSP Product: Tomcat 6 Version: 6.0.20 Platform: PC OS/Version: Windows XP Status: NEW Severity: minor Priority: P2 Component: Jasper AssignedTo: dev@tomcat.apache.org ReportedBy: knst.koli...@gmail.com The following issue is specific to MS Windows, where file system is case-insensitive, and it does not occur when the classes are inside a jar file (catalina.jar). I observed it in development environment, when trying to run Tomcat from its compiled sources without building a distributive. Steps to reproduce this issue with TC 6.0.20: ---------------------------------------------- 1. Get and unpack apache-tomcat-6.0.20.zip 2. In ${catalina.home}/lib folder unpack all classes from catalina.jar. Remove catalina.jar or rename it e.g. to catalina.ja_. 3. In ${catalina.home}/conf/tomcat-users.xml add a user with role "manager" 4. Launch Tomcat and login to the Manager application 5. On the page that lists the web applications, click on the count of sessions for the manager webapp, i.e. access the following URL: http://localhost:8080/manager/html/sessions?path=/manager 6. Expected result: Showing a list of sessions for the web app. Actual result: --------- FAIL - Encountered exception org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 8 in the generated java file The import org.apache.catalina.manager cannot be resolved --------- The issue is reproducible if the compiler is replaced with the latest one from eclipse-JDT-SDK-3.5RC3.zip of 200905282000. I cannot reproduce the issue independently when editing files in Eclipse IDE, so it is like it does not affect Eclipse users. I was looking in the code where Jasper calls the JDT compiler, and found the following, in method generateClass(String[]) of o.a.j.compiler.JDTCompiler: final INameEnvironment env = new INameEnvironment() { (..) private boolean isPackage(String result) { if (result.equals(targetClassName)) { return false; } String resourceName = result.replace('.', '/') + ".class"; InputStream is = classLoader.getResourceAsStream(resourceName); return is == null; } } The isPackage() method will provide false negative for "o.a.c.manager" package, because an attempt to read "o.a.c.manager.class" file will result in reading the "Manager.class" file and will be successful. I thought of proposing to rename either the class or the package, but it is not feasible, as there are a lot of other subpackages with similar name clashes in o.a.catalina: authenticator, realm, loader, session. :/ The workaround for this issue is to pack clashing classes into a jar file, or to use a different OS. -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org