We have a large installation of web applications using Apache / Tomcat / Jasper and jboss. In a development environment, JSPs are built on the fly. Unfortunately, there is one package, in particular, that on-the-fly compilation cannot be imported. For some classes, the use of fully qualified references, not import works, but not for all. All classes in question are in the same bank (nonEjb.jar). JSP pre-compilation works great, but of course it is very painful to do this every time we need to change one of the affected files. This problem has existed for quite some time, and I would really like to solve it, since I am set to do some work in the affected area.
Here is a small test page. It is not suitable for the first import. The two imported classes are very similar, the only significant difference is their placement of packages. (And yes, I checked that the package declarations are correct for both classes.)
<%@ page contentType="text/html; charset=utf-8" %>
<%@ page errorPage="/error.jsp" %>
<%@ page import="com.elementk.lms.product.otr.OtrProviderType" %>
<%@ page import="com.elementk.lms.product.course.CourseType" %>
<html>
<body>
<hr>
Displaying the page...
<br>
<%= OtrProviderType.B24x7_PROVIDER.getId() %> value
<br>
<%= CourseType.SELF_STUDY.getId() %> value
</hr>
</body>
<html>
Result:
09 Mar 2010 21:29:40,555 ERROR [K] [RequestTimingFilter.doFilter:65] Unable to compile class for JSP:
An error occurred at line: 6 in the generated java file
The import com.elementk.lms.product.otr cannot be resolved
I get the same error if I remove the import and fully qualify the link (like com.elementk.lms.product.org.OtrProviderType).
What can cause the JSP compiler to find one of the classes, but not the other?
source
share