AtlasOfLivingAustralia / ala-cas-5

ALA CAS 5 implementation
Apache License 2.0
0 stars 11 forks source link

mysql-connector 5 and hikari 3.2.0 are used in cas 6.5.6-2 #50

Closed vjrj closed 6 months ago

vjrj commented 2 years ago

This causes this type of exceptions trying to run it with mysql 8 servers in ubuntu 20.04 (for instance):

2022-09-08 09:05:49,451 WARN [org.apereo.cas.configuration.support.JpaBeans] - <Lookup of datasource [java:comp/env/jdbccas] failed due to Failed to look up JNDI DataSource with name 'java:comp/env/jdbccas'; nested exception is javax.naming.NamingException: Unexpected exception resolving reference [Root exception is com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: Unknown system variable 'tx_isolation'] falling back to configuration via JPA properties.>
2022-09-08 09:05:56,026 ERROR [com.zaxxer.hikari.pool.HikariPool] - <HikariPool-7 - Exception during pool initialization.>
java.sql.SQLException: Unknown system variable 'tx_isolation'
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:964) ~[mysql-connector-java-5.1.43.jar!/:5.1.43]
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3973) ~[mysql-connector-java-5.1.43.jar!/:5.1.43]
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3909) ~[mysql-connector-java-5.1.43.jar!/:5.1.43]
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2527) ~[mysql-connector-java-5.1.43.jar!/:5.1.43]
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2680) ~[mysql-connector-java-5.1.43.jar!/:5.1.43]
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2490) ~[mysql-connector-java-5.1.43.jar!/:5.1.43]
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2448) ~[mysql-connector-java-5.1.43.jar!/:5.1.43]
        at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1381) ~[mysql-connector-java-5.1.43.jar!/:5.1.43]
        at com.mysql.jdbc.ConnectionImpl.loadServerVariables(ConnectionImpl.java:3787) ~[mysql-connector-java-5.1.43.jar!/:5.1.43]
        at com.mysql.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:3233) ~[mysql-connector-java-5.1.43.jar!/:5.1.43]
        at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2242) ~[mysql-connector-java-5.1.43.jar!/:5.1.43]
        at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2024) ~[mysql-connector-java-5.1.43.jar!/:5.1.43]
        at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:779) ~[mysql-connector-java-5.1.43.jar!/:5.1.43]
        at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47) ~[mysql-connector-java-5.1.43.jar!/:5.1.43]
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_342]
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_342]
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_342]
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_342]
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:425) ~[mysql-connector-java-5.1.43.jar!/:5.1.43]
        at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:389) ~[mysql-connector-java-5.1.43.jar!/:5.1.43]
        at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:330) ~[mysql-connector-java-5.1.43.jar!/:5.1.43]
        at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:136) ~[HikariCP-3.2.0.jar!/:?]
        at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:369) ~[HikariCP-3.2.0.jar!/:?]
        at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:198) ~[HikariCP-3.2.0.jar!/:?]
        at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:467) ~[HikariCP-3.2.0.jar!/:?]
        at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:541) ~[HikariCP-3.2.0.jar!/:?]
        at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115) ~[HikariCP-3.2.0.jar!/:?]
        at com.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:81) ~[HikariCP-3.2.0.jar!/:?]
        at com.zaxxer.hikari.HikariJNDIFactory.createDataSource(HikariJNDIFactory.java:71) ~[HikariCP-3.2.0.jar!/:?]
        at com.zaxxer.hikari.HikariJNDIFactory.getObjectInstance(HikariJNDIFactory.java:59) ~[HikariCP-3.2.0.jar!/:?]
        at org.apache.naming.factory.FactoryBase.getObjectInstance(FactoryBase.java:94) ~[tomcat-embed-core-8.5.41.jar!/:8.5.41]
        at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:332) ~[?:1.8.0_342]
        at org.apache.naming.NamingContext.lookup(NamingContext.java:839) ~[tomcat-embed-core-8.5.41.jar!/:8.5.41]
        at org.apache.naming.NamingContext.lookup(NamingContext.java:159) ~[tomcat-embed-core-8.5.41.jar!/:8.5.41]
        at org.apache.naming.NamingContext.lookup(NamingContext.java:827) ~[tomcat-embed-core-8.5.41.jar!/:8.5.41]
        at org.apache.naming.NamingContext.lookup(NamingContext.java:159) ~[tomcat-embed-core-8.5.41.jar!/:8.5.41]
        at org.apache.naming.NamingContext.lookup(NamingContext.java:827) ~[tomcat-embed-core-8.5.41.jar!/:8.5.41]
        at org.apache.naming.NamingContext.lookup(NamingContext.java:173) ~[tomcat-embed-core-8.5.41.jar!/:8.5.41]
        at org.apache.naming.SelectorContext.lookup(SelectorContext.java:163) ~[tomcat-embed-core-8.5.41.jar!/:8.5.41]
        at javax.naming.InitialContext.lookup(InitialContext.java:417) ~[?:1.8.0_342]
        at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:155) ~[spring-context-4.3.20.RELEASE.jar!/:4.3.20.RELEASE]
        at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:87) ~[spring-context-4.3.20.RELEASE.jar!/:4.3.20.RELEASE]
        at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:152) ~[spring-context-4.3.20.RELEASE.jar!/:4.3.20.RELEASE]
        at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:179) ~[spring-context-4.3.20.RELEASE.jar!/:4.3.20.RELEASE]
        at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:95) ~[spring-context-4.3.20.RELEASE.jar!/:4.3.20.RELEASE]
        at org.springframework.jdbc.datasource.lookup.JndiDataSourceLookup.getDataSource(JndiDataSourceLookup.java:45) ~[spring-jdbc-4.3.24.RELEASE.jar!/:4.3.24.RELEASE]
        at org.apereo.cas.configuration.support.JpaBeans.newDataSource(JpaBeans.java:61) ~[cas-server-core-api-configuration-model-5.3.12.ALA.jar!/:5.3.12.ALA]

The mysql-connector has its runtime scope commented so probably spring boot includes that old deps.

vjrj commented 6 months ago

Works for me now. Closing it.