Mailing List
Home
Forum Home
MySQL General - General MySQL discussion
MySQL++ - Programming with the C++ API to MySQL
MaxDB - Everything about MaxDB, formerly known as SAP DB
ODBC - ODBC with the MySQL Connector/ODBC driver
MySQL on Win32 - Runing MySQL on Windows 9x/Me/NT/2000/XP
Java Help - Mostly related to the MySQL Connector/J driver
Perl - Perl support for MySQL with DBI and DBD::mysql
GUI - MySQL GUI Tools
Announcement
Subjects
Subject: mysql openssl Question
ERROR 1045: Access denied for user: 'root@localhost ' (Using
password: NO)
Update one field with more fields from another table
Subject: Getting Identity after INSERT
ERROR 2002: Can 't connect to local MySQL server through socket
mysql test 4 1 fails with the gis test
Subject: MySQL Cluster Software
Downgrade Mysql from 4 to 3 23
Mysql 4 0 Oracle Stored Procedure Trigger Conversion
Can 't access mysql after kernel upgrade
Executing MySQL Commands From Within C Program
Comparing and writing out BLOBS
Subject: Re: Preventing Duplicate Entries
FULLTEXT query format question
Strange behavior, Table Level Permission
Does the binary log enabling affect the MySQL performances?
mysql:it 's a db not a dbms how it 's possible?!
mysql have same function mthod as Oracle decode()
 
Subject: Re: NumberFormatException on initializePropsFromServer

Subject: Re: NumberFormatException on initializePropsFromServer

2007-09-14       - By maydox

 Back

Here are the likely offenders from the Connection source:

this.netBufferLength = Integer.parseInt((String)
this.serverVariables.get("net_buffer_length"));

this.maxAllowedPacket = Integer.parseInt((String)
this.serverVariables.get("max_allowed_packet"));

The code is clearly not ready for the server to return "" for these
variables.


maydox wrote:
>
> Our mysql 4.1 DB recently hit the maximum number of allowed connections,
> immediate effects were that replication began to fail and our Java apps
> running through tomcat could no longer establish connections (even after
> more became available).
>
> Here is the stack trace (using mysql-connector-java-5 (See http://ava-5.ora-code.com).0.5.jar):
>
> java.lang.NumberFormatException
> MESSAGE: For input string: ""
>
> STACKTRACE:
> java.lang.NumberFormatException: For input string: ""
> at
> java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
> at java.lang.Integer.parseInt(Integer.java:468)
> at java.lang.Integer.parseInt(Integer.java:497)
> at
> com.mysql.jdbc.Connection.initializePropsFromServer(Connection.java:4031)
> at com.mysql.jdbc.Connection.createNewIO(Connection.java:2756)
> at com.mysql.jdbc.Connection.<init>(Connection.java:1553)
> at
> com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
> at
> org.apache.tomcat.dbcp.dbcp.DriverConnectionFactory.createConnection
(DriverConnectionFactory.java:37)
> at
> org.apache.tomcat.dbcp.dbcp.PoolableConnectionFactory.makeObject
(PoolableConnectionFactory.java:290)
> at
> org.apache.tomcat.dbcp.dbcp.BasicDataSource.validateConnectionFactory
(BasicDataSource.java:877)
> at
> org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource
.java:851)
> at
> org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource
.java:540)
>
> ...
>
> What is puzzling is that the PHP applications continued to function while
> the driver continued to throw this stack trace.  Tomcat was only able to
> reestablish a connection through the connector after the db was restarted.  
>
> Has anyone seen this type of behavior before?  I searched the bug database
> and this archive and haven't seen anything quite like this.
>
>
>

--
View this message in context: http://www.nabble.com/NumberFormatException-on
-initializePropsFromServer-tf4443445.html#a12679098
Sent from the MySQL - Java mailing list archive at Nabble.com.


--
MySQL Java Mailing List
For list archives: http://lists.mysql.com/java
To unsubscribe:    http://lists.mysql.com/java?unsub=mysql@(protected)