Bug 46462 - JSPWiki JSP compilation prevented by org.apache.jasper.Constants.JSP_PACKAGE_NAME
Summary: JSPWiki JSP compilation prevented by org.apache.jasper.Constants.JSP_PACKAGE_...
Alias: None
Product: Tomcat 6
Classification: Unclassified
Component: Jasper (show other bugs)
Version: 6.0.18
Hardware: Macintosh Mac OS X 10.4
: P2 major (vote)
Target Milestone: default
Assignee: Tomcat Developers Mailing List
URL: https://issues.apache.org/jira/browse...
Depends on:
Reported: 2009-01-01 20:29 UTC by Andrew Jaquith
Modified: 2009-01-14 16:22 UTC (History)
2 users (show)


Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Jaquith 2009-01-01 20:29:15 UTC

JSPWiki is currently an Incubator project at Apache. We intend to use the package name org.apache.jspwiki. However, any classes in this package tree fail to load when imported into a JSP page, specifically during Jasper's attempt to compile it.

For example, 

<%@ page import="org.apache.jspwiki.WikiPage" %>
does not compile. My colleague Harry Metske traced the cause to this line in org.apache.jasper.servlet.JasperLoader:

        if( !name.startsWith(Constants.JSP_PACKAGE_NAME) ) {
            // Class is not in org.apache.jsp, therefore, have our
            // parent load it
            clazz = parent.loadClass(name);            
            if( resolve )
            return clazz;

The recommended bug fix would be to append a period (".") to the expression passed into name.startsWith(), which in this case would then evaluate to "org.apache.jsp.", and allow JSPWiki classes to load and compile.

This issue is important for us as we emerge from incubation. Lack of a fix means that JSPWiki cannot release under the desired package name "org.apache.jspwiki."

See additional commentary in the Apache JIRA database here: 
Comment 1 Mark Thomas 2009-01-02 03:10:31 UTC
This has been fixed in trunk and proposed for 6.0.x. providing it gets two more +1 votes it will be included in 6.0.19 onwards.
Comment 2 metskem 2009-01-02 03:52:38 UTC
I created a new separate JIRA issue for JSPWiki:

Comment 3 Mark Thomas 2009-01-14 16:22:56 UTC
This has been fixed in 6.0.x and will be included in 6.0.19 onwards.