Mm.mysql Driver problems

Im trying to get Tomcat to function with mysql database.
I am using Tomcat 4.0.
I recieve this error when trying to connect to mysql:
javax.servlet.ServletException: org.gjt.mm.mysql.Driver
java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver
I have a classpath setting of:
C:\jdk\lib\mysql.jar
I dont know why it is not finding the class... Maybe its a problem with Tomcat 4.0??

Jim
Here is code I use to connect:
context = Server.getContext();
     try {
     String dbName = context.getInitParameter("DbName");
     String dbUsr = context.getInitParameter("DbUserName");
     String dbPwd = context.getInitParameter("DbUserPwd");
     String conStr = "jdbc:mysql://localhost/" + dbName + "?user=" + dbUsr + "&password=" + dbPwd;
     Class.forName("org.gjt.mm.mysql.Driver").newInstance();
     dbCon = DriverManager.getConnection(conStr);
     } catch (Exception ex) {
Server.logErr("DBManager: failed to init connection",ex);
throw ex;
I am using Tomcat 3.2.1 with mm.mysql 2.0.4 and it all seems to work fine.
Hope this helps
Regards
David

Similar Messages

  • Tomcat problem finding MySQL driver when context used

    Hi all.
    I have a context set in tomcat3.3 which allows me to run JSPs saved in TOMCAT_HOME/webapps/examples/jsp from /luc.
    Initially, I had problems using beans when I used the context (the whole thing works ok when I just enter the actual path in the URL).
    I solved that by adding the ...WEB-INF/classes directories to my CLASSPATH. But now that the beans are found, Tomcat is giving errors regarding the mySQL driver I'm using, which is mm-mysql-2.0.11.
    The error is:
    Error: 500
    Location: /luc/validateLogin.jsp
    Internal Servlet Error:
    javax.servlet.ServletException:
         at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:460)
         at validateLogin_1._jspService(validateLogin_1.java:139)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java)
         at org.apache.tomcat.facade.ServletHandler.doService(ServletHandler.java:574)
         at org.apache.tomcat.core.Handler.invoke(Handler.java:322)
         at org.apache.tomcat.core.Handler.service(Handler.java:235)
         at org.apache.tomcat.facade.ServletHandler.service(ServletHandler.java:485)
         at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:917)
         at org.apache.tomcat.core.ContextManager.service(ContextManager.java:833)
         at org.apache.tomcat.modules.server.Http10Interceptor.processConnection(Http10Interceptor.java:176)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:494)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:516)
         at java.lang.Thread.run(Thread.java:484)
    Root cause:
    java.lang.NullPointerException:
         at customerProfile.customerProfileBean.validateUser(customerProfileBean.java:135)
         at validateLogin_1._jspService(validateLogin_1.java:98)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java)
         at org.apache.tomcat.facade.ServletHandler.doService(ServletHandler.java:574)
         at org.apache.tomcat.core.Handler.invoke(Handler.java:322)
         at org.apache.tomcat.core.Handler.service(Handler.java:235)
         at org.apache.tomcat.facade.ServletHandler.service(ServletHandler.java:485)
         at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:917)
         at org.apache.tomcat.core.ContextManager.service(ContextManager.java:833)
         at org.apache.tomcat.modules.server.Http10Interceptor.processConnection(Http10Interceptor.java:176)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:494)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:516)
         at java.lang.Thread.run(Thread.java:484)
    And I've outputted the the following stuff:
    Unable to load driver java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver
    java.sql.SQLException: No suitable driver
    Remember, this all works fine when I don't use the context.
    In my CLASSPATH, I point to the JAR file:
    /usr/local/jdk1.3.1/lib/mm.mysql-2.0.11/mm.mysql-2.0.11-bin.jar
    Any ideas?

    try moving the mm.mysql-2.0.11-bin.jar file to %TOMCAT_HOME%/common/lib. This should make the classes available to all contexts.

  • Problem with a j2se program and mysql driver

    Hi,
    We are developing an application which needs accessing to a mysql database. I have packed the application in a .jar. and inside the jar I have created a folder lib. And inside that folder I have put mysql driver.
    As the same way, I have been reading in SDN forum, I have edited manifiest file and I have writen this:
    Manifest-Version: 1.0
    Sealed: true
    Class-Path: lib/mysql-connector-java-5.0.4-bin.jar
    Main-Class: package1.Main
    When I introduce this command java -jar program1.jar, the jvm says this:
    java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:164)
    I know when I use java -jar, classpath system variable doesn't mind. But even this variable is set up properly. If you could help me it would be great. I'm getting stuck with this.
    Thanks in advance.

    @CiMaBuE wrote:
    Hi,
    We are developing an application which needs accessing to a mysql database. I have packed the application in a .jar. and inside the jar I have created a folder lib. And inside that folder I have put mysql driver.That's the problem. JARs don't look inside themselves for 3rd party JARs. That /lib directory needs to be relative to the program1.jar that you created.
    I believe modules or OSGi are supposed to address this, but executable JARs do not today.
    %

  • JSP Mysql Connection Problem

    Hi Friend,
    I am facing some problem in connecting mysql with jsp .
    When I try and connect to mysql with the following connection string
    Class.forName("org.gjt.mm.mysql.Driver").newInstance();
    Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/testdhiraj?user=root&password=dh");
    Statement statement     = con.createStatement();
    I get an error :
    java.sql.SQLException: Communication link failure: Bad handshake
    I don't know what is wrong,
    as I had tested mysql using telnet and it connects and executes sql nicely.
    Waiting for ur reply,
    Dhiraj Agrawal
    mail to : [email protected]

    Hi,
    You need to make sure that , you have given correct database name, user id and password in the connection url. and also check the jdbc driver is loaded properly. If your mysql is running in the standard port, you need not give the port as 3306.
    Here is the example :
    import java.sql.*;
         Notice, do not import org.gjt.mm.mysql.*
    or you will have problems!
    public class XampleClass
    public static void main(String[] Args)
    try {      
    Class.forName("org.gjt.mm.mysql.Driver").newInstance();
    catch (Exception e) {
    System.err.println("exception while loading
    driver.");
    e.printStackTrace();
    try {
    Connection C = DriverManager.getConnection(
    "jdbc:mysql://localhost/test?user=myuser&password=mypwddb");
    // Do something with the Connection
    catch (SQLException e) {
    System.out.println("Exception: " + e);
    This is the format for conenction url :
    jdbc:mysql://[hostname][:port]/dbname[?param1=value1][&param2=value2]...
    Hope this helps you.
    Thanks,
    Senthil_Slash

  • How to import MySQL Driver in Jbuilder

    I am creating a GUI application using swing with the help of JBuilder. I have used MySQL as Database. For connection it to java I've used MySQL J-Connector Driver. But I am not being able to import that driver(classes) in jbuilder.
    When i run the application at the cmd prompt it works fine (got connected), but when i try to run it under jbuilder it gives error like
    java.com.mysql.Driver class not found.
    I think it is classpath problem
    Please help me, setting this problem

    No, you need not import class as you give qualified
    class name in Class.forName(). Better post your code
    here. Somebody will help you out.Below is the code of CLASS CreateConnection, I'm using to create connection to MySQL. I instantiate this class and use the connection. This class is being called when a connection to database is required. I am creating a desktop application using swing.
    package project1;
    import java.sql.*;
    public class CreateConnection {
         private String host,database,username,password;
         String db_string;
         Connection conn;
         Statement smt;
         ResultSet rs;
    //Parameterized constructor
         CreateConnection(String host, String database, String username, String password){
              this.host=host;
              this.database=database;
              this.username=username;
              this.password=password;
    db_string="jdbc:mysql://"+host+"/"+database+"?user="+username+"&password="+password ;
    create();
    //Parameterized constructor 2
    CreateConnection(String db_string){
    this.db_string=db_string;
    create();
    public void create(){
              System.out.println("using: " +db_string);
              try{
                   System.out.println("Loading drivers........");
                   Class.forName("com.mysql.jdbc.Driver").newInstance();
                   System.out.println("Driver loaded !");
                   conn = DriverManager.getConnection(db_string);
                   smt = conn.createStatement();
                   System.out.println("testing database .........");
                   smt.execute("create table test(no varchar(22))");
              catch(Exception e){
                   System.out.println(e);
                   System.exit(0);
         System.out.println("Successfull");
    public ResultSet execute_q(String query){
              try{
                   System.out.println("Executing "+query);
                   rs=smt.executeQuery(query);
              catch(SQLException sqle){
                   System.out.println("Execption thrown" +sqle);
                   return null;
              return rs;
    }

  • J2EE RI and MySQL, JNDI problems

    Hi.
    I am trying to write a simple J2EE application that would use Entety EJB with bean persisatance. I have downloaded driver from the www.mysql.org, copied it to the lib/system directory and modified J2EE_CLASSPATH in bin/userconfig.bat. I am using reference implementation server and with deploytool in �tools/serverconfiguration/datasourses/standard� I am specifying driver: org.gjt.mm.mysql.Driver or com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource and in datasourses in JNDI Name I write �jdbc/mydb� and in JDBC URL �jdbc:mysql://localhost:3306/this�, problem comes up when I try to reference �jdbc/mydb� from an entity bean, during deployment process of application it says that it is not bound
    Binding name:`java:comp/env/jdbc\persondb`
    Warning: Reference reference java:comp/env/jdbc\persondb is using a JNDI name that is not bound: jdbc\mydb
    I do not get it, what I am doing wrong? Please help me to find out how to bind a JNDI name to MySQL

    Ive been playing with the J2EE RI server for a bit now..
    and dispite documentation to the contrary the latest RI DOES NOT use standard naming conventions when referencing jndi resources.
    ie:
    so if you trying to get : java:com/env/jdbc/persondb
    then try accessing it by
    jdbc/persondb
    omit the java:com/env/

  • The MySQL driver exception!!

    Hi guys, I got a problem with the MySQL driver. I have installed the MySQL connector to classpath. Then I wrote a test program to test if the driver is working well. This test program showed very thing is working well. This test program can connect the database and pick up data from there.However, when I wrote another program that must be using MySQL, the exception "com.mysql.jdbc.Driver" occured. That looked like the MySQL driver has not been installed well or is not working well. But how this happened? How can I solve this problem???
    Thanks a lot.

    Hi,thanks a lot for ur reply.
    Another problem in this case is that, I have 2 computers running this "problem" program. Acturely, most of job have been done in 1st machine and this "problem" program works very well. Then for some reasons, I gotta move this "problem" program to 2nd machine. At first, I just move the .class file to 2nd machine, but it appears exception"com.mysql.jdbc.Driver". Then I move all the source code and compile it. It also appears the same exception. Does that mean the classpath in 2nd machine has some problems?
    Thanks for any reply.

  • [b][u]JSP create mysql DataBase problem[/u][/b]

    While i try to create mysql database through JSP program using query,
    the qurey statement doesn't work
    stmt.executeUpdate("create database employee;"); is not executing.
    The code is as follows : Please Help Me......
    try {
    Connection con = null;
    Class.forName("org.gjt.mm.mysql.Driver").newInstance();
    con=DriverManager.getConnection("jdbc:mysql://localhost:3306/bedrock","Dude1","");
    try {
    Statement stmt=con.createStatement();
    stmt.executeUpdate("create database employee;");
    System.out.println("Statement Executed");
    catch(Exception e) {
    System.out.println("Statement not Executed");
    catch (SQLException ex) {
    while (ex != null) {
    System.out.println("sql exception"+ex);
    ex = ex.getNextException ();
    " THANKS IN ADVANCE "

    It's not common to create databases with Java. I'd say this is especially true of JSPs. You'll have to GRANT permission to access and create tables to every single user that comes in? Are those tables cleaned up when users are done, or does the number of tables grow as the number of users grows? One table per customer? Sounds more like session or cookies to me. Do you validate users to make sure that only authorized users can create tables? Lots of problems, and it doesn't appear that you've addressed any of this from the code you've posted.
    It's a bad idea to have code like this in a JSP. Those are for view only. Better to put database code on the server side where it belongs.
    %

  • Kodo not recovering from bad connection in new MySQL driver

    Hi,
         I'm using kodo 2.4.1 and the latest stable MySQL driver 3.0.6. After
    leaving the application inactive for a few hours, the connection to
    mysql is no longer usable. This did not occur with MySQL version 2.0.14
    (as I believe Kodo weren't reusing the connections).
         Are there any properties that I could set, so Kodo can keep the
    connection active or recover from the problem?
    Makas

    Ok, thanks Marc, like I said though, I am now re-using MySQL 2.0.14
    driver. I'm not sure if I'm gaining any advantages with MySQL 3.0.6 anyway.
    But I'll probably upgrade it after the next Kodo is released.
    Makas
    Marc Prud'hommeaux wrote:
    Makas-
    Sorry ... I didn't test the property I sent. The problem is that our
    options parsing does not deal with spaces (this will be fixed in the
    next release).
    Instead of ValidateConnectionSQL="SELECT 1", you should be able to use
    ValidateConnectionSQL=SELECT(1), which does not contain spaces.
    In article <[email protected]>, Makas Tzavellas wrote:
    Marc,
    Using the properties you wrote, kodo doesn't seems to be able to parse
    it. I've also tried various other combinations with no success. I'm now
    going to use the older mysql driver.
    Marc Prud'hommeaux wrote:
    Makas-
    Kodo should be re-using the MySQL Connection in exactly the same way,
    regardless of the version. The problem is that it looks like MySQL people
    slipped in an "optimization" into 3.0.6 whereby Connection.isClosed()
    does not actually test the state of the Connection, but instead just
    returns true if and only if Connection.close() has been invoked.
    You can get around this by specifying some SQL to validate the
    Connections. The following property should do the trick:
    com.solarmetric.kodo.impl.jdbc.DictionaryProperties=\
    ValidateConnections=true \
    ValidateConnectionSQL="SELECT 1"
    Please let us know if the problem persists.
    In article <[email protected]>, Makas Tzavellas wrote:
    Hi Marc,
         Here're the stack trace of the exception and the kodo properties. There
    isn't any long running transaction. The application is basically left
    idle for some time and subsequent connections fails. It could be
    connections obtained from the pool, but I'm not sure.
         I will re-use mysql 2.0.14 for now. Please let me know if I'm missing
    any other properties or if you need more info.
    # Kodo JDO Properties configuration
    # To evaluate or purchase a license key, visit http://www.solarmetric.com
    com.solarmetric.kodo.CacheReferenceSize=1000
    com.solarmetric.kodo.ee.ManagedRuntimeProperties=TransactionManagerName=java:/TransactionManager
    javax.jdo.PersistenceManagerFactoryClass=com.solarmetric.kodo.impl.jdbc.JDBCPersistenceManagerFactory
    javax.jdo.option.ConnectionDriverName=org.gjt.mm.mysql.Driver
    javax.jdo.option.ConnectionUserName=
    javax.jdo.option.ConnectionPassword=
    javax.jdo.option.ConnectionURL=jdbc:mysql://hostname/database?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true
    javax.jdo.option.MinPool=0
    javax.jdo.option.MaxPool=20
    javax.jdo.option.Optimistic=true
    javax.jdo.option.RetainValues=true
    javax.jdo.option.NontransactionalRead=false
    com.solarmetric.kodo.impl.jdbc.ConnectionTestTimeout=10
    com.solarmetric.kodo.impl.jdbc.AutoReturnTimeout=10
    com.solarmetric.kodo.impl.jdbc.DictionaryClass=com.solarmetric.kodo.impl.jdbc.schema.dict.MySQLDictionary
    com.solarmetric.kodo.DataCacheProperties=Port=5555
    Addresses=repository2.kl.ewarna.com:5555;repository.kl.ewarna.com:5555
    CacheSize=5000
    com.solarmetric.kodo.DataCacheClass=com.ewarna.pdm.sessions.PDMCache
    =========== Stack Trace ================================
    Communication link failure: java.io.IOException [code=0;state=08S01]
    NestedThrowables:
    com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper:
    [SQL=SELECT t0.M_IDX, t3.JDOCLASSX, t3.JDOLOCKX, t3.M_CREATIONDATEX,
    t3.M_DELETEDDATEX, t3.M_HOSTADDRESSX, t3.M_LASTMODIFIEDDATEX,
    t3.M_NAMEX, t3.M_OLDIDX, t3.M_ID_M_OWNERX, t0.M_ID_M_ACCOUNTX,
    t0.M_FULLNAMEX, t0.M_PASSWORDX, t0.M_PASSWORDEXPIRYDATEX, t3.M_NAMEX
    >>>>FROM ABSTRACTENTITYX t2, ABSTRACTENTITYX t3, Accounts t1, Users t0 WHERE>>>>>>>((((((t2.M_NAMEX = 'development' AND t3.M_NAMEX = 'ewarna') AND>>>>(t3.M_DELETEDDATEX IS NULL)) AND (t2.M_DELETEDDATEX IS NULL)) AND>>>>(t3.M_DELETEDDATEX IS NULL)) AND t3.JDOCLASSX =>>>>'com.ewarna.pdm.entities.storage.UserPE') AND t0.M_IDX = t3.M_IDX AND>>>>t0.M_ID_M_ACCOUNTX = t1.M_IDX AND t1.M_IDX = t2.M_IDX) ORDER BY>>>>t3.M_NAMEX ASC
    [PRE=SELECT t0.M_IDX, t3.JDOCLASSX, t3.JDOLOCKX, t3.M_CREATIONDATEX,
    t3.M_DELETEDDATEX, t3.M_HOSTADDRESSX, t3.M_LASTMODIFIEDDATEX,
    t3.M_NAMEX, t3.M_OLDIDX, t3.M_ID_M_OWNERX, t0.M_ID_M_ACCOUNTX,
    t0.M_FULLNAMEX, t0.M_PASSWORDX, t0.M_PASSWORDEXPIRYDATEX, t3.M_NAMEX
    >>>>FROM ABSTRACTENTITYX t2, ABSTRACTENTITYX t3, Accounts t1, Users t0 WHERE>>>>>>>((((((t2.M_NAMEX = ? AND t3.M_NAMEX = ?) AND (t3.M_DELETEDDATEX IS>>>>NULL)) AND (t2.M_DELETEDDATEX IS NULL)) AND (t3.M_DELETEDDATEX IS NULL))>>>>AND t3.JDOCLASSX = ?) AND t0.M_IDX = t3.M_IDX AND t0.M_ID_M_ACCOUNTX =>>>>t1.M_IDX AND t1.M_IDX = t2.M_IDX) ORDER BY t3.M_NAMEX ASC
    Communication link failure: java.io.IOException
         at
    com.solarmetric.kodo.impl.jdbc.runtime.SQLExceptions.throwDataStore(SQLExceptions.java:23)
         at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.executeQuery(JDBCStoreManager.java:742)
         at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCQuery.executeQuery(JDBCQuery.java:92)
         at com.solarmetric.kodo.query.QueryImpl.executeWithMap(QueryImpl.java:792)
         at
    com.ewarna.pdm.sessions.BasicQuery.getByAdvancedFormula(BasicQuery.java:137)
         at
    com.ewarna.pdm.sessions.BasicQuery.getByAdvancedFormula(BasicQuery.java:65)
         at com.ewarna.pdm.sessions.BasicQuery.getByFormula(BasicQuery.java:205)
         at
    com.ewarna.handlers.storage.SessionHandler$1.execute(SessionHandler.java:116)
         at
    com.ewarna.pdm.sessions.JDOCallBackExecutor.execute(JDOCallBackExecutor.java:40)
         at
    com.ewarna.handlers.storage.SessionHandler.login(SessionHandler.java:140)
         at
    com.ewarna.pdm.soap.AbstractSoapService.login(AbstractSoapService.java:44)
         at
    com.ewarna.pdm.soap.xfs.SoapServiceXFSImpl.login(SoapServiceXFSImpl.java:1199)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at org.apache.soap.server.RPCRouter.invoke(RPCRouter.java:146)
         at
    org.apache.soap.providers.RPCJavaProvider.invoke(RPCJavaProvider.java:129)
         at
    org.apache.soap.server.http.RPCRouterServlet.doPost(RPCRouterServlet.java:354)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at
    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
         at
    org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at
    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at
    org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at
    org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2396)
         at
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at
    org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at
    org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at
    org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
         at
    org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at
    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at
    org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
         at
    org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)
         at
    org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:380)
         at
    org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
         at
    org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)
         at java.lang.Thread.run(Thread.java:536)
    NestedThrowablesStackTrace:
    java.sql.SQLException: Communication link failure: java.io.IOException
         at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1606)
         at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:886)
         at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:945)
         at com.mysql.jdbc.Connection.execSQL(Connection.java:1809)
         at
    com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1458)
         at
    com.solarmetric.datasource.PreparedStatementWrapper.executeQuery(PreparedStatementWrapper.java:93)
         at
    com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executePreparedQueryInternal(SQLExecutionManagerImpl.java:769)
         at
    com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executeQueryInternal(SQLExecutionManagerImpl.java:692)
         at
    com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executeQuery(SQLExecutionManagerImpl.java:373)
         at
    com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executeQuery(SQLExecutionManagerImpl.java:357)
         at
    com.solarmetric.kodo.impl.jdbc.ormapping.ClassMapping.selectPrimaryMappings(ClassMapping.java:1221)
         at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.executeQuery(JDBCStoreManager.java:717)
         at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCQuery.executeQuery(JDBCQuery.java:92)
         at com.solarmetric.kodo.query.QueryImpl.executeWithMap(QueryImpl.java:792)
         at
    com.ewarna.pdm.sessions.BasicQuery.getByAdvancedFormula(BasicQuery.java:137)
         at
    com.ewarna.pdm.sessions.BasicQuery.getByAdvancedFormula(BasicQuery.java:65)
         at com.ewarna.pdm.sessions.BasicQuery.getByFormula(BasicQuery.java:205)
         at
    com.ewarna.handlers.storage.SessionHandler$1.execute(SessionHandler.java:116)
         at
    com.ewarna.pdm.sessions.JDOCallBackExecutor.execute(JDOCallBackExecutor.java:40)
         at
    com.ewarna.handlers.storage.SessionHandler.login(SessionHandler.java:140)
         at
    com.ewarna.pdm.soap.AbstractSoapService.login(AbstractSoapService.java:44)
         at
    com.ewarna.pdm.soap.xfs.SoapServiceXFSImpl.login(SoapServiceXFSImpl.java:1199)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at org.apache.soap.server.RPCRouter.invoke(RPCRouter.java:146)
         at
    org.apache.soap.providers.RPCJavaProvider.invoke(RPCJavaProvider.java:129)
         at
    org.apache.soap.server.http.RPCRouterServlet.doPost(RPCRouterServlet.java:354)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at
    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
         at
    org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at
    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at
    org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at
    org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2396)
         at
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at
    org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at
    org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at
    org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
         at
    org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at
    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at
    org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
         at
    org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)
         at
    org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:380)
         at
    org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
         at
    org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)
         at java.lang.Thread.run(Thread.java:536)
    Marc Prud'hommeaux wrote:
    Makas-
    Is Kodo idle during a long-running transaction, or does the error occur
    when a new Connection is allocated? If the former, then there is nothing
    we can do: MySQL shouldn't be dropping an open Connection while a
    transaction is active. If the latter, then the property
    com.solarmetric.kodo.impl.jdbc.ConnectionTestTimeout specified the
    number of seconds between which the connection should be tested for
    valididty when removed from the pool.
    See also:
    http://docs.solarmetric.com/manual.html#com.solarmetric.kodo.impl.jdbc.ConnectionTestTimeout
    If this does not help, can you let us know your properties and some
    details about your application?
    In article <[email protected]>, Makas Tzavellas wrote:
    Hi,
         I'm using kodo 2.4.1 and the latest stable MySQL driver 3.0.6. After
    leaving the application inactive for a few hours, the connection to
    mysql is no longer usable. This did not occur with MySQL version 2.0.14
    (as I believe Kodo weren't reusing the connections).
         Are there any properties that I could set, so Kodo can keep the
    connection active or recover from the problem?
    Makas

  • How to bound a JNDI reference to MySQL driver?

    Hi.
    Hi.
    I am trying to write a simple J2EE application that would use Entety EJB with bean persisatance. I have downloaded driver from the www.mysql.org, copied it to the lib/system directory and modified J2EE_CLASSPATH in bin/userconfig.bat. I am using reference implementation server and with deploytool in �tools/serverconfiguration/datasourses/standard� I am specifying driver: org.gjt.mm.mysql.Driver or com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource and in datasourses in JNDI Name I write �jdbc/mydb� and in JDBC URL �jdbc:mysql://localhost:3306/this�, problem comes up when I try to reference �jdbc/mydb� from an entity bean, during deployment process of application it says that it is not bound
    Binding name:`java:comp/env/jdbc\persondb`
    Warning: Reference reference java:comp/env/jdbc\persondb is using a JNDI name that is not bound: jdbc\mydb
    I do not get it, what I am doing wrong? Please help me to find out how to bind a JNDI name to MySQL

    Hi! I had the same problem, too. I�m Brazilian and I�ve been learning the English language yet, but I�ll try to describe how to configure J2EE with MySQL.
    I am using MySQL version 4.1.7 with J2EE version 1.3 on Windows XP Professional. The driver version of MySQL is 3.0.16.
    You have to configure the following two files:
    - <J2EE_HOME>\bin\setenv.bat
    - <J2EE_HOME>\config\resource.properties
    Do the following steps:
    1) Copy the JAR file of MySQL driver (mysql-connector-java-3.0.16-ga-bin.jar) to <J2EE_HOME>\lib directory.
    2) In <J2EE_HOME>\bin directory open the setenv.bat file and analize the code. It is not hard to understand the code, it is just the classpath configuration of J2EE. After understand it, add a reference of MySQL driver (mysql-connector-java-3.0.16-ga-bin.jar), that was copied to <J2EE_HOME>\lib directory.
    3) Run the <J2EE_HOME>\bin\j2eeadmin.bat to configure the resource.properties file.There are two command lines to be executed, as below:
    - j2eeadmin.bat -addJdbcDriver <CLASS NAME OF THE DRIVER>
    - j2eeadmin.bat -addJdbcDatasource <JNDI NAME> <URL>
    For example:
    - j2eeadmin.bat -addJdbcDriver "com.mysql.jdbc.Driver"
    - j2eeadmin.bat -addJdbcDatasource "jdbc/mysql/test" "jdbc:mysql://localhost/test?user=username&password=pass"
    4) After run j2eeadmin.bat, the resource.properties file will be modified. But when I did it and when I executed the verbose command to start J2EE, some error messages was exhibited. So I decided to open the resource.properties file and I noticed that the character "\" was added erroneously in a lot of places of the code. It did not seem correct, so I decided to remove these characters replacing them. I was right! After I did it, I run verbose again and no more message error ocurred. I think it is a bug of J2EE.
    Finish! I modified the datasource JNDI to access MySQL and then I run my EAR application. No problems occurred. My application is running succesfully.
    Good luck!

  • Old mySql driver, or missing something?

    Hi,
    i am a nub in web applications in java.
    I have a system using jrun4 (and tomcat 5 as a second app server), mysql 5, and the java connector driver connector/j 3.1.11 .
    The mysql database is running on port 3306.
    I am trying to make a connection to the database so i ve writen the following simple jsp program:
    <%@ page language="java" import="java.sql.*" %>
    <%
         try {
              String sAddress = (String)session.getValue("ADDRESS");
              String sDatabase = (String)session.getValue("DATABASE");
              String sUsername = (String)session.getValue("USERNAME");
              String sPassword = (String)session.getValue("PASSWORD");
              if (sAddress == null || sDatabase == null || sUsername == null || sPassword == null) {
                   sAddress = request.getParameter("ADDRESS");
                   sDatabase = request.getParameter("DATABASE");
                   sUsername = request.getParameter("USERNAME");
                   sPassword = request.getParameter("PASSWORD");
              // try a connection
              Class.forName("org.gjt.mm.mysql.Driver").newInstance();
              Connection conn = DriverManager.getConnection("jdbc:mysql://" + sAddress + "/" + sDatabase +"?user=" + sUsername + "&password=" + sPassword);
              conn.createStatement();
              conn.close();
              // put connection data into session
              session.putValue("ADDRESS", sAddress);
              session.putValue("DATABASE", sDatabase);
              session.putValue("USERNAME", sUsername);
              session.putValue("PASSWORD", sPassword);
              // proceed with success
              response.sendRedirect("menu.html");
              return;
         } catch (Exception e) {
              out.print("<font color=red><center>" + e.toString() + "</center></font><br>\n");
    %>
    When i try to run it will throw a the following exception:
    java.sql.SQLException: Cannot connect to MySQL server on null:3306. Is there a MySQL server running on the machine/port you are trying to connect to? (java.net.UnknownHostException)
    i think that the main reason this is happening is because its trying to find:
    Class.forName("org.gjt.mm.mysql.Driver").newInstance();
    while the driver connector/j 3.1.11(which is the latest on www.mysql.com)is providing a class name:
    com.mysql.jdbc.Driver
    so i looked and found a very old connector driver: mm.mysql.2.0.12
    which is providing name class: org.gjt.mm.mysql.Driver.
    the problem is still there though...
    Am i missing something????
    Is there a special way to install that driver???
    What step do you think i should follow???
    Do you think its something else that might be responsible????

    Hi,
    i am a nub in web applications in java.
    I have a system using jrun4 (and tomcat 5 as a second app server), mysql 5, and the java connector driver connector/j 3.1.11 .
    The mysql database is running on port 3306.
    I am trying to make a connection to the database so i ve writen the following simple jsp program:
    <%@ page language="java" import="java.sql.*" %>
    <%
         try {
              String sAddress = (String)session.getValue("ADDRESS");
              String sDatabase = (String)session.getValue("DATABASE");
              String sUsername = (String)session.getValue("USERNAME");
              String sPassword = (String)session.getValue("PASSWORD");
              if (sAddress == null || sDatabase == null || sUsername == null || sPassword == null) {
                   sAddress = request.getParameter("ADDRESS");
                   sDatabase = request.getParameter("DATABASE");
                   sUsername = request.getParameter("USERNAME");
                   sPassword = request.getParameter("PASSWORD");
              // try a connection
              Class.forName("org.gjt.mm.mysql.Driver").newInstance();
              Connection conn = DriverManager.getConnection("jdbc:mysql://" + sAddress + "/" + sDatabase +"?user=" + sUsername + "&password=" + sPassword);
              conn.createStatement();
              conn.close();
              // put connection data into session
              session.putValue("ADDRESS", sAddress);
              session.putValue("DATABASE", sDatabase);
              session.putValue("USERNAME", sUsername);
              session.putValue("PASSWORD", sPassword);
              // proceed with success
              response.sendRedirect("menu.html");
              return;
         } catch (Exception e) {
              out.print("<font color=red><center>" + e.toString() + "</center></font><br>\n");
    %>
    When i try to run it will throw a the following exception:
    java.sql.SQLException: Cannot connect to MySQL server on null:3306. Is there a MySQL server running on the machine/port you are trying to connect to? (java.net.UnknownHostException)
    i think that the main reason this is happening is because its trying to find:
    Class.forName("org.gjt.mm.mysql.Driver").newInstance();
    while the driver connector/j 3.1.11(which is the latest on www.mysql.com)is providing a class name:
    com.mysql.jdbc.Driver
    so i looked and found a very old connector driver: mm.mysql.2.0.12
    which is providing name class: org.gjt.mm.mysql.Driver.
    the problem is still there though...
    Am i missing something????
    Is there a special way to install that driver???
    What step do you think i should follow???
    Do you think its something else that might be responsible????

  • Java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver when using RMI

    I am trying to connect to mysql Db through RMI but i am getting this exception.
    When trying to connect to db through a normal class implementation without RMI it is connected succesfully.
    What is causing the problem????
    Thanks in advace

    CLASSPATH, man. The RMI server needs to have the MySQL driver JAR in its CLASSPATH.
    That's usually what that exception means.
    %

  • Org.gjt.mm.mysql.Driver not found help!!

    hi all
    it's the first time for me working with MySql, and when i try to connect to the db, i have the following exception:
    java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver
    i know that i shall download it from Mysql site, but i don't know WHERE to put it
    i'm using forte 3.0 - jdk 1.4.0 on Win2K
    please help me!
    thanx
    sandro

    No problem,
    in general you should modify the CLASSPATH of your JDK to point to the jar-driver-file, e.g. (on unix): CLASSPATH = "someDirectory"\driverFIle.jar:$CLASSPATH
    and then: export CLASSPATH. That should solve your problem. if using windows: Just take a look at systemControlCenter. There it's possible to modify the CLASSPAT-environment.
    So far...

  • Migration from MySQL - connection problem

    I've just installed OMWB 1.3.1 for WINDOWS and created repository in ORACLE 8.0.5 DB.
    When I enter Source Database Details in Capture Wizard and push Next button nothing is happened. In OMWB log-file I've found the following message among many others:
    Exception occurred during event dispatching:
    java.lang.NoClassDefFoundError: org/gjt/mm/mysql/Driver
    at java.util.Vector.<init>(Vector.java:128)
    The directory C:\Oracle\oracle81\Omwb\drivers\
    is empty while in CLASSPATH env variable I've found the following item:
    C:\Oracle\oracle81\Omwb\drivers\mm.mysql.jdbc-1.2a
    If anybody could help me to solve this problem, please let me know.
    Thank you in advance.
    null

    Hi Vladimir,
    I send you a message from the Migration Workbench team that solved my problem. I hope this will resolve yours too.
    Bye,
    Pierfrancesco
    Hi Pierfrancesco
    MySQL 3.22, 3.23 Requirements
    In order to migrate from MySQL to Oracle, you must install the MM MySQL JDBC
    driver release 1.2a on the same system as the Migration Workbench. You can
    obtain this by downloading the MM MySQL JDBC driver from the WorldServer Web
    site at:
    http://www.worldserver.com/mm.mysql
    Copy and unzip the mm.mysql.jdbc-1.2a.zip file to your
    %ORACLE_HOME%\Omwb\drivers directory. This automatically creates a new
    directory called
    mm.mysql.jdbc-1.2a within the drivers directory.
    Can you please verify that you have this driver extracted to the above
    specified directory. Another check you can do is see whether all the files in
    the zip
    have extracted.
    Please refer to the Release notes which you have access to by selection the Help
    drop down menu in the Workbench.
    I hope this helps
    Best regards
    Oracle Migration Workbench Support
    null

  • Help me i need mm.mysql driver for my sql

    i tried to connect my jsp page with mysql database but it is giving me type 4 org.gjt.mm.mysql.Driver error it says that it is not found.
    i went to mysql official site and it is saying that they have finished mm driver and now have made connector j driver for jdbc ....
    my code is this...
    <%
    Class.forName("org.gjt.mm.mysql.Driver");
    Connection myConn= DriverManager.getConnection("jdbc:mysql:///poll?user=123&password=123");
    Statement stmt=myConn.createStatement();
    ResultSet myResultSet=stmt.executeQuery("select * from pollInfo");
    if (myResultSet != null){
    while (myResultSet.next()){
    String name=myResultSet.getString ("pollname");
    String option=myResultSet.getString ("pollOption");
    String votes=myResultSet.getString ("pollvotes");%>
    <tr>
    <td><%=name%></td>
    <td><%=option%></td>
    <td><%=votes%></td>
    </tr>
    <%
    stmt.close();
    myConn.close();
    %>
    here poll is my database name and pollInfo is my table name
    user name and passwords are 123
    and when running it it give me this error.
    >>>>>>>>>>>>>>>>>>>>>
    500 Internal Server Error
    /dbquery.jsp:
    Exception thrown on line '11' from page 'C:\\Program Files\\Allaire\\JRun\\servers\\default\\default-app\\dbquery.jsp'.
    java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver [org.gjt.mm.mysql.Driver]
         at allaire.jrun.servlet.JRunServletLoader.loadClass(../servlet/JRunServletLoader.java:430)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at allaire.jrun.jsp.JSPClassLoader.loadClass(../jsp/JSPClassLoader.java:118)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClassInternal(Unknown Source)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Unknown Source)
         at jrun__dbquery2ejspc._jspService(jrun__dbquery2ejspc.java:44)
         at allaire.jrun.jsp.HttpJSPServlet.service(../jsp/HttpJSPServlet.java:39)
         at allaire.jrun.jsp.JSPServlet.service(../jsp/JSPServlet.java:228)
         at allaire.jrun.jsp.JSPServlet.service(../jsp/JSPServlet.java:196)
         at allaire.jrun.servlet.JRunSE.service(../servlet/JRunSE.java:1416)
         at allaire.jrun.session.JRunSessionService.service(../session/JRunSessionService.java:1082)
         at allaire.jrun.servlet.JRunSE.runServlet(../servlet/JRunSE.java:1270)
         at allaire.jrun.servlet.JRunRequestDispatcher.forward(../servlet/JRunRequestDispatcher.java:89)
         at allaire.jrun.servlet.JRunSE.service(../servlet/JRunSE.java:1552)
         at allaire.jrun.servlet.JRunSE.service(../servlet/JRunSE.java:1542)
         at allaire.jrun.servlet.JvmContext.dispatch(../servlet/JvmContext.java:364)
         at allaire.jrun.http.WebEndpoint.run(../http/WebEndpoint.java:115)
         at allaire.jrun.ThreadPool.run(../ThreadPool.java:272)
         at allaire.jrun.WorkerThread.run(../WorkerThread.java:75)
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    I am using jrun 3.1 the release of Allair ...
    now any one please help me what to do
    i willl be great ful to all of u very much thanx
    bye

    Hi,
    The driver needs to be on your classpath. So download it to (say C:\jars), what I do is rename it to mysql.jar
    Then add the C:\jars\mysql.jar to the classpath
    If you are using it with tomcat at runtime, which you are probably not, then you could also copy the jar in the tomcat\lib directory - but I have never done this.
    If you are still experiencing problems, open the jar file using winxip or the jar command and make sure that the jar build is exactly as it should be, i.e. the correct names etc.
    best
    kev

Maybe you are looking for

  • Best Practice for FlexConnect Wireless roaming in MediaNet environment?

    Hello! Current Cisco best practice recommendations for enterprise MediaNet design, specify that VLANs be local to a switch / switch stack (i.e., to limit the scope of spanning-tree).  In the wireless world, this causes problems if you want users whil

  • White and black point vs ??

    I never know which forum to post these things, so I'll start with the photographers. <br /> <br />These three shots are as follows: (1) the camera raw version, (2) where I moved the sliders from the ends to approximately the beginning/end of the majo

  • Materialized view log and user....

    Hi, Assume that a user , let's call him A owns a table and another user B needs to create a materialized view log on the table who owns the A user. Whereas the user B do have all object privileges(direct priv insert, update, delete.. not via a role)

  • Bash command in title?

    how do i put the command in my title? i'm playing around with $BASH_COMMAND but cant get it to work. here's the relevant section i have now in my bashrc: PROMPT_COMMAND='echo -ne "\033]0;${USER}: ${PWD/$HOME/~}\007"' thanks for any and all help.

  • Mp3 cd problem

    so i burn my mp3 cd and when i play the songs in my cars stereo some of the info that the screen reads isn't there, like artist or album or even song title. the song plays fine and all, but the screen reads "no title" or "no artist" or "no album" ins