aspose file tools*
The moose likes JSP and the fly likes ClassNotFoundException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "ClassNotFoundException" Watch "ClassNotFoundException" New topic
Author

ClassNotFoundException

Jeremiah Elliott
Greenhorn

Joined: Nov 01, 2001
Posts: 17
I am a complete newby to java, and Tomcat, so this may be a very stupid mistake, but I have been trying to get this working for several days, and I am having no luck. I have seen several posts where someone has had the same symptoms as this, but none of their fixes have solved this problem.
I am running Tomcat 4 on redhat7.1
The error message that I am getting is
Root Cause:
java.lang.ClassNotFoundException: ConnectionBean
ConnectionBean.class is in .../jakarta-tomcat-4.0/webapps/abhome/WEB-INF/classes/com/artco/
the jsp code is:
<%@ page import="java.sql.*, com.artco.*" %>
<jsp:useBean id="con" class="ConnectionBean" />
<html>
<body>
Jeremiah's Bean Tester
<%
String sql = "Select * from DealerUsage";
ResultSet results = con.executeQuery(sql);
%>
<%=results.getString("UserName")%>
<hr>
</body>
</html>

I can post the ConnectionBean.java If it would help, But I think it is either a problem with the classpath or the jsp code.

Here is part of the /etc/bashrc file
JDK_HOME=/usr/local/java/jdk1.3.1_01/
JAVA_HOME=/usr/local/java/jdk1.3.1_01/
J2EE_HOME=/usr/local/java/j2sdkee1.3/
JAKARTA_HOME=/usr/local/java/jakarta-tomcat-4.0/
ANT_HOME=/usr/share/ant/bin/
TOMCAT_HOME=$JAKARTA_HOME/bin/
J2EE_CLASSPATH=/usr/local/java/j2sdkee1.3/lib/
PATH="$PATH:$JAVA_HOME/bin:$J2EE_HOME/bin:."
CLASSPATH="$JAKARTA_HOME/common/lib/servlet.jar"
CLASSPATH="$CLASSPATH:$JAKARTA_HOME/webapps/abhome/WEB-INF/classes/"
CLASSPATH="$CLASSPATH:$JAVA_HOME/lib/tools.jar:$ANT_HOME/lib/ant.jar"
CLASSPATH="$CLASSPATH:$J2EE_HOME/lib/j2ee.jar"
CLASSPATH="$CLASSPATH:$JAVA_HOME/lib:."
export J2EE_HOME JAVA_HOME JAKARTA_HOME ANT_HOME PATH TOMCAT_HOME J2EE_CLASSPATH JDK_HOME CLASSPATH
thanks in advance, JE
[This message has been edited by Jeremiah Elliott (edited November 01, 2001).]
sandeep balyan
Ranch Hand

Joined: Jul 25, 2001
Posts: 134
Sir
same problem I got..
I made it by..
Just putting the bean in the folder ..till where path is set for server to pick up file..mean
bean /mybean
folder bean and inside that folder mybean
right from the folder till where path u set in u r server ..
just try it
sandeep

Want to do something great will do one day
Jeremiah Elliott
Greenhorn

Joined: Nov 01, 2001
Posts: 17
Thanks for the help.
I added the bean directory in the classes directory, I got a different error message, so I re compiled the class file changing the first line (package bean.com.artco; ) Then I changed the import statement in the .jsp file to read
<%@ page import=�java.sql.*, bean.com.artco.*� %>
Any way I am back to where I was, with the same error message. I am not sure why but I think it is something in the classpath. Do I need to have the classpath pointing to the WEB_INF/classpath directory? If I take it out nothing changes.
like I said before, I would be happy to post the ConnectionBean.java file if it would help.
Thanks in advance,
Jeremiah
[This message has been edited by Jeremiah Elliott (edited November 02, 2001).]
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

I think it's in your jsp useBean tag?

try: < jsp:useBean id="con" class="bean.com.artco.ConnectionBean" />
Jeremiah Elliott
Greenhorn

Joined: Nov 01, 2001
Posts: 17
Thanks!! I am now getting a invalid cursor operation for my JDBC, but I think I can figure that out.
Jeremiah Elliott
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ClassNotFoundException