CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> Java

 ClassNotFoundException: com.mysql.jdbc.Driver

Print topic Send  topic

Author Message
chaser

Posts: 1
Posted: 12/05/2005, 9:11 AM

Dear all,

I am moving my web application fro XP to Linux platform. Now I have a few questions for that;

First, the system in Linux. I have tomcat, jdk as the follows:

/usr/jdk/j2sdk1.4.2_06

/export/home/dfflab/jakarta-tomcat-4.1.31

When I first tried to recompile my java classes, it said:

javac *.java   
SeahorseAction.java:3: package javax.servlet.http does not exist  
import javax.servlet.http.*;  
^  
SeahorseAction.java:4: package org.apache.struts.action does not exist  
import org.apache.struts.action.*;  
^  
SeahorseAction.java:5: package org.apache.struts.action does not exist  
import org.apache.struts.action.ActionForward;  
                                ^  
SeahorseAction.java:14: cannot find symbol  
symbol: class Action  
public class SeahorseAction extends Action {  
                                    ^  
SeahorseAction.java:15: cannot find symbol  
symbol  : class ActionMapping  
location: class coreservlets.SeahorseAction  
    public ActionForward execute(ActionMapping mapping,  
                                 ^  
SeahorseAction.java:16: cannot find symbol  
symbol  : class ActionForm  
location: class coreservlets.SeahorseAction  
                                ActionForm form,  
                                ^  
SeahorseAction.java:17: cannot find symbol  
symbol  : class HttpServletRequest  
location: class coreservlets.SeahorseAction  
                                HttpServletRequest request,  
                                ^  
SeahorseAction.java:18: cannot find symbol  
symbol  : class HttpServletResponse  
location: class coreservlets.SeahorseAction  
                                HttpServletResponse response)  
                                ^  
SeahorseAction.java:15: cannot find symbol  
symbol  : class ActionForward  
location: class coreservlets.SeahorseAction  
    public ActionForward execute(ActionMapping mapping,  
           ^  
SeahorseFormBean.java:3: package org.apache.struts.action does not exist  
import org.apache.struts.action.*;  
^  
SeahorseFormBean.java:5: cannot find symbol  
symbol: class ActionForm  
public class SeahorseFormBean extends ActionForm {  
                                      ^  
SeahorseAction.java:27: cannot find symbol  
symbol  : class HttpSession  
location: class coreservlets.SeahorseAction  
         HttpSession session = request.getSession();

Do I need install something else? Do I need to install apache in Linux? ( I just installed Tomcat in XP box and my application works.) The PATH from 'export' coomand is like this:

declare -x PATH="/dfflab/jakarta-tomcat-4.1.31/bin:/export/home/dfflab/jakarta-tomcat-4.1.31/common/lib/servlet.jar:/export/home/dfflab/jakarta-tomcat-4.1.31/common/lib/struts.jar:/export/home/dfflab/jakarta-tomcat-4.1.31/common/lib/mysql-connector-java-3.0.14-production-bin.jar"

2) To get around these compile errors, I first change my java code in XP sso the URL for the database points to the new location and compiled, then I just copy those classes into the Linux box. But when I run it, it said:

ClassNotFoundException: com.mysql.jdbc.Driver

So I guess I need to put the "mysql-connector-java-3.0.14-production-bin.jar" in another place. As you see, previously in XP box I put it in the "WEB-INF/lib/" directory of the web application. That works in XP box.

I got no clue what to do. Please help!

P.S. I do some search and one post said if I put the "mysql-connector-java-3.0.14-production-bin.jar" in the 'jre/lib/ext' of the jdk directory, it would solve this issue. But I don't have the permission to copy to that directory.

I also put the mysql-connector-java-3.0.14-production-bin.jar in the "WEB-INF/lib" directory of the web application and I think that should be the standard way to put any reources (jar, zip files) for your application.

Thanks.
View profile  Send private message
vidyasagar

Posts: 7
Posted: 12/11/2005, 10:22 PM

Hi,

set the CLASSPATH of all '.jar' files (which files to need to compile/run the program) at the command line. ex: servlet.jar,struts.jar,etc.,
and copy the Struts.jar file to the WEB-INF/lib directory of the web application for runtime.
_________________
Thank you.
vidya sagar
View profile  Send private message
X.Chen
Posted: 12/12/2005, 5:26 AM

Hi, Vidya

Thanks for your reply. I already got it after 'exporting' those jar files in the 'CLASSPATH'.

X.Chen

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.