You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey! I was trying to run Java application with Noria but I got an exception
Exception in thread "main" java.sql.SQLNonTransientConnectionException: CLIENT_SECURE_CONNECTION is required
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:110)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:73)
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:79)
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:836)
at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:456)
at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:246)
at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:197)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:270)
at com.example.demo.DemoApplication.main(DemoApplication.java:12)
Caused by: com.mysql.cj.exceptions.UnableToConnectException: CLIENT_SECURE_CONNECTION is required
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.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61)
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:85)
at com.mysql.cj.protocol.a.NativeAuthenticationProvider.connect(NativeAuthenticationProvider.java:111)
at com.mysql.cj.protocol.a.NativeProtocol.connect(NativeProtocol.java:1342)
at com.mysql.cj.NativeSession.connect(NativeSession.java:157)
at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:956)
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:826)
... 6 more
Steps to reproduce:
run zookeeper (docker image all ports are exposed)
run noria from README (cargo r --release --bin noria-server -- --deployment myapp --no-reuse --shards 0)
run noria-mysql from README (cargo run --release -- --deployment myapp -z 127.0.0.1:2181)
execute mysql -h 127.0.0.1
create table and insert data in it (CREATE TABLE Cats (id int, name VARCHAR(255), PRIMARY KEY(id));, INSERT INTO Cats (id, name) VALUES (1, "bob");)
run Java application
Some java app example
main method
Class.forName("com.mysql.cj.jdbc.Driver");
final String name = DriverManager
.getConnection("jdbc:mysql://127.0.0.1/")
.prepareStatement("select * from Cats")
.executeQuery()
.getString("name");
System.out.println(name);
Ah, yes, msql-srv (which provides the MySQL interface) does not currently support the SSL handshake, and thus only supports non-encrypted connections. If the Java library requires a secure connection ("CLIENT_SECURE_CONNECTION is required"), and that can't be disabled, then the way forward would be to add SSL support to msql-srv. Adding it shouldn't be too difficult, though I don't personally have the bandwidth to do so at the moment. If you want to take a stab at writing a PR, I'd be happy to take a look! See also jonhoo/msql-srv#10 which also has some Java-related problems.
Hey! I was trying to run Java application with Noria but I got an exception
Steps to reproduce:
cargo r --release --bin noria-server -- --deployment myapp --no-reuse --shards 0
)cargo run --release -- --deployment myapp -z 127.0.0.1:2181
)mysql -h 127.0.0.1
CREATE TABLE Cats (id int, name VARCHAR(255), PRIMARY KEY(id));
,INSERT INTO Cats (id, name) VALUES (1, "bob");
)Some java app example
main methodpom.xml
My questions:
noria-mysql
adapter through the Java code?noria-mysql
? (besidesmysql -h 127.0.0.1
nothing is working for me)The text was updated successfully, but these errors were encountered: