Bug 1083837 - opensuse mysql java connector fails to connect
opensuse mysql java connector fails to connect
Status: RESOLVED NORESPONSE
Classification: openSUSE
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Java
Current
x86-64 SUSE Other
: P5 - None : Normal (vote)
: ---
Assigned To: E-mail List
E-mail List
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-03-03 14:52 UTC by Emr Rec
Modified: 2018-04-10 09:03 UTC (History)
2 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---
astieger: needinfo? (erecio)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Emr Rec 2018-03-03 14:52:02 UTC
1) Download the latest version of Java from Oracle. Version I am using is as follows:
jdk1.8-1.8.0_161-fcs.x86_64 RPM
java version "1.8.0_161"
Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)

2) Install the mysql-connector-java package from OpenSUSE repository. Version I am using is as follows:
Name        : mysql-connector-java
Version     : 5.1.43
Release     : 3.1
Architecture: noarch
Install Date: Sat Mar  3 09:37:33 2018
Group       : Development/Libraries/Java
Size        : 1368437
License     : GPL-2.0+
Signature   : RSA/SHA256, Tue Oct 10 08:57:48 2017, Key ID b88b2fd43dbdc284
Source RPM  : mysql-connector-java-5.1.43-3.1.src.rpm
Build Date  : Fri Oct  6 08:00:00 2017
Build Host  : localhost
Relocations : (not relocatable)
Packager    : https://bugs.opensuse.org
Vendor      : openSUSE
URL         : http://dev.mysql.com/downloads/connector/j/
Summary     : Official JDBC Driver for MySQL

When I attempt to connect to a locally installed mysql database using IP 127.0.0.1, the following error occurs:
java.sql.SQLException: java.lang.NoSuchMethodError: java.nio.CharBuffer.position(I)Ljava/nio/CharBuffer;
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:964)

Error Code:0
SQL State Code: S1000
 
This only happens with the RPM from OpenSUSE repository. Downloading the 5.1.45 version from Oracle works just fine. Can always reproduce.

The error I get using a java based application SquirrelSQL, ExecuteQuery, etc, gives the same error. May be the way the Jar file is being compiled.

Detailed error:

java.sql.SQLException: java.lang.NoSuchMethodError: java.nio.CharBuffer.position(I)Ljava/nio/CharBuffer;
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:964)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:897)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:886)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:860)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:877)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:873)
	at com.mysql.jdbc.Util.handleNewInstance(Util.java:443)
	at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:389)
	at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:330)
	at org.executequery.datasource.SimpleDataSource.getConnection(SimpleDataSource.java:99)
	at org.executequery.datasource.SimpleDataSource.getConnection(SimpleDataSource.java:81)
	at org.executequery.datasource.ConnectionPoolImpl.createConnection(ConnectionPoolImpl.java:252)
	at org.executequery.datasource.ConnectionPoolImpl.ensureCapacity(ConnectionPoolImpl.java:200)
	at org.executequery.datasource.ConnectionPoolImpl.setMinimumConnections(ConnectionPoolImpl.java:419)
	at org.executequery.datasource.ConnectionManager.createDataSource(ConnectionManager.java:85)
	at org.executequery.databasemediators.spi.DefaultConnectionBuilder.createDataSource(DefaultConnectionBuilder.java:120)
	at org.executequery.databasemediators.spi.DefaultConnectionBuilder.access$000(DefaultConnectionBuilder.java:33)
	at org.executequery.databasemediators.spi.DefaultConnectionBuilder$1.construct(DefaultConnectionBuilder.java:98)
	at org.underworldlabs.swing.util.SwingWorker$2.run(SwingWorker.java:130)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NoSuchMethodError: java.nio.CharBuffer.position(I)Ljava/nio/CharBuffer;
	at com.mysql.jdbc.ConnectionImpl.configureClientCharacterSet(ConnectionImpl.java:1909)
	at com.mysql.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:3321)
	at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2242)
	at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2024)
	at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:779)
	at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
	... 13 more
Comment 1 Andreas Stieger 2018-03-03 20:01:39 UTC
(In reply to Emr Rec from comment #0)
> 1) Download the latest version of Java from Oracle.

Please try again with the distribution java packages and report the results
Comment 2 Tomáš Chvátal 2018-04-10 09:03:33 UTC
Did not provided requested debugging info.