aspose file tools*
The moose likes JSP and the fly likes Has anyone seen this error before?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Has anyone seen this error before??" Watch "Has anyone seen this error before??" New topic
Author

Has anyone seen this error before??

Rich Barry
Greenhorn

Joined: Jan 28, 2002
Posts: 19
org.apache.jasper.JasperException: Unable to compile class for JSPerror: An exception has occurred in the compiler; please file a bug report (http://java.sun.com/cgi-bin/bugreport.cgi).
1 error
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040
yup, I have seen it. Just that your CLASSPATH doesn't have Jasper in it or something like that.
What are you trying to do exactly.
regds.
- madhav


Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
Rich Barry
Greenhorn

Joined: Jan 28, 2002
Posts: 19
I am just trying to run my jsp page.... it hits and database.. nothing special...
Here is my code....
<%@ page language="java" contentType="text/html" %>
<%@ page import="java.sql.*" %>
<%@ page import="forum.DataAccess" %>
<%@ page import="forum.areaformat" %>
<%
// Request the information from the url
String catid = request.getParameter("catid");
String threadid = request.getParameter("threadid");
// Create a new istance of the areaformat class
areaformat a = new areaformat();
// Create a new instance of the DataAccess Class
DataAccess d = new DataAccess("/home/richardb/webroot/WEB-INF/classes/forum/");
// This call the database connection method from the DataAccess Class
d.ConnectDatabase();
/* This gets the threads messages from database */
// This is initilzing the variables
String threadname = "";
String threadmessage = "";
String threaddate = "";
String threadhandle = "";
String threadrole = "";
String replyhandle = "";
String replyrole = "";
String replymessage = "";
String replydate = "";
int readonly = 0;
// This sets the sql variable to nothing
String sql = "";
// This sets the rs variable to null
ResultSet rs = null;
// This is doing a SELECT on the thread table based on the category id
sql += "select c.fc_readonly, p.fp_handle, p.fp_role, t.ft_threadmessage, t.ft_profileid, t.ft_threaddate, t.ft_threadname from forum_threads t, forum_profile p, forum_categories c where c.fc_catid = t.ft_catid and t.ft_profileid = p.fp_profileid and ft_catid = '" + catid + "' and ft_threadid = '" + threadid + "'";
//sql += "select * from forum_threads";
rs = d.SQLQuery(sql);
/* End of thread messages */

while (rs.next()){
readonly = rs.getInt("fc_readonly");
threadhandle = rs.getString("fp_handle");
threadrole = rs.getString("fp_role");
threadmessage = rs.getString("ft_threadmessage");
threaddate = rs.getString("ft_threaddate");
threadname = rs.getString("ft_threadname");
}
rs.close();
// This gets the current url
String url1 = "";
String servername1 = request.getServerName();
int serverport1 = request.getServerPort();
String uri1= request.getRequestURI();
String query = request.getQueryString();
url1 += "http://";
url1 += servername1;
url1 += ":";
url1 += serverport1;
url1 += uri1;
url1 += "?";
url1 += query;
%>
<html>
<head>
<title>Geomatics Canada Forums</title>
<!--- This calls the style sheet --->
<%@ include file="template/style.css" %>
</head>
<body>
<table cellpadding="0" cellspacing="1" border="0" width="700" align="center">
<tr>
<td>
<!--- This calls the forum logo --->
<%@ include file="template/forum_logo.jsp" %>
</td>
<td valign="bottom" align="right">
<!--- This calls the forum logo --->
<%@ include file="template/header_view.jsp" %>
</td>
</tr>
<tr>
<td colspan="2">
<table cellpadding="0" cellspacing="1" border="0" width="700">
<tr>
<td class="tablefunctions" width="100" height="40">
Author
</td>
<td class="tablefunctions" width="600">
<font class="smalltext">Thread Message for:</font> <i><%= threadname %></i>
</td>
</tr>

</table>
</td>
</tr>
<tr>
<td colspan="2">
<table cellpadding="2" cellspacing="1" border="0" width="700">
<tr>
<td class="tablerows" width="100" align="center" valign="top">
<br>
<%= threadhandle %>
<br><br>
<%= threadrole %>
<br><br>
</td>
<td class="tablerows" width="600" valign="top">
<font class="smalltext"><%= threaddate %></font>
<br><br>
<%= a.replace(threadmessage, '\n', "<BR>") %>
                                                                                                                  <% if (readonly == 0){ %><font class="smalltext"><a href="forum_messagepost.jsp?catid=<%= catid %>&threadid=<%= threadid %>">Reply</a></font><% } %>
</td>
</tr>
<%
sql = "select p.fp_handle, p.fp_role, m.fm_messagetext, m.fm_messagedate from forum_messages m, forum_profile p where p.fp_profileid = m.fm_profileid and fm_catid = '" + catid + "' and fm_threadid = '" + threadid + "' order by fm_messagedate asc ";
rs = d.SQLQuery(sql);
while (rs.next())
{
replyhandle = rs.getString("fp_handle");
replyrole = rs.getString("fp_role");
replymessage = rs.getString("fm_messagetext");
replydate = rs.getString("fm_messagedate");
%>
<tr>
<td class="tablerows" width="100" align="center" valign="top">
<br>
<%= replyhandle %>
<br><br>
<%= replyrole %>
<br><br>
</td>
<td class="tablerows" width="600" valign="top">
<font class="smalltext"><%= replydate %></font>
<br><br>
<%= a.replace(replymessage, '\n', "<BR>") %>
<br><br>
                                                                                                                  <font class="smalltext"><a href="forum_messagepost.jsp?catid=<%= catid %>&threadid=<%= threadid %>">Reply</a></font>
</td>
</tr>
<%
}
rs.close();
%>
</table>
</td>
</tr>
</table>
</body>
</html>
Rich Barry
Greenhorn

Joined: Jan 28, 2002
Posts: 19
I checked my class path.. and jasper.jar is in my classpath...
Guy Allard
Ranch Hand

Joined: Nov 24, 2000
Posts: 776
Rich - The runtime classpath will in general not be the same as it is when you 'start' Tomcat.
You can stick code like the following in to a servlet and display what the JSP compile/run time class path is.

HTH, Guy
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040
There's a lot of Java in there...
Couple of things I would do to simplify:
1. Break down your SQL stmt into smaller pieces.
2. Verify all the " ' openings and closings. I tried to follow them, but couldn't locate any mismatches. Take a closer look at the SQL stmt though.
3. Its not a good idea to access files under the WEB-INF folder with the foll. stmt.
// Create a new instance of the DataAccess Class
DataAccess d = new DataAccess("/home/richardb/webroot/WEB-INF/classes/forum/");
Though it may be okay for your application, you might want to reconsider this.
4. Watch all the <% and %> closely for any mismatches.
5. CLASSPATH was an issue for one of my app. Jasper errors could also be due to mismatching <%'s.
regds.
- madhav
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Has anyone seen this error before??