-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NullPointerException #81
Comments
This thread indicates that it is a bug with the MySQL JDBC driver implementation of the config.setJdbc4ConnectionTest(false);
config.setConnectionTestQuery("/* ping */ SELECT 1"); |
Thanks for the quick reply, updating the MySQL connector did the trick. |
What Connector version you are using now? |
I replaced com.mysql.jdbc_5.1.5.jar file with mysql-connector-java-8.0.11.jar in \WebContent\WEB-INF\lib folder and these exceptions gone. |
I don't know where are these configs? |
This exception gets thrown on quite frequently:
Exception in thread "Thread-20" java.lang.RuntimeException: java.lang.NullPointerException
at com.mysql.jdbc.JDBC4Connection$1$1.run(JDBC4Connection.java:106)
Caused by: java.lang.NullPointerException
at com.mysql.jdbc.ConnectionImpl.abortInternal(ConnectionImpl.java:1229)
at com.mysql.jdbc.JDBC4Connection$1$1.run(JDBC4Connection.java:104)
I'm configuring HikariCP like this:
HikariConfig config = new HikariConfig();
config.setMinimumPoolSize(1);
config.setMaximumPoolSize(3);
config.setInitializationFailFast(true);
config.setDriverClassName("com.mysql.jdbc.Driver");
config.setJdbcUrl("jdbc:mysql://" + URL);
config.setUsername(USERNAME);
config.setPassword(PASSWORD);
config.setJdbc4ConnectionTest(true);
pool = new HikariDataSource(config);
Changing idle timeout value seems to influence the exception being thrown (but doesn't stop it from happening).
I'm probably doing something wrong, as I couldn't find simular problems when searching on google.
The text was updated successfully, but these errors were encountered: