tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 34587] New: - JDTCompiler can not resolve package org.foo when class org.Foo exists
Date Fri, 22 Apr 2005 21:16:36 GMT
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=34587>.
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=34587

           Summary: JDTCompiler can not resolve package org.foo when class
                    org.Foo exists
           Product: Tomcat 5
           Version: 5.5.9
          Platform: All
        OS/Version: Windows XP
            Status: NEW
          Severity: blocker
          Priority: P2
         Component: Jasper
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: apachebugzilla@waltersson.com


The following JSP page will not compile:

<%@page import="org.Foo"%>
<%@page import="org.foo.Bar"%>
<html>
</html>

Error page says:

org.apache.jasper.JasperException: Unable to compile class for JSP

Generated servlet error:
The import com.foo cannot be resolved


	org.apache.jasper.compiler.DefaultErrorHandler.javacError
(DefaultErrorHandler.java:84)
	org.apache.jasper.compiler.ErrorDispatcher.javacError
(ErrorDispatcher.java:328)
	org.apache.jasper.compiler.JDTCompiler.generateClass
(JDTCompiler.java:397)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:288)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
	org.apache.jasper.JspCompilationContext.compile
(JspCompilationContext.java:556)
	org.apache.jasper.servlet.JspServletWrapper.service
(JspServletWrapper.java:293)
	org.apache.jasper.servlet.JspServlet.serviceJspFile
(JspServlet.java:291)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

To me, the problem root seems to be this method from JDTCompiler.java:

private boolean isPackage(String result) {
    if (result.equals(targetClassName)) {
        return false;
    }
    String resourceName = result.replace('.', '/') + ".class";
    InputStream is = 
        classLoader.getResourceAsStream(resourceName);
    return is == null;
}

This code obviously will return false for the org.foo package although it does 
exist just because there is a class named Foo in the org package.

-- 
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: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message