DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39093>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39093

           Summary: Tomcat messes up when a class has the same name as a
                    package
           Product: Tomcat 5
           Version: 5.5.16
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: major
          Priority: P2
         Component: Servlet & JSP API
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: [EMAIL PROTECTED]


I've found something that appears to be a bug in TC 5.5.16 . After a small 
check, it however, also occured in TC 5.5.15, so it might even be older.
Tomcat 4.0.6 (using JDK 1.4), however, did *not* have this problem.

I've got the following class/package structure:

1: nl.hhv.merlin.gui.editor.EditButtons
2: nl.hhv.merlin.gui.Editor
3: nl.hhv.merlin.gui.editor2.EditButtons

Note that packagename of the first class is equal to the fully qualified
name of the second class (except for caps/nocaps). This should be no problem
right?!? At least it never was until now.

Now I have a JSP that simply does:

<%
  nl.hhv.merlin.gui.editor.EditButtons buttons = null;
%>

Eclipse has no problems with this JSP, and happily accepts it, why shouldn't
it? Looks fine to me to :-) But Tomcat 5.5.16 gives me the following error:

  Generated servlet error:
  nl.hhv.merlin.gui.editor cannot be resolved to a type

When I change my JSP to:

<%
  nl.hhv.merlin.gui.editor2.EditButtons buttons = null;
%>

Tomcat compiles the JSP without any problems. Note that the 2nd EditButtons
class is an EXACT copy of the first.

I've tried to reproduce the same issue with different class and package-names, 
but then it seems to work!?!?

Anyway, I've attached a small ZIP which can be unpacked into the TC webapps 
dir, to try this out yourselves. It also contains the Java sources. Check out 
the remarks in index.jsp for more weirdness :-)

The provided class files have been compiled using Eclipse 3.1.2 (so not the JDK 
compiler). I'm running TC on Java 1.5.0_06.

Kind regards,
Paul Hamer

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to