Com.mysql.jdbc.JDBC4Connection suspected memory leak in java
We have a java application where we are using Bonecp pooling library. Below is how we setup the pooling.
[code]
try {
// setup the connection pool
BoneCPConfig config = new BoneCPConfig();
config.setJdbcUrl("jdbc:mysql://**.**.**.**:3306/test1"); config.setUsername("******");
config.setPassword("*******"); config.setMinConnectionsPerPartition(5);
config.setMaxConnectionsPerPartition(40);
config.setPartitionCount(1);
connectionPool = new BoneCP(config); // setup the connection pool
catch (SQLException e) {
e.printStackTrace(System.out);
[/code]
Then for insert and update queries we do this and below we make sure closed the statement.
[code]
Statement stmt1 = null;
stmt1 = dbconn.createStatement();
String insertQuery3 =........
count = stmt9.executeUpdate(insertQuery3);
try{
if ( stmt1!= null ){ stmt1.close();
else{
System.out.println("No stm1 exist");
}catch(SQLException ex){ System.out.println("SQLException has been caught for stmt1");
ex.printStackTrace(System.out);
For select we do this
Statement stmt2 = null;
stmt2 = dbconn.createStatement();
String selectQuery2= .........
ResultSet rs2 = stmt2.executeQuery(selectQuery2);
if(rs2.next())
try{
if ( rs2!= null ){ rs2.close();
} else{
System.out.println("No rs2 exist");
if ( stmt2!= null ){ stmt2.close();
} else{
System.out.println("No stm2 exist");
}catch(SQLException ex){ System.out.println("SQLException has been caught for stmt2");
ex.printStackTrace(System.out);
[/code]
Thus we have ensured that every resultset and statement is closed immediately after its use. The problem now when we took few sample from MAT is show increasing memory usage as below.
Sample 1
[code]
21 instances of "com.mysql.jdbc.JDBC4Connection", loaded by "sun.misc.Launcher$ExtClassLoader @ 0xf000a4f0" occupy 11,793,200 (76.19%) bytes.
Biggest instances:
com.mysql.jdbc.JDBC4Connection @ 0xf016d728 - 958,096 (6.19%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf0094478 - 875,568 (5.66%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf0201ba0 - 816,048 (5.27%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf04ab3f0 - 754,016 (4.87%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf006ee40 - 727,024 (4.70%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf0076a90 - 663,872 (4.29%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf04ad490 - 618,200 (3.99%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf00b7bd0 - 616,608 (3.98%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf0467bc0 - 612,544 (3.96%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf015fcf0 - 598,400 (3.87%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf021c830 - 584,992 (3.78%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf0097818 - 561,224 (3.63%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf01a27c0 - 531,816 (3.44%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf00bea28 - 531,416 (3.43%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf01c2d80 - 522,184 (3.37%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf04693e0 - 482,992 (3.12%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf012b158 - 453,256 (2.93%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf147f438 - 424,656 (2.74%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf15ff7d0 - 187,008 (1.21%) bytes.
Keywords
com.mysql.jdbc.JDBC4Connection
sun.misc.Launcher$ExtClassLoader @ 0xf000a4f0
file:///C:/Documents%20and%20Settings/ss/Local%20Settings/Temp/report2060944296830228239/pages/18.html# Reference Pattern
Class Name
Shallow Heap
Retained Heap
Percentage
class java.lang.Thread @ 0xf0003840
40
208
0.00%
[/code]
Sample 2
[code]
21 instances of "com.mysql.jdbc.JDBC4Connection", loaded by "sun.misc.Launcher$ExtClassLoader @ 0xf000a4f0" occupy 13,827,392 (78.27%) bytes.
Biggest instances:
com.mysql.jdbc.JDBC4Connection @ 0xf016d728 - 1,093,888 (6.19%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf0094478 - 957,888 (5.42%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf0201ba0 - 916,672 (5.19%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf04ab3f0 - 878,392 (4.97%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf006ee40 - 841,136 (4.76%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf015fcf0 - 758,336 (4.29%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf04ad490 - 747,240 (4.23%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf0076a90 - 735,712 (4.16%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf00b7bd0 - 700,912 (3.97%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf0467bc0 - 681,336 (3.86%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf00bea28 - 668,080 (3.78%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf021c830 - 658,816 (3.73%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf0097818 - 638,208 (3.61%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf01a27c0 - 605,376 (3.43%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf01c2d80 - 582,104 (3.29%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf04693e0 - 558,344 (3.16%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf147f438 - 523,952 (2.97%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf012b158 - 508,232 (2.88%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf1603618 - 276,944 (1.57%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf15ff7d0 - 275,288 (1.56%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf148fd70 - 220,536 (1.25%) bytes.
Keywords
com.mysql.jdbc.JDBC4Connection
sun.misc.Launcher$ExtClassLoader @ 0xf000a4f0
file:///C:/Documents%20and%20Settings/ss/Local%20Settings/Temp/report8548522855535006676/pages/18.html# Reference Pattern
Class Name
Shallow Heap
Retained Heap
Percentage
class java.lang.Thread @ 0xf0003840
40
208
0.00%
[/code]
Sample 3
[code]
21 instances of "com.mysql.jdbc.JDBC4Connection", loaded by "sun.misc.Launcher$ExtClassLoader @ 0xf000a4f0" occupy 17,339,632 (80.79%) bytes.
Biggest instances:
com.mysql.jdbc.JDBC4Connection @ 0xf016d728 - 1,228,048 (5.72%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf0094478 - 1,144,056 (5.33%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf0201ba0 - 1,126,120 (5.25%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf04ab3f0 - 1,074,552 (5.01%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf006ee40 - 993,912 (4.63%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf0076a90 - 931,512 (4.34%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf015fcf0 - 930,952 (4.34%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf04ad490 - 918,176 (4.28%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf00bea28 - 874,512 (4.07%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf0467bc0 - 846,368 (3.94%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf00b7bd0 - 838,448 (3.91%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf021c830 - 799,184 (3.72%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf0097818 - 791,256 (3.69%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf01a27c0 - 763,264 (3.56%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf01c2d80 - 745,088 (3.47%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf012b158 - 710,704 (3.31%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf04693e0 - 704,072 (3.28%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf147f438 - 680,400 (3.17%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf1603618 - 458,472 (2.14%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf148fd70 - 390,984 (1.82%) bytes.
com.mysql.jdbc.JDBC4Connection @ 0xf15ff7d0 - 389,552 (1.82%) bytes.
Keywords
com.mysql.jdbc.JDBC4Connection
sun.misc.Launcher$ExtClassLoader @ 0xf000a4f0
file:///C:/Documents%20and%20Settings/ss/Local%20Settings/Temp/report3656754586920669017/pages/18.html# Reference Pattern
Class Name
Shallow Heap
Retained Heap
Percentage
class java.lang.Thread @ 0xf0003840
40
208
0.00%
[/code]
Dear Masijade,
Actually I was confuse with where to put and not to put the try and catch. Below is how my skeleton of my codes will be looking like. I just put one sample query there. If you notice at the very end finally I already have even now dbconn.close(); which closes the pooling connection. The problem I am worried now is that incase there is any exception how will it be rollbacked. Because if you notice now I lump all the queries under one big try and catch but with your suggestion I have to do try and catch for each query right?
[code]
BoneCP connectionPool = null;
class ConnectionHandler implements Runnable {
private Socket receivedSocketConn1;
ConnectionHandler(Socket receivedSocketConn1) {
this.receivedSocketConn1=receivedSocketConn1;
Connection dbconn = null;
public void run() { // etc
BufferedWriter writeBuffer = null;
BufferedReader readBuffer = null;
String capturedMessage="";
try{
dbconn = connectionPool.getConnection();
dbconn.setAutoCommit(false);
while ((nextChar=readBuffer.read()) != -1){
capturedMessage += (char) nextChar;
if (nextChar == '*')
try{
//all queries here.
try{
Statement stmt1 = null;
stmt1 = dbconn.createStatement();
try{
String updateCommand1 = //query
count = stmt1.executeUpdate(updateCommand1);
finally{
if( stmt1 != null ){
stmt1.close();
else{
System.out.println("stmt1 is null in finally close");
catch(SQLException ex){
ex.printStackTrace(System.out);
dbconn.commit
catch (SQLException ex){
ex.printStackTrace(System.out);
try{
dbconn.rollback();
catch (Exception rollback){
rollback.printStackTrace(System.out);
catch (Exception e){
e.printStackTrace(System.out);
try{
dbconn.rollback();
catch (Exception rollback){
rollback.printStackTrace(System.out);
finally
catch (SocketTimeoutException ex){
ex.printStackTrace();
catch (IOException ex){
ex.printStackTrace();
catch (Exception ex){
ex.printStackTrace(System.out);
finally{
try{
if ( dbconn != null ){
dbconn.close();
else{
System.out.println("dbConn is null in finally close");
catch(SQLException ex){
ex.printStackTrace();
try{
if ( writeBuffer != null ){
writeBuffer.close();
else{
System.out.println("w is null in finally close");
catch(IOException ex){
ex.printStackTrace(System.out);
[/code]
Similar Messages
-
Hi all,
I got this error when I tried to execute a simple JSF app. I am using JDeveloper 10.1.3 release edition. Please advice
[Starting OC4J using the following ports: HTTP=8988, RMI=23891, JMS=9227.]
**** Unable to obtain password from principals.xml. Using default.
C:\JDeveloper10g\jdev\system\oracle.j2ee.10.1.3.36.73\embedded-oc4j\config>
C:\JDeveloper10g\jdk\bin\javaw.exe -ojvm -classpath C:\JDeveloper10g\j2ee\home\oc4j.jar;C:\JDeveloper10g\jdev\lib\jdev-oc4j-embedded.jar -Xverify:none -DcheckForUpdates=adminClientOnly -Doracle.application.environment=development -Doracle.j2ee.dont.use.memory.archive=true -Doracle.j2ee.http.socket.timeout=500 -Doc4j.jms.usePersistenceLockFiles=false oracle.oc4j.loader.boot.BootStrap -config C:\JDeveloper10g\jdev\system\oracle.j2ee.10.1.3.36.73\embedded-oc4j\config\server.xml
[waiting for the server to complete its initialization...]
2006-01-31 21:40:47.062 NOTIFICATION Auto-unpacking C:\JDeveloper10g\jdev\system\oracle.j2ee.10.1.3.36.73\embedded-oc4j\applications\dms.war...
2006-01-31 21:40:47.093 NOTIFICATION Unjar C:\JDeveloper10g\jdev\system\oracle.j2ee.10.1.3.36.73\embedded-oc4j\applications\dms.war in C:\JDeveloper10g\jdev\system\oracle.j2ee.10.1.3.36.73\embedded-oc4j\applications\dms
2006-01-31 21:40:47.093 NOTIFICATION Finished auto-unpacking C:\JDeveloper10g\jdev\system\oracle.j2ee.10.1.3.36.73\embedded-oc4j\applications\dms.war
2006-01-31 21:40:47.156 NOTIFICATION Auto-unpacking C:\JDeveloper10g\jdev\system\oracle.j2ee.10.1.3.36.73\embedded-oc4j\connectors\datasources\datasources.rar...
2006-01-31 21:40:47.156 NOTIFICATION Unjar C:\JDeveloper10g\jdev\system\oracle.j2ee.10.1.3.36.73\embedded-oc4j\connectors\datasources\datasources.rar in C:\JDeveloper10g\jdev\system\oracle.j2ee.10.1.3.36.73\embedded-oc4j\connectors\datasources\datasources
2006-01-31 21:40:47.171 NOTIFICATION Finished auto-unpacking C:\JDeveloper10g\jdev\system\oracle.j2ee.10.1.3.36.73\embedded-oc4j\connectors\datasources\datasources.rar
2006-01-31 21:40:47.218 NOTIFICATION Auto-unpacking C:\JDeveloper10g\jdev\system\oracle.j2ee.10.1.3.36.73\embedded-oc4j\applications\bc4j.ear...
2006-01-31 21:40:47.281 NOTIFICATION Unjar C:\JDeveloper10g\jdev\system\oracle.j2ee.10.1.3.36.73\embedded-oc4j\applications\bc4j.ear in C:\JDeveloper10g\jdev\system\oracle.j2ee.10.1.3.36.73\embedded-oc4j\applications\bc4j
2006-01-31 21:40:47.359 NOTIFICATION Finished auto-unpacking C:\JDeveloper10g\jdev\system\oracle.j2ee.10.1.3.36.73\embedded-oc4j\applications\bc4j.ear
2006-01-31 21:40:47.375 NOTIFICATION Auto-unpacking C:\JDeveloper10g\jdev\system\oracle.j2ee.10.1.3.36.73\embedded-oc4j\applications\bc4j\webapp.war...
2006-01-31 21:40:47.375 NOTIFICATION Unjar C:\JDeveloper10g\jdev\system\oracle.j2ee.10.1.3.36.73\embedded-oc4j\applications\bc4j\webapp.war in C:\JDeveloper10g\jdev\system\oracle.j2ee.10.1.3.36.73\embedded-oc4j\applications\bc4j\webapp
2006-01-31 21:40:59.296 NOTIFICATION Finished auto-unpacking C:\JDeveloper10g\jdev\system\oracle.j2ee.10.1.3.36.73\embedded-oc4j\applications\bc4j\webapp.war
2006-01-31 21:41:08.421 WARNING J2EE OJR0107 Exception creating connection pool. Exception: oracle.oc4j.sql.config.DataSourceConfigException: Unable to create : com.mysql.jdbc.Driver
06/01/31 21:41:08 SEVERE: ApplicationStateRunning.initConnector Error occurred initializing connectors. Exception is: Exception creating connection pool. Exception: oracle.oc4j.sql.config.DataSourceConfigException: Unable to create : com.mysql.jdbc.Driver
Jan 31, 2006 9:41:08 PM com.evermind.server.ApplicationStateRunning initConnector
SEVERE: Error occurred initializing connectors. Exception is: Exception creating connection pool. Exception: oracle.oc4j.sql.config.DataSourceConfigException: Unable to create : com.mysql.jdbc.Driver
06/01/31 21:41:08 SEVERE: ApplicationStateRunning.initConnector Stack trace: oracle.oc4j.sql.DataSourceException: Exception creating connection pool. Exception: oracle.oc4j.sql.config.DataSourceConfigException: Unable to create : com.mysql.jdbc.Driver
at com.evermind.server.ApplicationStateRunning.initDataSourceConnectionPool(ApplicationStateRunning.java:2016)
at com.evermind.server.ApplicationStateRunning.initDataSourceConnector(ApplicationStateRunning.java:1961)
at com.evermind.server.ApplicationStateRunning.initConnector(ApplicationStateRunning.java:1220)
at com.evermind.server.ApplicationStateRunning.initConnectors(ApplicationStateRunning.java:356)
at com.evermind.server.ApplicationStateRunning.initializeApplication(ApplicationStateRunning.java:208)
at com.evermind.server.Application.setConfig(Application.java:391)
at com.evermind.server.Application.setConfig(Application.java:309)
at com.evermind.server.ApplicationServer.addApplication(ApplicationServer.java:1771)
at com.evermind.server.ApplicationServer.initializeDeployedApplications(ApplicationServer.java:1532)
at com.evermind.server.ApplicationServer.setConfig(ApplicationServer.java:939)
at com.evermind.server.ApplicationServerLauncher.run(ApplicationServerLauncher.java:113)
at java.lang.Thread.run(Thread.java:595)
Caused by: javax.resource.ResourceException: oracle.oc4j.sql.config.DataSourceConfigException: Unable to create : com.mysql.jdbc.Driver
at oracle.oc4j.sql.spi.ResourceAdapterImpl.createDataSourceConnectionPool(ResourceAdapterImpl.java:106)
at oracle.oc4j.sql.DataSourceUtils.getDataSourceConnectionPool(DataSourceUtils.java:322)
at com.evermind.server.ApplicationStateRunning.initDataSourceConnectionPool(ApplicationStateRunning.java:1997)
... 11 more
Caused by: oracle.oc4j.sql.config.DataSourceConfigException: Unable to create : com.mysql.jdbc.Driver
at oracle.oc4j.sql.config.DataSourceConfigUtils.createConnectionFactory(DataSourceConfigUtils.java:247)
at oracle.oc4j.sql.DataSourceConnectionPoolImpl.<init>(DataSourceConnectionPoolImpl.java:107)
at oracle.oc4j.sql.spi.ResourceAdapterImpl.createDataSourceConnectionPool(ResourceAdapterImpl.java:99)
... 13 more
Caused by: oracle.classloader.util.AnnotatedClassNotFoundException:
Missing class: com.mysql.jdbc.Driver
Dependent class: oracle.oc4j.sql.config.DataSourceConfigUtils
Loader: oc4j:10.1.3
Code-Source: /C:/JDeveloper10g/j2ee/home/lib/oc4j-internal.jar
Configuration: <code-source> in META-INF/boot.xml in C:\JDeveloper10g\j2ee\home\oc4j.jar
This load was initiated at current-workspace-app.root:0.0.0 using the Class.forName() method.
The missing class is not available from any code-source or loader in the system.
at oracle.classloader.PolicyClassLoader.handleClassNotFound(PolicyClassLoader.java:2061)
at oracle.classloader.PolicyClassLoader.internalLoadClass(PolicyClassLoader.java:1665)
at oracle.classloader.PolicyClassLoader.loadClass(PolicyClassLoader.java:1621)
at oracle.classloader.PolicyClassLoader.loadClass(PolicyClassLoader.java:1606)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:242)
at oracle.oc4j.sql.config.DataSourceConfigUtils.createConnectionFactory(DataSourceConfigUtils.java:244)
... 15 more
Jan 31, 2006 9:41:08 PM com.evermind.server.ApplicationStateRunning initConnector
SEVERE: Stack trace: oracle.oc4j.sql.DataSourceException: Exception creating connection pool. Exception: oracle.oc4j.sql.config.DataSourceConfigException: Unable to create : com.mysql.jdbc.Driver
at com.evermind.server.ApplicationStateRunning.initDataSourceConnectionPool(ApplicationStateRunning.java:2016)
at com.evermind.server.ApplicationStateRunning.initDataSourceConnector(ApplicationStateRunning.java:1961)
at com.evermind.server.ApplicationStateRunning.initConnector(ApplicationStateRunning.java:1220)
at com.evermind.server.ApplicationStateRunning.initConnectors(ApplicationStateRunning.java:356)
at com.evermind.server.ApplicationStateRunning.initializeApplication(ApplicationStateRunning.java:208)
at com.evermind.server.Application.setConfig(Application.java:391)
at com.evermind.server.Application.setConfig(Application.java:309)
at com.evermind.server.ApplicationServer.addApplication(ApplicationServer.java:1771)
at com.evermind.server.ApplicationServer.initializeDeployedApplications(ApplicationServer.java:1532)
at com.evermind.server.ApplicationServer.setConfig(ApplicationServer.java:939)
at com.evermind.server.ApplicationServerLauncher.run(ApplicationServerLauncher.java:113)
at java.lang.Thread.run(Thread.java:595)
Caused by: javax.resource.ResourceException: oracle.oc4j.sql.config.DataSourceConfigException: Unable to create : com.mysql.jdbc.Driver
at oracle.oc4j.sql.spi.ResourceAdapterImpl.createDataSourceConnectionPool(ResourceAdapterImpl.java:106)
at oracle.oc4j.sql.DataSourceUtils.getDataSourceConnectionPool(DataSourceUtils.java:322)
at com.evermind.server.ApplicationStateRunning.initDataSourceConnectionPool(ApplicationStateRunning.java:1997)
... 11 more
Caused by: oracle.oc4j.sql.config.DataSourceConfigException: Unable to create : com.mysql.jdbc.Driver
at oracle.oc4j.sql.config.DataSourceConfigUtils.createConnectionFactory(DataSourceConfigUtils.java:247)
at oracle.oc4j.sql.DataSourceConnectionPoolImpl.<init>(DataSourceConnectionPoolImpl.java:107)
at oracle.oc4j.sql.spi.ResourceAdapterImpl.createDataSourceConnectionPool(ResourceAdapterImpl.java:99)
... 13 more
Caused by: oracle.classloader.util.AnnotatedClassNotFoundException:
Missing class: com.mysql.jdbc.Driver
Dependent class: oracle.oc4j.sql.config.DataSourceConfigUtils
Loader: oc4j:10.1.3
Code-Source: /C:/JDeveloper10g/j2ee/home/lib/oc4j-internal.jar
Configuration: <code-source> in META-INF/boot.xml in C:\JDeveloper10g\j2ee\home\oc4j.jar
This load was initiated at current-workspace-app.root:0.0.0 using the Class.forName() method.
The missing class is not available from any code-source or loader in the system.
at oracle.classloader.PolicyClassLoader.handleClassNotFound(PolicyClassLoader.java:2061)
at oracle.classloader.PolicyClassLoader.internalLoadClass(PolicyClassLoader.java:1665)
at oracle.classloader.PolicyClassLoader.loadClass(PolicyClassLoader.java:1621)
at oracle.classloader.PolicyClassLoader.loadClass(PolicyClassLoader.java:1606)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:242)
at oracle.oc4j.sql.config.DataSourceConfigUtils.createConnectionFactory(DataSourceConfigUtils.java:244)
... 15 more
06/01/31 21:41:08 WARNING: Application.setConfig Application: current-workspace-app is in failed state as initialization failedjava.lang.InstantiationException: Error occurred initializing connectors. Exception is: Exception creating connection pool. Exception: oracle.oc4j.sql.config.DataSourceConfigException: Unable to create : com.mysql.jdbc.Driver
Jan 31, 2006 9:41:08 PM com.evermind.server.Application setConfig
WARNING: Application: current-workspace-app is in failed state as initialization failedjava.lang.InstantiationException: Error occurred initializing connectors. Exception is: Exception creating connection pool. Exception: oracle.oc4j.sql.config.DataSourceConfigException: Unable to create : com.mysql.jdbc.Driver
2006-01-31 21:41:08.531 WARNING J2EE 0JR0013 Exception initializing deployed application: current-workspace-app. Error occurred initializing connectors. Exception is: Exception creating connection pool. Exception: oracle.oc4j.sql.config.DataSourceConfigException: Unable to create : com.mysql.jdbc.Driver
Ready message received from Oc4jNotifier.
Embedded OC4J startup time: 29125 ms.I did what Manu suggested with no success. Alternatively, I registered the driver jar with embedded OC4J preferences > global > libraries. Still does not work. Please, note, that when I run JUnit tests against my BC4J application modules with JDBC URL as connection type, everything works just fine. The problem comes while running the JSF application when the application module is using JDBC DataSource as connection type.
-
Hi
I have impoted project file in eclipse in new machine using option import from existing workbence . When i stat to debug this project ,
i am getting error as class not found exception : com.mysql.jdbc.driver . my project folder already consist of mysql .jar file in /web appls/web-inf folder.
Application is running successfully in other machine from where i took the application file. As this error appeared I also added jar file into project path as Project ---->properties-- build java path---libraries----add external jar file.
kindly hep me.Sounds like an eclipse question - not a JDBC one.
But since eclipse is telling you it can't find it then it means it is not in the eclipse path. So you must add it. (The fact that it is somewhere is irrelevant - all that matters is it is not in the class path.) -
Error in Class.forName("com.mysql.jdbc.driver")
Hi forum,
Please help me to solve the issue.
im using the following jsp code for genrating the reports using JASPER REPORTS
the JSP FILE
<%@ page contentType="text/html;charset=windows-1252"%>
<%@ page import="java.io.*"%>
<%@ page import="java.util.*"%>
<%@ page import="java.sql.*"%>
<%@ page import="javax.sql.DataSource"%>
<%@ page import="javax.naming.InitialContext"%>
<%@ page import="net.sf.jasperreports.engine.*"%>
<%@ page import="net.sf.jasperreports.engine.design.JasperDesign"%>
<%@ page import="net.sf.jasperreports.engine.xml.JRXmlLoader"%>
<%@ page import="net.sf.jasperreports.engine.export.*" %>
<%@ page import ="net.sf.jasperreports.engine.*"%>
<%@ page import ="net.sf.jasperreports.engine.JasperFillManager"%>
<%@ page import ="net.sf.jasperreports.engine.JRException"%>
<%@ page import="net.sf.jasperreports.engine.JasperReport"%>
<%@ page import="net.sf.jasperreports.engine.JasperPrint"%>
<html>
<body bgcolor="00ffcc">
<%
try{
Connection con = null;
String url="jdbc:mysql://localhost/customer";
String username = "root";
String password = "cmsadmin";
InputStream input=new FileInputStream(new File("C:/Documents and Settings/user/My Documents/NetBeansProjects/jasperreports/web/helloworld.xml"));
JasperDesign design = JRXmlLoader.load(input);
JasperReport report = JasperCompileManager.compileReport(design);
Map params = new HashMap();
params.put("reportTitle", "helloworld");
params.put("author", "Muthu Kumar");
params.put("startDate", (new java.util.Date()).toString());
params.put("ReportTitle", "PDF JasperReport");
<img class="emoticon" src="images/emoticons/confused.gif" border="0" alt="" />Class.forName("com.mysql.jdbc.Driver");<img class="emoticon" src="images/emoticons/confused.gif" border="0" alt="" /><img src="images/emoticons/confused.gif" border="0" alt="" />
con = DriverManager.getConnection(url,username,password);
JasperPrint print = JasperFillManager.fillReport(report, params, con);
OutputStream output=new FileOutputStream(new File("C:/Documents and Settings/user/My Documents/NetBeansProjects/jasperreports/helloreportworld.pdf"));
JasperExportManager.exportReportToPdfStream(print, output);
// JasperViewer.viewReport(print);
catch(SQLException es) {
out.println(es);
catch(JRException ex){
//ex.printStackTrace();
out.println(ex);
%>
</body>
</html>The error it is saying is in the line Class.forName(....) ;
Please look for the emoctions with question mark
i DOn know what to do.
Please help
Im comparin the below JRXML file as with the above code
<?xml version="1.0"?>
<!DOCTYPE jasperReport
PUBLIC "-//JasperReports//DTD Report Design//EN"
"http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">
<jasperReport name="helloworld">
<parameter name="reportTitle" class="java.lang.String"/>
<parameter name="author" class="java.lang.String"/>
<parameter name="startDate" class="java.lang.String"/>
<queryString>
<![CDATA[SELECT * FROM customer order by UserID ]]>
</queryString>
<field name="UserID" class="java.lang.String"/>
<field name="UserName" class="java.lang.String"/>
<field name="City" class="java.lang.String"/>
<field name="State" class="java.lang.String"/>
<title>
<band height="60">
<textField>
<reportElement x="0" y="10" width="500" height="40"/>
<textElement textAlignment="Center">
<font size="24"/>
</textElement>
<textFieldExpression class="java.lang.String">
<![CDATA[$P{reportTitle}]]>
</textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="40" width="500" height="20"/>
<textElement textAlignment="Center"/>
<textFieldExpression class="java.lang.String">
<![CDATA["Run by: " + $P{author}
+ " on " + $P{startDate}]]>
</textFieldExpression>
</textField>
</band>
</title>
<columnHeader>
<band height="30">
<rectangle>
<reportElement x="0" y="0" width="500" height="25"/>
<graphicElement/>
</rectangle>
<staticText>
<reportElement x="5" y="5" width="50" height="15"/>
<textElement/>
<text><![CDATA[UserID]]></text>
</staticText>
<staticText>
<reportElement x="55" y="5" width="150" height="15"/>
<text><![CDATA[UserName]]></text>
</staticText>
<staticText>
<reportElement x="205" y="5" width="255" height="15"/>
<text><![CDATA[City, State]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="20">
<textField>
<reportElement x="5" y="0" width="50" height="15"/>
<textElement/>
<textFieldExpression class="java.lang.String">
<![CDATA[$F{UserID}]]>
</textFieldExpression>
</textField>
<textField>
<reportElement x="55" y="0" width="150" height="15"/>
<textElement/>
<textFieldExpression class="java.lang.String">
<![CDATA[$F{UserName}]]>
</textFieldExpression>
</textField>
<textField>
<reportElement x="205" y="0" width="255" height="15"/>
<textElement/>
<textFieldExpression class="java.lang.String">
<![CDATA[$F{City} + ", " + $F{State}]]>
</textFieldExpression>
</textField>
</band>
</detail>
</jasperReport>Glass_Fish wrote:
I have set the classpath in the environment variables in the my computer properties.The web container has it's own properties. The "system" classpath means absolutely nothing to it. Read your server's documentation. -
Hello,
I have set a database and I am trying to show a simple select.I have this code for example:
String SQL = "SELECT * FROM DatabaseName.tableName";
stmt = (Statement) conn.createStatement();
rs = (ResultSet) stmt.executeQuery(SQL);
while (rs.next()) {
System.out.println(rs.getArray(3));
}And all I get is an exception:
com.mysql.jdbc.NotImplemented: Feature not implemented
at com.mysql.jdbc.ResultSet.getArray(ResultSet.java:1043)
Is this right?I have tried other methods but I get the above.How to show the result.
It is in 3rd column double value.Are you guys always this cranky? Who's cranky? It's important for the integrity of these forums that misinformation isn't left lying around uncorrected. If that makes you cranky, try elsewhere where the standards may not be so high.
I posted something that works, now is it exactly as whatever getArray does?No.
Probably not.Just a minute. You said here that 'the work around code' is something like this, and here that 'it actually is the same result'. You were mistaken. Twice. You are now in the process of changing your mind. Let me help you. It is definitely not exactly what getArray() does. Not even close. Completely different. getArray() gets an array directly from the database from a single column in the current row in the result set. Your code constructs an array from a single column across all rows in the result set. There is no comparison.
What's wrong with helping outWhat's wrong with getting it right? What's wrong with pointing out an error? What's wrong with admitting when you're mistaken? What's wrong with alerting the OP not to mention all future readers of this thread that it contains misinformation? What's wrong with you finding out that you were wrong?
and posting what you think it should say
rather than just being negative?As a matter of fact nobody was 'just negative'. I pointed out exactly what the difference between your code and getArray() is. But by 'negative' do you mean pointing out that you were wrong? Nothing wrong with that. -
Com.mysql.jdbc.PacketTooBigException when creating a DB Table resource
Hellos.
I am trying to add an Oracle Database Table resource to my IDM 6.0 system.
On the the last screen of the wizard, when I save my details, I see this error in red:
==> com.mysql.jdbc.PacketTooBigException: Packet for query is too large (1340540 > 1048576). You can change this value on the server by setting the max_allowed_packet' variable.
I have a mysql repository and use Tomcat 4.1 (on Windows).
Questions...
What file do I edit?
Do I add this parameter.. if so what value do I use?
Who else has seen this?
thanks.. GFYou need to change "my.ini" file for MySQL, usualy it is in windows folder.
Change the value of 'max_allowed_packet' in my.ini file to some thing like 16M.
I hope it helps..
--Vipul -
Hi,
I am developing web application using jsf2.0. problem is ,
when we interact with servlet by single person, It working fine. but when we interact with servlet by more then one person at same time. server throws error
SEVERE: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
Last packet sent to the server was 0 ms ago.
How to solve the problem.
server :Glashfish v3
db :mysql 5.0
thanks in advance.You must use a connection and then immediately close it.
-
Com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException
Hi All,
I want to connect to a stored procedure that is on mySQL database via BPEL and Jdeveloper 11.1.1.5
The version of the MySQL database:
mysqld Ver 5.1.53
I am using the following driver :
mysql-connector-java-5.1.25-bin
I have pointed my JDeveloper to the new driver
By doing the following :
JDeveloper > Tools > Manage Libraries > ...
When I test the connection it give me a success.
In creating a new BPEL partnerlink - DatabaseAdapter with the new Connection to the MySQL and it seems to work, when I want to select from a table.
But when I use the option Call stored procedure or function, using the schema aci. I can see the stored procedure aci_insert but when I want to select it, I am getting the following:
An Error occured while obtaining arguments/source code for the selected stored procedure. Verify that the database connection is valid.
Details :
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown table 'parameters' in information_schema
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.Util.getInstance(Util.java:386)
I am selecting the aci schema, but do not know why it keep on refering to information_schemaSeems I miss something.
IS there only two MySQL schema ?
One to set up from sql file from Higgins server, the other is
automatically set up by rpps-axis. I have both schema, maybe the one from
Higgins is not uptodate (but I think it is). Or maybe I have to set up an
other table but I didn't read about it.
PS :
There is some errors with eclipse componment. It's needed to had in
rpps-axis/WEB-INF/lib/ the following files :
org.eclipse.runtime.IExtensionRegistry
org.eclipse.core.runtime
org.eclipse.equinox.common
org.eclipse.osgi
Don't know if needed to work. -
Hi,All
Need Help regarding the exception.
As i tried so many way to solve this problem but cound'nt find out the solution.!!! If i restart the server then this error is resolved but for the some time.,after 4-5 hour again i need to restart the server.
so please help me out from this problem!!!!!!
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: #{cityf.OrderToConsumerCity}: javax.faces.el.EvaluationException: org.hibernate.exception.JDBCConnectionException: could not execute query
javax.faces.webapp.FacesServlet.service(FacesServlet.java:225)
org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127)
org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:277)
root cause
javax.faces.FacesException: #{cityf.OrderToConsumerCity}: javax.faces.el.EvaluationException: org.hibernate.exception.JDBCConnectionException: could not execute query
com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:98)
javax.faces.component.UICommand.broadcast(UICommand.java:332)
org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxViewRoot.java:180)
org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:158)
org.ajax4jsf.framework.ajax.AjaxViewRoot.processApplication(AjaxViewRoot.java:346)
com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:95)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:110)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:213)
org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127)
org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:277)
root cause
javax.faces.el.EvaluationException: org.hibernate.exception.JDBCConnectionException: could not execute query
com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:150)
com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:92)
javax.faces.component.UICommand.broadcast(UICommand.java:332)
org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxViewRoot.java:180)
org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:158)
org.ajax4jsf.framework.ajax.AjaxViewRoot.processApplication(AjaxViewRoot.java:346)
com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:95)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:110)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:213)
org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127)
org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:277)
root cause
org.hibernate.exception.JDBCConnectionException: could not execute query
org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:74)
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
org.hibernate.loader.Loader.doList(Loader.java:2223)
org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
org.hibernate.loader.Loader.list(Loader.java:2099)
org.hibernate.hql.classic.QueryTranslatorImpl.list(QueryTranslatorImpl.java:912)
org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
com.etelic.dao.ConsumerDAOHibernate.getCityList(ConsumerDAOHibernate.java:153)
com.etelic.controller.City.OrderToConsumerCity(City.java:286)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:146)
com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:92)
javax.faces.component.UICommand.broadcast(UICommand.java:332)
org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxViewRoot.java:180)
org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:158)
org.ajax4jsf.framework.ajax.AjaxViewRoot.processApplication(AjaxViewRoot.java:346)
com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:95)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:110)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:213)
org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127)
org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:277)
root cause
com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException: No operations allowed after connection closed.Connection was implicitly closed due to underlying exception/error:
** BEGIN NESTED EXCEPTION **
com.mysql.jdbc.CommunicationsException
MESSAGE: Communications link failure due to underlying exception:
** BEGIN NESTED EXCEPTION **
java.io.EOFException
STACKTRACE:
java.io.EOFException
at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1956)
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2368)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2867)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1616)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1708)
at com.mysql.jdbc.Connection.execSQL(Connection.java:3255)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1293)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1428)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1787)
at org.hibernate.loader.Loader.doQuery(Loader.java:674)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
at org.hibernate.loader.Loader.doList(Loader.java:2220)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
at org.hibernate.loader.Loader.list(Loader.java:2099)
at org.hibernate.hql.classic.QueryTranslatorImpl.list(QueryTranslatorImpl.java:912)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
at com.etelic.dao.ConsumerDAOHibernate.getDelhiLocalityListByPincode(ConsumerDAOHibernate.java:116)
at com.etelic.bo.ConsumerBO.getDelhiLocalityListByPincode(ConsumerBO.java:44)
at com.etelic.manager.ConsumerManager.getDelhiLocalityList(ConsumerManager.java:38)
at com.etelic.controller.ConsumerSearchParametersInput.search(ConsumerSearchParametersInput.java:275)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:146)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:92)
at javax.faces.component.UICommand.broadcast(UICommand.java:332)
at org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxViewRoot.java:180)
at org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:158)
at org.ajax4jsf.framework.ajax.AjaxViewRoot.processApplication(AjaxViewRoot.java:346)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:95)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:110)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:213)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127)
at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:277)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)
** END NESTED EXCEPTION **
Last packet sent to the server was 15 ms ago.
STACKTRACE:
com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:
** BEGIN NESTED EXCEPTION **
java.io.EOFException
STACKTRACE:
*java.io.EOFException*
* at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1956)* at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2368)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2867)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1616)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1708)
at com.mysql.jdbc.Connection.execSQL(Connection.java:3255)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1293)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1428)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1787)
at org.hibernate.loader.Loader.doQuery(Loader.java:674)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
at org.hibernate.loader.Loader.doList(Loader.java:2220)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
at org.hibernate.loader.Loader.list(Loader.java:2099)
at org.hibernate.hql.classic.QueryTranslatorImpl.list(QueryTranslatorImpl.java:912)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
at com.etelic.dao.ConsumerDAOHibernate.getDelhiLocalityListByPincode(ConsumerDAOHibernate.java:116)
at com.etelic.bo.ConsumerBO.getDelhiLocalityListByPincode(ConsumerBO.java:44)
at com.etelic.manager.ConsumerManager.getDelhiLocalityList(ConsumerManager.java:38)
at com.etelic.controller.ConsumerSearchParametersInput.search(ConsumerSearchParametersInput.java:275)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:146)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:92)
at javax.faces.component.UICommand.broadcast(UICommand.java:332)
at org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxViewRoot.java:180)
at org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:158)
at org.ajax4jsf.framework.ajax.AjaxViewRoot.processApplication(AjaxViewRoot.java:346)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:95)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:110)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:213)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127)
at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:277)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)
** END NESTED EXCEPTION **
Last packet sent to the server was 15 ms ago.
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2579)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2867)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1616)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1708)
at com.mysql.jdbc.Connection.execSQL(Connection.java:3255)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1293)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1428)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1787)
at org.hibernate.loader.Loader.doQuery(Loader.java:674)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
at org.hibernate.loader.Loader.doList(Loader.java:2220)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
at org.hibernate.loader.Loader.list(Loader.java:2099)
at org.hibernate.hql.classic.QueryTranslatorImpl.list(QueryTranslatorImpl.java:912)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
at com.etelic.dao.ConsumerDAOHibernate.getDelhiLocalityListByPincode(ConsumerDAOHibernate.java:116)
at com.etelic.bo.ConsumerBO.getDelhiLocalityListByPincode(ConsumerBO.java:44)
at com.etelic.manager.ConsumerManager.getDelhiLocalityList(ConsumerManager.java:38)
at com.etelic.controller.ConsumerSearchParametersInput.search(ConsumerSearchParametersInput.java:275)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:146)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:92)
at javax.faces.component.UICommand.broadcast(UICommand.java:332)
at org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxViewRoot.java:180)
at org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:158)
at org.ajax4jsf.framework.ajax.AjaxViewRoot.processApplication(AjaxViewRoot.java:346)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:95)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:110)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:213)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127)
at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:277)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)
** END NESTED EXCEPTION **
com.mysql.jdbc.SQLError.createSQLException(SQLError.java:888)
com.mysql.jdbc.Connection.checkClosed(Connection.java:1931)
com.mysql.jdbc.Connection.prepareStatement(Connection.java:4720)
com.mysql.jdbc.Connection.prepareStatement(Connection.java:4686)
org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:505)
org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:423)
org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547)
org.hibernate.loader.Loader.doQuery(Loader.java:673)
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
org.hibernate.loader.Loader.doList(Loader.java:2220)
org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
org.hibernate.loader.Loader.list(Loader.java:2099)
org.hibernate.hql.classic.QueryTranslatorImpl.list(QueryTranslatorImpl.java:912)
org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
com.etelic.dao.ConsumerDAOHibernate.getCityList(ConsumerDAOHibernate.java:153)
com.etelic.controller.City.OrderToConsumerCity(City.java:286)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:146)
com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:92)
javax.faces.component.UICommand.broadcast(UICommand.java:332)
org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxViewRoot.java:180)
org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:158)
org.ajax4jsf.framework.ajax.AjaxViewRoot.processApplication(AjaxViewRoot.java:346)
com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:95)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:110)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:213)
org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127)
org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:277)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.14 logs.
Apache Tomcat/6.0.14-Thanks and regards
Praveen SoniHey BalusC
As i already obtain a new session object from sessionfactory,for one or more transactions at once(!),
For reference see below code:
package com.dao>hibenateUtil;
import java.util.*;
import com.ConsumerRecord;
public class ConsumerDAOHibernate implements IConsumerDAO {
public Long getNumberMatchingQuery(ConsumerRecord upr){
String query = new String();
String queryStart = "select count(*) FROM person in CLASS com.ConsumerRecord";
query += queryStart;
org.hibernate.Query q = HibernateUtil.getSession().createQuery(query);
return (Long)q.uniqueResult();
public Long getNumberMatchingCity(ConsumerRecord upr){
String query = new String();
String queryStart = "select count(*) FROM city in CLASS com.ConsumerRecord";
query += queryStart;
org.hibernate.Query q = HibernateUtil.getSession().createQuery(query);
return (Long)q.uniqueResult();
Hibernate Util:-package com.dao;
import java.sql.Connection;
import java.sql.DriverManager;
import org.apache.log4j.Logger;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
public class HibernateUtil {
private static final SessionFactory sessionFactory;
private static Session session = null;
private static Logger logger = Logger.getLogger(HibernateUtil.class.getName());
static {
try {
/** TODO: change to IOC w/ datasource */
Configuration conf = new Configuration();
sessionFactory = conf.configure().buildSessionFactory();
} catch (Throwable ex) {
// Make sure you log the exception, as it might be swallowed
System.err.println("Initial SessionFactory creation failed." + ex);
throw new ExceptionInInitializerError(ex);
public static Session getSession() {
if(session == null){
try {
session = sessionFactory.openSession();
logger.debug("****************************new session being created**************************************");
//sessionFactory.
} catch (Throwable ex) {
// Make sure you log the exception, as it might be swallowed
System.err.println("Initial SessionFactory creation failed." + ex);
throw new ExceptionInInitializerError(ex);
return session;
} -
Com.mysql.jdbc.driver and jdbc:odbc bridge driver
Hi All,
I want to update mysql database from data in hashtable. My application already uses JDBC:OBDC bridge driver for retrieving data from excel sheet and putting in hashtable.
For connecting to mysql i need to use com.mysql.jdbc.driver too in the same code.
How to do that?
my code uses.
Read(String strFilePath,String strFileName)
filepath = strFilePath;
filename = strFileName;
strDriver= "jdbc:odbc:Driver={MicroSoft Excel Driver (*.xls)}";ThanksPlease stay with one thread:
http://forum.java.sun.com/thread.jspa?threadID=5145466&tstart=0
Please don't cross-post this way. -
Com.mysql.jdbc.ResultSetImpl@55a338 (error)
I am getting this error the when i want to display the table contents of a database in Mysql..In the code i am using 2 recordset is that creating a problem..and it shows this error the number of times equal to the records present in recordset of a particular query..!!
1. It's just localy - no internet
2. Connection is continous.
3. hmm what is the suitable fashion [ sorry for my ignorance ] I got this:
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.from the console after I put in the code this:
public void connector(){
try
String userName = "root";
String password = "";
String url = "jdbc:mysql://localhost/log";
Class.forName ("com.mysql.jdbc.Driver").newInstance ();
conn = DriverManager.getConnection (url, userName, password);
System.out.println ("Database connection established");
System.out.println(conn);
*catch (Exception w)*
*System.err.println ("Cannot connect to database server " +w);*
*// return false;*
}thought is suitable = ) -
Cannot load JDBC driver class 'com.mysql.jdbc.Driver'
Hi,
At the moment I'm trying to get an example working. The error message I get is:
Unable to get connection, DataSource invalid: "org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot load JDBC driver class 'com.mysql.jdbc.Driver'"
The example I tried is http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html.
Configuration:
Wampserver 2.0 (Apache, MySQL, PHP for Windows XP), Tomcat 6.0 and jdk1.6.0_03.
The following files are installed in %CATALINA_HOME%/webabbs/
- Dbtest/test.jsp
- Dbtest/WEB-INF/web.xml
- Dbtest/WEB-INF/lib/standard.jar
- Dbtest/WEB-INF/lib/tomcat-dbcp.jar
- Dbtest/WEB-INF/lib/jstl.jar
Tia,
Abel.Hi,
I added the jar file containing the requested class to my lib directory. So the current contents of that directory is:
The following files are installed in %CATALINA_HOME%/webabbs/
- Dbtest/test.jsp
- Dbtest/WEB-INF/web.xml
- Dbtest/WEB-INF/lib/standard.jar
- Dbtest/WEB-INF/lib/tomcat-dbcp.jar
- Dbtest/WEB-INF/lib/jstl.jar
- Dbtest/WEB-INF/lib/mysql-connector-java-5.1.5-bin.jar
More importantly, I started my Wamp server.
The example works as it should have. Thanks for the feedback.
Abel -
No suitable driver with com.mysql.jdbc.Driver
Ok. here's the issue. I have a windows box. (first problem) but let's pretend that it's ok. :) I installed Tomcat 4.1 installed J2SDK1.4.0
start serving pages GREAT!. I have Mysql working perfectly with PHP on this system. I JUST want to connect with JDBC :)
I've downloaded the MySQL Jdbc Connector/J 3.08 stable installed the .jar file in the $JAVA_HOME/jre/lib/ext as per the README
Now granted I am a little new to JSP. but I have checked over this again and again. used different code. connected as many ways as I can think of and I still get the same result.
Database Error :
No suitable driver
Please Try Some Other Time
So I figure it's a MYSQL issue. no I also went thru and did the Microsot connection to MS SQL 2000 with the same result.
Here's where the drivers are (tried using the other method for installing the MySQL connector as well, and my class path
Y:\j2sdk1.4.0\com\mysql\jdbc\Driver.class
com.mysql.jdbc.Driver.class
Y:\j2sdk1.4.0\org\gjt\mm\mysql\Driver.class
org.gjt.mm.mysql.Driver.class
My classpath is:
.;F:\j2sdk1.4.0\;F:\j2sdk1.4.0\bin\;F:\j2sdk1.4.0\lib\;F:\j2sdk1.4.0\lib\classes\
[ Here's The Enviorment]
Windows 2000 5.00.2195 SP3
MS SQL 2K SP3
Apache Tomcat/4.1.27
j2sdk1.4.0
MySql 3.23.57-nt
mysql Jdbc Connector/J 3.08 stable
<!-- mysql.jsp BEGIN-->
<%@ page import="java.sql.*" %>
<%
Connection conn;
ResultSet results;
try {
String jdbc_driver = "com.mysql.jdbc.Driver";
System.out.println("jdbc_driver = " + jdbc_driver);
Class.forName(jdbc_driver).newInstance();
catch (ClassNotFoundException cnfe)
System.out.println(cnfe.getMessage());
try {
String url = "jdbc:mysql://localhost:3306/javatest?username=root,password=****"; // pass hidden
conn = DriverManager.getConnection(url);
System.out.println("connected to mySql DataBase");
Statement stmt = conn.createStatement();
Statement smt=conn.createStatement();
results=smt.executeQuery("select * from testdata");
while(results.next())
%>
<%= results.getString("foo")%>
<%= results.getString("bar")%>
<%= results.getString("id")%>
<%
results.close();
conn.close();
catch(Exception exp)
%>
<H3>Database Error : </H3><B><%= exp.getMessage() %></B><H3>Please Try Some Other Time</H3>
<%
%>
<!-- mysql.jsp end -->
BTW i aslo tried connecting to MicrosoftSQL 2K
<!-- microsoft.jsp Begin -->
<%@ page import="java.sql.*" %>
<%
Connection conn;
ResultSet results;
try {
String jdbc_driver = "sun.jdbc.odbc.JdbcObdcDriver";
System.out.println("jdbc_driver = " + jdbc_driver);
Class.forName(jdbc_driver).newInstance();
catch (ClassNotFoundException cnfe)
System.out.println(cnfe.getMessage());
try {
String url = "jdbc:odbc:contacts";
String username = "javauser";
String pw = "javauser";
conn = DriverManager.getConnection(url, username, pw);
System.out.println("connected to Msoft DataBase");
Statement stmt = conn.createStatement();
Statement smt=conn.createStatement();
results=smt.executeQuery("select * from contacts");
while(results.next())
%>
<%= results.getString("name")%><br>
<%
results.close();
conn.close();
catch(Exception exp)
%>
<H3>Database Error : </H3><B><%= exp.getMessage() %></B><H3>Please Try Some Other Time</H3>
<%
%>
<!-- microsoft.jsp end -->
got the exact same results.
Just to show you mysql is Good. with localhost.
mysql -u root -h localhost -p
mysql> use javatest
Database changed
mysql> select * from testdata;
| id | foo | bar |
| 1 | hello | 12345 |
1 row in set (0.00 sec)
mysql>Nope, it's not a MySQL issue.
I'd recommend NOT putting the JDBC JAR file (or any others, except Sun-sanctioned extensions) in JAVA_HOME/jre/lib/ext.
JDBC JARs belong in TOMCAT_HOME/common/lib or in the WEB-INF/lib directory for your particular app. If you put them in the former, all apps running under Tomcat can have access to them. If you put them in the latter, only your app can see them.
After you've done that, do some reading about JNDI data sources under Tomcat:
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html
That way you can get that connection code out of your JSPs and into the web.xml and <Context>, where it belongs. You'll be able to change data sources without rewriting your pages.
Good luck - MOD -
Com.mysql.jdbc.MysqlDataTruncation: Data truncation
Hi, i have these error
com.mysql.jdbc.MysqlDataTruncation: Data truncation: Out of range value adjusted for column 'longtitude' at row 1
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2932)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1616)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1708)
at com.mysql.jdbc.Connection.execSQL(Connection.java:3255)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1293)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1566)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1480)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1465)
at dao.PlacemarkDAO.add(PlacemarkDAO.java:52)
at web.AddPlacemarkServlet.processRequest(AddPlacemarkServlet.java:70)
at web.AddPlacemarkServlet.doGet(AddPlacemarkServlet.java:86)
in my database, i have declare longtitude as double(255,30) but i still dont know why got error data truncation? Can anyone please guide me?hmm, i have sloved the error already. I have make my longtitude double(40,20).
-
NPE in com.mysql.jdbc.ResultSet
hi guys,
config: Connector/J 3.1.11 - mysql 5.0 - java 1.5
is anybody has ever seen this exception??
Caused by: java.lang.NullPointerException
at com.mysql.jdbc.ResultSet.buildIndexMapping(ResultSet.java:597)
at com.mysql.jdbc.ResultSet.findColumn(ResultSet.java:905)
at com.mysql.jdbc.ResultSet.getString(ResultSet.java:4977)we've got this exception and we can't understand why!!
the ResultSet class fragment...
for (int i = numFields - 1; i >= 0; i--) {
Integer index = new Integer(i);
String columnName = this.fields.getName();
String fullColumnName = this.fields[i].getFullName();
if (columnName != null) {
this.columnNameToIndex.put(columnName, index);
this.columnNameToIndex.put(columnName.toUpperCase(), index);
this.columnNameToIndex.put(columnName.toLowerCase(), index); // <--- this line caused the exception
if (fullColumnName != null) {
this.fullColumnNameToIndex.put(fullColumnName, index);
this.fullColumnNameToIndex.put(fullColumnName.toUpperCase(),
index);
this.fullColumnNameToIndex.put(fullColumnName.toLowerCase(),
index);
i don't understand why it is possible. columnNameToIndex is protected and only accessed by the ResultSet class. it is in the buildIndexMapping() method and this method is called only in a synchronized method so ???
any ideas??
sup@renoCaused by: java.lang.NullPointerException
at com.mysql.jdbc.ResultSet.buildIndexMapping(ResultSet.java:597)It's an open-source jdbc driver, which maintainted by Mysql. You can try to fix it, and recompile your Connector/J, or report simply Mysql that issue.
Maybe you are looking for
-
.tdm file storage vi's slow editing vi's
I am developing software using Labview 8.5 and have recently added some file storage vi's for the .tdm format for use in DIAdem 10.2. Upon using the open storage, set file properties, write channel group, write channel, and close storage vi's, the e
-
What kind of server can host RMI
I am trying to use RMI, however there are some simple question about the server type I want to ask. A. Is it possible to use a http server like www.myschoolurl.edu/~mypage? I can only access the root directory of ~mypage in a unix system. B. Can I us
-
Are there any good drivers that finally allow a Mac user to take advantage of this equipment's capabilities?
-
Unexpected Signal : 11 occurred at PC=0x55296A82
hi , i am running RMI server in 2sdk1.4.2_05 version i am getting below error as Unexpected Signal : 11 occurred at PC=0x55296A82 Function=(null)+0x55296A82 Library=/usr/java/j2sdk1.4.2_05/jre/lib/i386/client/libjvm.so NOTE: We are unable to locate t
-
Dreamweaver MX 2004 is on windows 8.1.
I have MX 2004 on my windows 8.1. Everything seems to work fine but simple changes to a page doesn't upload. There are no errors. I also went to Remote View and made a change and it didn't take either. Any suggestions?