oracle / oracle-r2dbc

R2DBC Driver for Oracle Database
https://oracle.com
Other
194 stars 40 forks source link

spring r2dbc run with error “LOCK_WAIT_TIMEOUT” #90

Closed 18356555003 closed 1 year ago

18356555003 commented 1 year ago

error: Caused by: java.lang.NoSuchFieldError: LOCK_WAIT_TIMEOUT at oracle.r2dbc.impl.OracleConnectionFactoryImpl.(OracleConnectionFactoryImpl.java:186) ~[oracle-r2dbc-1.0.0.jar:1.0.0] at oracle.r2dbc.impl.OracleConnectionFactoryProviderImpl.create(OracleConnectionFactoryProviderImpl.java:99) ~[oracle-r2dbc-1.0.0.jar:1.0.0] at io.r2dbc.spi.ConnectionFactories.find(ConnectionFactories.java:112) ~[r2dbc-spi-0.8.3.RELEASE.jar:na] at io.r2dbc.spi.ConnectionFactories.get(ConnectionFactories.java:142) ~[r2dbc-spi-0.8.3.RELEASE.jar:na] at org.springframework.boot.autoconfigure.r2dbc.ConnectionFactoryBuilder.build(ConnectionFactoryBuilder.java:125) ~[spring-boot-autoconfigure-2.3.7.RELEASE.jar:2.3.7.RELEASE] at org.springframework.boot.autoconfigure.r2dbc.ConnectionFactoryConfigurations.createConnectionFactory(ConnectionFactoryConfigurations.java:56) ~[spring-boot-autoconfigure-2.3.7.RELEASE.jar:2.3.7.RELEASE] at org.springframework.boot.autoconfigure.r2dbc.ConnectionFactoryConfigurations$Pool.connectionFactory(ConnectionFactoryConfigurations.java:68) ~[spring-boot-autoconfigure-2.3.7.RELEASE.jar:2.3.7.RELEASE] at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) ~[na:na] at java.base/java.lang.reflect.Method.invoke(Method.java:577) ~[na:na] at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE] ... 68 common frames omitted

config:

应用名称

spring.application.name=test-r2dbc

spring.r2dbc.url=r2dbc:oracle:thin://10.19.1.208:1521:szwz

spring.r2dbc.url=r2dbc:oracle:thin://localhost:1521:orcl

spring.r2dbc.url=r2dbc:mysql://localhost:3306/test?ssl=false

spring.r2dbc.username= spring.r2dbc.password= spring.r2dbc.pool.max-size=100 spring.r2dbc.pool.max-idle-time=2m spring.r2dbc.pool.initial-size=100 spring.r2dbc.pool.validation-query=select 1

Michael-A-McMahon commented 1 year ago

Oracle R2DBC is only compatible with the 1.0.0 release of the R2DBC SPI. In your stack, I see version 0.8.3: at io.r2dbc.spi.ConnectionFactories.find(ConnectionFactories.java:112) ~[r2dbc-spi-0.8.3.RELEASE.jar:na]

The error results as the LOCK_WAIT_TIMEOUT constant does not exist in version 0.8.3.

Please try updating Spring to a newer version which supports the 1.0.0 version of the R2DBC SPI.