• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Has anyone seen this error before??

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Rich Barry
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I checked my class path.. and jasper.jar is in my classpath...
 
Ranch Hand
Posts: 776
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic