Org.gjt.mm.mysql.Driver
I want to send a WAR file of my web applications to my clients. The application consiting of servlets and jsps connects to a database and requires org.gjt.mm.mysql.Driver how do i incorperate the .jar inside the WAR so my client doesn't have to fiddle with dropping jars in tomcats lib directory? I've tried including the org.gjt.mm.mysql.Driver driver jar inside the war WEB-INF/lib but it still says it cant find the driver?
If you have set up connection pooling within Tomcat, there is no way around it. The connection pooling is controlled by Tomcat, so it requires the driver file in [TOMCAT]/common/lib.
The only way to have a completely independant WAR file would be to handle all the database connections and connection pooling yourself within the web application.
Similar Messages
-
Cannot load JDBC driver class 'org.gjt.mm.mysql.Driver'
Hi,
I'm trying to run my web app and connect to a MySQL database but keep getting this error:
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot load JDBC driver class 'org.gjt.mm.mysql.Driver'
any ideas?
Thanks!Lookup the stacktrace and find the root cause of the exception.
My cents on a ClassNotFoundException which is rather self-explaining.
By the way, the mentioned driver class name is a very old driver. You shouldn't be using that anymore. Surf to the MySQL homepage and download the most recent Connector/J JDBC driver for your database version. Documentation is also available over there. -
hi
I am facing followig error.
java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver
How to set the class path.
I am using Windows XP, NetBeans IDE 5.5, MySQL-5.0
I have made one simple servlet program in order to read one small table from the MySQL database.
I got the connectivity but above error is i have been facing.
Please tell me how to write to set the class path and where should i put my mysql-connector-java-5.0.4-bin file. so i can read the data from the database.
thanking you.
regards
discuss.hi
I am facing followig error.
java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver
How to set the class path.
I am using Windows XP, NetBeans IDE 5.5, MySQL-5.0
I have made one simple servlet program in order to read one small table from the MySQL database.
I got the connectivity but above error is i have been facing.
Please tell me how to write to set the class path and where should i put my mysql-connector-java-5.0.4-bin file. so i can read the data from the database.
thanking you.
regards
discuss. -
Hi,
I am a new user in this forum..
I have just installed tomcat and mysql and jdbc fresh on my new system..
first of all here is what i have done...
i have installed mysql integrated in xampp at c:\xampp\mysql
i have installed my tomcat at C:\Programme\Apache Software Foundation\Tomcat 5.5
i have put jdbc <dirver>.jar file copied in all sorts of directories like ....
<tomcat_home>\common\lib
<tomcat_home>\webapps\axis\WEB-INF\lib\ext
<java_home>\lib
<java_home>\jre\lib\ext
my calsspath looks something like this
.;C:\Programme\QuickTime\QTSystem\QTJava.zip;C:\Programme\"Apache Software Foundation"\"Tomcat 5.5"\common\lib\mysql-connector-java-5.0.6-bin.jar;C:\Programme\"Apache Software Foundation"\"Tomcat 5.5"\webapps\axis\WEB-INF\lib\mysql-connector-java-5.0.6-bin.jar;C:\Programme\"Apache Software Foundation"\"Tomcat 5.5"\common\lib\servlet-api.jar;C:\Programme\"Apache Software Foundation"\"Tomcat 5.5"\common\lib\jsp-api.jar;C:\Programme\Java\jdk1.5.0_05\jre\lib\ext\mysql-connector-java-5.0.6-bin.jar;C:\Programme\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF;C:\Programme\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF\lib\activation.jar;C:\Programme\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF\lib\axis.jar;C:\Programme\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF\lib\axis-ant.jar;C:\Programme\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF\lib\commons-discovery-0.2.jar;C:\Programme\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF\lib\commons-logging-1.0.4.jar;C:\Programme\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF\lib\jaxrpc.jar;C:\Programme\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF\lib\log4j-1.2.8.jar;C:\Programme\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF\lib\mail.jar;C:\Programme\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF\lib\saaj.jar;C:\Programme\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF\lib\wsdl4j-1.5.1.jar;C:\Programme\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF\lib\mysql-connector-java-5.0.6-bin.jar
which is basically all the jar files in the web-inf\lib folder and references to all the copies of driver as mentioned before
these are results of a lot of desperatio but still the code which i run....
package mypackage;
import java.sql.*;
public class JDBCConnector
public static void main(String[] arg) throws Exception
System.out.println("Initiating Database Mysql Connection");
//try {
Statement stmt;
// Register the JDBC driver for MySQL.
Class.forName("org.gjt.mm.mysql.Driver ").newInstance();
// Define URL of database server for
// database named mysql on the localhost
// with the default port number 3306.
String url = "jdbc:mysql://wifh-1.fhso.ch:3306/";
// Get a connection to the database for a
// user named root with a blank password.
// This user is the default administrator
// having full privileges to do anything.
Connection con = DriverManager.getConnection(url,"root", "birnExy");
//Display URL and connection information
System.out.println("URL: " + url);
System.out.println("Connection: " + con);
//Get a Statement object
stmt = con.createStatement();
// Create the new database
stmt.executeUpdate("CREATE DATABASE JunkDB3");
//Register a new user named auser on the
// database named JunkDB with a password
// drowssap enabling several different
// privileges.
stmt.executeUpdate("GRANT SELECT,INSERT,UPDATE,DELETE," +"CREATE,DROP " +"ON JunkDB3.* TO 'nishant'@'localhost' " +"IDENTIFIED BY 'nishant';");
con.close();
//}catch( Exception e ) {
// e.printStackTrace();
//}//end catch
//return hook;
}//end main
}//end class JDBCConnector
gives the following error.....
<soapenv:Envelope>
−
<soapenv:Body>
−
<soapenv:Fault>
<faultcode>soapenv:Server.userException</faultcode>
−
<faultstring>
java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver
</faultstring>
−
<detail>
<ns1:hostname>SADMC0087</ns1:hostname>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
please help me20.05.2007 22:43:26 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Programme\Java\jdk1.5.0_05\jre\bin;.;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Programme\QuickTime\QTSystem\;C:\Programme\ATI Technologies\ATI Control Panel;C:\Programme\Java\jdk1.5.0_05\bin;C:\Programme\Apache Software Foundation\Tomcat 5.5\common\lib;
20.05.2007 22:43:27 org.apache.coyote.http11.Http11BaseProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
20.05.2007 22:43:27 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1203 ms
20.05.2007 22:43:27 org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
20.05.2007 22:43:27 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.23
20.05.2007 22:43:27 org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
20.05.2007 22:43:28 org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive SIpages.war
20.05.2007 22:43:31 org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
20.05.2007 22:43:31 org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
20.05.2007 22:43:31 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/109 config=null
20.05.2007 22:43:31 org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
20.05.2007 22:43:32 org.apache.catalina.startup.Catalina start
INFO: Server startup in 4813 ms
now this is when i run from eclipse where SIpages.war is my war file to be deployed...which looks something like this
sipages/web-inf/classes
sipages/web-inf/src
sipages/web-inf/lib-this has the jar file as you mentioned
and come other files...nwo where soes my .java file go in this war and how do i compile the java file -
Including org.gjt.mm.mysql.Driver with my application
So, lets say I have a Java program that connects to an SQL server and it runs fine on my machine. I have all the nessicarry classpath's and Connector/J properly installed. But, when I run it on a client machine I get:
java.lang.ClassNotFoundException: org.gjt.mm.mysql.DriverNow, I can solve this issue by putting the Connector/J onto their computer but, I'm wondering if there's a way to package the application and the driver so that anyone can run it without having to install Connector/J manually.
Any help would be much appreciated.
Thanks!JonasWon wrote:
So, lets say I have a Java program that connects to an SQL server and it runs fine on my machine. I have all the nessicarry classpath's and Connector/J properly installed. But, when I run it on a client machine I get:
java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver
That's the old, deprecated JDBC driver class name.
Now, I can solve this issue by putting the Connector/J onto their computer but, I'm wondering if there's a way to package the application and the driver so that anyone can run it without having to install Connector/J manually.
Any help would be much appreciated.
Thanks!"install" it manually? Nobody "installs" a 3rd party JAR. These aren't quite DLLs.
I'll assume your app is a desktop deployment. Package it into an executable JAR, add the Connector/J JAR to the Classpath in the manifest, and zip that JAR up with the Connector/J JAR. Your users will just unzip the ZIP file and execute the JAR.
% -
Driver class 'org.gjt.mm.mysql.Driver' not Found JSP
OS ->Windows XP Pro
Tomcat version ->4.0.1
jdk version -> 1.3.1
database -> mysql
Classpath = .;C:\jakarta-tomcat-4.0.1\common\lib\servlet.jar;C:\jakarta-tomcat-4.0.1\common\lib\mm.mysql.jdbc-1.2c\mysql_uncomp.jar;
I am trying to run a function in a javabean to startup up a connection to a database. Code as follows...
public void connect() throws ClassNotFoundException,
SQLException,
Exception {
try {
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
con = DriverManager.getConnection(
"jdbc:mysql://localhost/Wrox ?user=root&password=lunchbox ");
} catch (ClassNotFoundException cnfe) {
error = "ClassNotFoundException: Could not locate DB driver.";
throw new ClassNotFoundException(error);
} catch (SQLException cnfe) {
error = "SQLException: Could not connect to database.";
throw new SQLException(error);
} catch (Exception e) {
error = "Exception: An unknown error occurred while connecting " +
"to database.";
throw new Exception(error);
I call it from my jsp page code as follows.. connect in bold
<%@ page language="java"
import="java.sql.*, java.io.*, java.util.*, com.wrox.databases.*"
errorPage="error.jsp" %>
<jsp:useBean id="book" class="com.wrox.databases.Books" />
<html>
<head>
<title> Wrox Press Ltd. </title>
</head>
<body>
<h1> Wrox Press Ltd.</h1>
<h2> List of Books </h2>
<b>Add More Books</b>
<form action="delete.jsp" method="post">
<table border="1">
<tr>
<td><b>ID:</b></td>
<td><B>Title:</b></td>
<td><B>Price:</b></td>
</tr>
<%
book.connect();
ResultSet rs = book.viewBooks();
while (rs.next()) {
%>
<tr>
<td>
<input type="checkbox" name="pkey"
value="<%= rs.getString("Title_ID") %>" />
</td>
<td><%= rs.getString("Title") %></td>
<td><%= rs.getString("Price") %></td>
</tr>
<%
%>
</table>
Check books for deletion.<BR>
<input type="submit" value="Delete All Checked Books">
</form>
<% book.disconnect(); %>
</body>
</html>
The name of the bean is correct and so is the package it is stored under. I tried it in the bean and got "ClassNotFoundException" Could not locate DB driver". I tried it with DBtags and got
Driver class 'org.gjt.mm.mysql.Driver' not Found
any help would be really appreciated.When using any 3rd party library with tomcat. the jar file of that library has to be put in the WEB-INF/lib directory of your application. Then only tomcat will find it.
So the my-sql driver would have come in a jar file. just put that jar file in the WEB-INF/lib directory.
After that things should work. If they don't please post again.
hope this helps.
regards,
Abhishek. -
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
sandroNo 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... -
Help. JDBCRealm error -- org.gjt.mm.mysql.Driver not found
Hi All,
I tried to setup JDBCRealm. After I config. to JDBCRealm and restart tomcat. I got this error:
java.sql.SQLException: org.git.mm.mysql.Driver error.
Can someone help. Thanksweb-inf/lib is not sufficient in this case, as the Tomcat engine needs access to the driver - not just your application.
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/realm-howto.html#JDBCRealm
You need to
Place a copy of the JDBC driver you will be using inside the $CATALINA_HOME/server/lib directory (if you do not need it visible to web applications) or $CATALINA_HOME/common/lib (if it will be used both by Tomcat 4 and by your apps).
Cheers.
evnafets -
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 advaceCLASSPATH, 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 under tomcat?
hi all
anybody knows where to put this driver under tomcat in order to let my servlet connect to a MySql db?
thanx all
sandrosandro
Put the driver on "lib/common/" directory of Tomcat, and since lib is directly located by tomcat when you restart it. You must have to restart the tomcat after copying the file. The folder path may be "/var/tomcat/lib/commomn/" and may vary during installation.
Cheers
Rahul// -
import java.sql.*;
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
public class receiving extends Applet implements ItemListener, ActionListener
Connection conDatabase;//door to the database
Statement cmdDatabase;//messenger
ResultSet rsDatabase;//bucket
private String dbURL = "jdbc:mysql://web6.duc.auburn.edu/?user=gunthms&password=tigers05";
boolean blnSuccessfulOpen = false;
Choice Order_No = new Choice();
TextField txtOrder_No = new TextField(6);
TextField txtCompany = new TextField(20);
TextField txtLocation = new TextField(20);
TextField txtDate_Shipped = new TextField(10);
TextField txtBlack_Poly = new TextField(8);
TextField txtBlue_Poly = new TextField(8);
TextField txtBrass1 = new TextField(8);
TextField txtBrass2 = new TextField(8);
TextField txtTransaction_No = new TextField(8);
TextField txtTracking_No = new TextField(18);
Button btnAdd = new Button("Add");
Button btnEdit = new Button("Save");
Button btnCancel = new Button("Cancel");
Button btnDelete = new Button("Delete");
Button btnNext = new Button(" > ");
Button btnLast = new Button(" >>> ");
Button btnPrevious = new Button(" < ");
Button btnFirst = new Button(" <<< ");
public void init()
//Set up panel and load database
LoadDatabase();
if (blnSuccessfulOpen)
Order_No.insert("Select an Order",0);
add(Order_No);
add(new Label(" "));
Order_No.addItemListener(this);
add(new Label("Order No"));
add(txtOrder_No);
add(new Label("Company"));
add(txtCompany);
add(new Label("Location"));
add(txtLocation);
add(new Label(" "));
add(new Label("Date Shipped"));
add(txtDate_Shipped);
add(new Label(" "));
add(new Label("Black Poly (sqft)"));
add(txtBlack_Poly);
add(new Label("Blue Poly (sqft)"));
add(txtBlue_Poly);
add(new Label("Brass 1inch (pcs)"));
add(txtBrass1);
add(new Label("Brass 2inch (pcs)"));
add(txtBrass2);
add(new Label(" "));
add(new Label("Transaction No"));
add(txtTransaction_No);
add(new Label(" "));
add(new Label("Tracking No"));
add(txtTracking_No);
setTextToNotEditable();
add(new Label(" "));
add(btnAdd);
btnAdd.addActionListener(this);
add(btnEdit);
btnEdit.addActionListener(this);
add(btnDelete);
btnDelete.addActionListener(this);
add(btnCancel);
btnCancel.addActionListener(this);
btnCancel.setEnabled(false);
//Navigate Buttons
add(btnFirst);
btnFirst.addActionListener(this);
add(btnPrevious);
btnPrevious.addActionListener(this);
add(btnNext);
btnNext.addActionListener(this);
add(btnLast);
btnLast.addActionListener(this);
else
System.err.println("Unable to populate fields");
public void LoadDatabase()
try
//Load MySQL drivers
Class.forName("org.gjt.mm.mysql.Driver");
catch ( java.lang.ClassNotFoundException e )
System.err.println("MySQL ORG Package Driver not found ...");
System.err.println(e.getMessage());
/* try
//Load MySQL drivers
Class.forName("com.mysql.jdbc.Driver");
catch ( java.lang.ClassNotFoundException e )
System.err.println("MySQL COM Package Driver not found ...");
System.err.println(e.getMessage());
try
//Connect to the database
conDatabase = DriverManager.getConnection(dbURL);
catch(SQLException error)
System.err.println("Unable to Connect to Database");
try
Statement cmdDatabase = conDatabase.createStatement();
//Create the ResultSet
rsDatabase = cmdDatabase.executeQuery("Select * from gunthmsjv.RECEIVING;");
loadNumbers(rsDatabase);
blnSuccessfulOpen = true;
catch(SQLException error)
System.err.println("Error in recordset");
public void loadNumbers(ResultSet rsDatabase)
//Fill last name list box
try
while(rsDatabase.next())
Order_No.add(rsDatabase.getString("Order_No"));
catch (SQLException error)
System.err.println("Error in Display Record");
public void itemStateChanged(ItemEvent event)
//Retrieve and display the selected record
String strOrder_No = Order_No.getSelectedItem();
showStatus(""); //Delete instructions
try
Statement cmdDatabase = conDatabase.createStatement();
rsDatabase = cmdDatabase.executeQuery(
"Select * from gunthmsjv.RECEIVING where Order_No = '" + strOrder_No + "';");
txtOrder_No.setText(strOrder_No);
displayRecord(rsDatabase);
setTextToEditable();
catch(SQLException error)
showStatus("Error in recordset");
public void displayRecord(ResultSet rsDatabase)
//Display the current record
try
if(rsDatabase.next())
txtOrder_No.setText(rsDatabase.getString("Order_No"));
txtCompany.setText(rsDatabase.getString("Company"));
txtLocation.setText(rsDatabase.getString("Location"));
txtDate_Shipped.setText(rsDatabase.getString("Date_Shipped"));
txtBlack_Poly.setText(rsDatabase.getString("Black_Poly"));
txtBlue_Poly.setText(rsDatabase.getString("Blue_Poly"));
txtBrass1.setText(rsDatabase.getString("Brass1"));
txtBrass2.setText(rsDatabase.getString("Brass2"));
txtTransaction_No.setText(rsDatabase.getString("Transaction_No"));
txtTracking_No.setText(rsDatabase.getString("Tracking_No"));
showStatus("");
else
showStatus("Record not found");
ClearTextFields();
catch (SQLException error)
showStatus("Error in display record");
public void actionPerformed(ActionEvent event)
//Test the command buttons
Object objSource = event.getSource();
if(objSource == btnAdd && event.getActionCommand() == "Add")
Add();
else if (objSource == btnAdd)
Save();
else if(objSource == btnEdit)
Edit();
else if(objSource == btnDelete)
Delete();
else if(objSource == btnCancel)
Cancel();
else if(objSource == btnFirst)
firstRecord();
else if(objSource == btnNext)
nextRecord();
else if(objSource == btnPrevious)
previousRecord();
else if(objSource == btnLast)
lastRecord();
public void setTextToNotEditable()
//Lock the text fields
txtOrder_No.setEditable(false);
txtCompany.setEditable(false);
txtLocation.setEditable(false);
txtDate_Shipped.setEditable(false);
txtBlack_Poly.setEditable(false);
txtBlue_Poly.setEditable(false);
txtBrass1.setEditable(false);
txtBrass2.setEditable(false);
txtTransaction_No.setEditable(false);
txtTracking_No.setEditable(false);
public void setTextToEditable()
//Unlock the text fields
txtOrder_No.setEditable(true);
txtCompany.setEditable(true);
txtLocation.setEditable(true);
txtDate_Shipped.setEditable(true);
txtBlack_Poly.setEditable(true);
txtBlue_Poly.setEditable(true);
txtBrass1.setEditable(true);
txtBrass2.setEditable(true);
txtTransaction_No.setEditable(true);
txtTracking_No.setEditable(true);
public void ClearTextFields()
//Clear the Text Fields
txtOrder_No.setText("");
txtCompany.setText("");
txtLocation.setText("");
txtDate_Shipped.setText("");
txtBlack_Poly.setText("");
txtBlue_Poly.setText("");
txtBrass1.setText("");
txtBrass2.setText("");
txtTransaction_No.setText("");
txtTracking_No.setText("");
public void Add()
//Add a new record
showStatus("");
//Empty the text fields
setTextToEditable();
ClearTextFields();
txtOrder_No.requestFocus ();
//Change the button labels
btnAdd.setLabel("OK");
btnCancel.setEnabled(true);
//Disable the Delete and Edit buttons
btnDelete.setEnabled(false);
btnEdit.setEnabled(false);
public void Save()
//Save the new record
// Activated when Add button has an "OK" label
if (txtOrder_No.getText().length() == 0 && txtLocation.getText().length() == 0)
showStatus("The Customer Name or ID Number is blank");
else
try
Statement cmdDatabase = conDatabase.createStatement();
cmdDatabase.executeUpdate(
"Insert Into gunthmsjv.RECEIVING "
+ "(Order_No,Company,Location,Date_Shipped,Black_Poly,Blue_Poly,Brass1,Brass2,Transaction_No,txtTracking_No) "
+ "Values('"
+ txtOrder_No.getText() + "', '"
+ txtCompany.getText() + "', '"
+ txtLocation.getText() + "', '"
+ txtDate_Shipped.getText() + "', '"
+ txtBlack_Poly.getText() + "', '"
+ txtBlue_Poly.getText() + "', '"
+ txtBrass1.getText() + "', '"
+ txtBrass2.getText() + "', '"
+ txtTransaction_No.getText() + "', '"
+ txtTracking_No.getText() + "')");
//Add to name list
Order_No.add(txtOrder_No.getText());
//Reset buttons
Cancel();
catch(SQLException error)
showStatus("Error: " + error.toString());
public void Delete()
//Delete the current record
int intIndex = Order_No.getSelectedIndex();
String strOrder_No = Order_No.getSelectedItem();
if(intIndex == 0) //Make sure a record is selected
//Position zero holds a message
showStatus("Please select the record to be deleted");
else
try
//Delete from Database
Statement cmdDatabase = conDatabase.createStatement();
cmdDatabase.executeUpdate(
"Delete from gunthmsjv.RECEIVING where Order_No = '"
+ strOrder_No + "';");
ClearTextFields(); //Delete from screen
Order_No.remove(intIndex); //Delete from list
showStatus("Record deleted"); //Display message
catch(SQLException error)
showStatus("Error during Delete");
public void Cancel()
//Enable the Delete and Edit buttons
btnDelete.setEnabled(true);
btnEdit.setEnabled(true);
btnCancel.setEnabled(false);
//Change caption of button
btnAdd.setLabel("Add");
//Clear the text fields and status bar
ClearTextFields();
showStatus("");
public void Edit()
//Save the modified record
int intIndex = Order_No.getSelectedIndex();
if(intIndex == 0) //Make sure a record is selected
//Position zero holds a message
showStatus("Please select the record to be changed");
else
String strOrder_No = Order_No.getSelectedItem();
try
Statement cmdDatabase = conDatabase.createStatement();
cmdDatabase.executeUpdate(
"Update gunthmsjv.RECEIVING "
+ "Set Order_No = '" + txtOrder_No.getText() + "', "
+ "Company = '" + txtCompany.getText() + "', "
+ "Location = '" + txtLocation.getText() + "', "
+ "Date_Shipped = '" + txtDate_Shipped.getText() + "', "
+ "Black_Poly = '" + txtBlack_Poly.getText() + "', "
+ "Blue_Poly = '" + txtBlue_Poly.getText() + "', "
+ "Brass1 = '" + txtBrass1.getText() + "', "
+ "Brass2 = '" + txtBrass2.getText() + "', "
+ "Transaction_No = '" + txtTransaction_No.getText() + "', "
+ "txtTracking_No = '" + txtTracking_No.getText() + "', ");
if (!strOrder_No.equals(txtOrder_No.getText()))
//Last name changed; change the list
Order_No.remove(intIndex); //Remove the old entry
Order_No.add(txtOrder_No.getText()); //Add the new entry
catch(SQLException error)
showStatus("Error during Edit");
public void stop()
//Terminate the connection
try
if (conDatabase != null)
conDatabase.close();
catch(SQLException error)
showStatus("Unable to disconnect");
public void firstRecord()
int first = 1;
Order_No.select(first);
String strNewOrder_No = Order_No.getSelectedItem();
try
Statement cmdDatabase = conDatabase.createStatement();
rsDatabase = cmdDatabase.executeQuery("Select * from gunthmsjv.RECEIVING where Order_No = '" + strNewOrder_No + "';");
txtOrder_No.setText(strNewOrder_No);
displayRecord(rsDatabase);
catch(SQLException error)
showStatus("item state try.");
public void previousRecord()
int PreviousIndex = 0;
PreviousIndex = Order_No.getSelectedIndex();
PreviousIndex--;
if (PreviousIndex > 0)
Order_No.select(PreviousIndex);
String strNewOrder_No = Order_No.getSelectedItem();
try
Statement cmdDatabase = conDatabase.createStatement();
rsDatabase = cmdDatabase.executeQuery("Select * from gunthmsjv.RECEIVING where Order_No = '" + strNewOrder_No + "';");
txtOrder_No.setText(strNewOrder_No);
displayRecord(rsDatabase);
catch(SQLException error)
showStatus("item state try.");
else
showStatus("You've reached the beginning of the list.");
public void nextRecord()
int NextIndex = 0;
NextIndex = Order_No.getSelectedIndex();
if(NextIndex == 0)
NextIndex = 1;
else
NextIndex++;
if (NextIndex < Order_No.getItemCount())
Order_No.select(NextIndex);
String strNewOrder_No = Order_No.getSelectedItem();
try
Statement cmdDatabase = conDatabase.createStatement();
rsDatabase = cmdDatabase.executeQuery("Select * from gunthmsjv.RECEIVING where Order_No = '" + strNewOrder_No + "';");
txtOrder_No.setText(strNewOrder_No);
displayRecord(rsDatabase);
catch(SQLException error)
showStatus("item state try.");
else
showStatus("You've reached the end of the list.");
public void lastRecord()
int last = 0;
while (last < Order_No.getItemCount()-1)
last++;
Order_No.select(last);
String strNewOrder_No = Order_No.getSelectedItem();
try
Statement cmdDatabase = conDatabase.createStatement();
rsDatabase = cmdDatabase.executeQuery("Select * from gunthmsjv.RECEIVING where Order_No = '" + strNewOrder_No + "';");
txtOrder_No.setText(strNewOrder_No);
displayRecord(rsDatabase);
catch(SQLException error)
showStatus("item state try.");
How do I point the class.forname to a url? This class will be run off a webserver with an html file. Everytime I run it currently, it comes back with a NullPointerException so I know it can't find it. I know if I run it locally, the file runs properly... Can someone help ASAP :(oad: class http://www.auburn.edu/~gunthms/classes/shipping.class not found.
java.lang.ClassNotFoundException: http:..www.auburn.edu.~gunthms.classes.shipping.class
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.net.UnknownHostException: www
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.plugin.net.protocol.http.HttpClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.<init>(Unknown Source)
at sun.net.www.http.HttpClient.<init>(Unknown Source)
at sun.plugin.net.protocol.http.HttpClient.<init>(Unknown Source)
at sun.plugin.net.protocol.http.HttpClient.New(Unknown Source)
at sun.plugin.net.protocol.http.HttpURLConnection.createConnection(Unknown Source)
at sun.plugin.net.protocol.http.HttpURLConnection.connect(Unknown Source)
at sun.plugin.net.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at java.net.HttpURLConnection.getResponseCode(Unknown Source)
at sun.applet.AppletClassLoader.getBytes(Unknown Source)
at sun.applet.AppletClassLoader.access$100(Unknown Source)
at sun.applet.AppletClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 10 more
It's just not finding it. Now if there were a way of loading that class from a jar file... or just any method at all of loading that... I think it would work... thanks alot man for your continuing help. -
Does anyone know of a good link, regarding the setup of a Mysql jdbc driver on a Unix platform. I need to setup a test page and do not know which *.jar file should be referenced in the classpath. Is it a matter of just downloading the [???] jar file or should I make use of connectors?
Thanx in advanceHi,
I have been using MySQL with Java on both windows and Linux for a while now. All I had to do was to
1) Download the mm.mysql-2.0.11-bin.jar file from www.mysql.com
2) Include this JAR file in the classpath.
3) Open a connection to the database using code like this:
String driverClass = "org.gjt.mm.mysql.Driver",
String url = "jdbc:mysql://localhost/databaseName",
String user = "root",
String password = "");
Class.forName(driverClass).newInstance();
Connection connection = DriverManager.getConnection(url, user, password);
This should do the job.
If you are looking for an easy way of reading and writing objects in databases, I suggest you take a look at the Mr. Persister API that we are releasing on monday May 3rd. It is free, and it does all the tedious and boring work of JDBC for you, with only 5% overhead compared to custom JDBC code. Mr. Persister was developed on MySQL, so it will also work with your project. Check it out here:
http://www.jenkov.dk/projects/mrpersister/mrpersister.jsp
Kind Regards,
Jakob Jenkov
www.jenkov.com -
Strange behaviour of jdbc-mysql driver
I am trying to store japanese characters in mysql and display also after reading from the database using JSP. I am using the following code.
<%@ page contentType="text/html; charset=UTF-8"%>
....... some code ......
<%
Class.forName( "org.gjt.mm.mysql.Driver" );
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/DB?useUnicode=true&characterEncoding=UTF-8", "user", "pass" );
Statement st = con.createStatement();
st.executeUpdate( "insert into test values('" + request.getParameter( "imgname" ) + "')" );
ResultSet rs = st.executeQuery( "select * from test" );
while( rs.next() ) {
%> DB Value: <%= rs.getString( "imgname" ) %>
<% } %>
I found one strange behaviour. I have to change the DriverManger.getConnection line to the following, to write the data correctly in the database.
DriverManager.getConnection("jdbc:mysql://localhost:3306/DB","user","pass")
If I read from the database using the same parameters as above, I am getting garbled data.
To retrieve the data correctly from the database I have to use the following line instead of the previous one.
DriverManager.getConnection("jdbc:mysql://localhost:3306/DB?useUnicode=true&characterEncoding=UTF-8", "user", "pass" );
In short, I have to pass different parameters to DriverManager.getConnection() for writing and reading from the database. But it is not possible practically. I am using mm.mysql-2.0.8 jdbc-mysql driver, mysql is 3.23.47 and english windows 2000.
I have tried the string.getBytes("UTF-8") and new String( getBytes(string), "UTF-8") methods, but not getting the correct data.
Can anybody guide me how can I store and display the japanese character correctly?
Thanks to all,
gaurang.I downloaded the latese driver from sourceforge, but still the same thing is happening. Is there any other thing which I should do?
Thanks
gaurang. -
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.
-
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?
MakasOk, 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
Maybe you are looking for
-
Cisco ASA 5505, Cisco VPN Client and Novell Netware
Hi, Our ISP have installed Cisco ASA 5505 firewall. We are trying to connect to our Novell 5.1 server using VPN client. I installed VPN client on a laptop that is using wireless connection. I connect using wireless signal from near by hotel and I am
-
How to get ADF authentication and authorization working on server
I am having an issue with deployment & ADF authentication and authorization. From the below testing results, you can see that I am unable to log in when I have deployed my app to my standalone server with both ADF security authentication and authoriz
-
Thunderbolt-Bridge does not work after Yosemite upgrade
Hi, recently I upgraded my MacBook pro (late 2013) to OS X 10.10. Now the thunderbolt - gigabit ethernet bridge is not recognised anymore. More specific the "Network Preference" pan does say that it is disconnected -> no network connection. At the sa
-
Computer halts...what can I do?
Hello guys, I need your precious help. 4-5 times the day my system goes very slowly for some minutes, it almost halts and cant even move the mouse. There is no proof that it happens when I do "heavy jobs" because it has happened even when was editing
-
The color change on my face how do i change back?
the color change on my face how do i change back?