Closed choubuzhaole closed 4 months ago
近期来研究下怎么做支持
我本地使用graalvm-jdk-21.0.1+12.1进行了简单验证,
implementation 'com.alibaba:druid:1.2.21'
implementation 'com.alibaba:druid-spring-boot-3-starter:1.2.21'
报错信息如下:
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:149) ~[demo-tests.exe:6.1.2]
... 69 common frames omitted
Caused by: java.lang.NullPointerException: null
at com.alibaba.druid.spring.boot3.autoconfigure.DruidDataSourceWrapper.afterPropertiesSet(DruidDataSourceWrapper.java:40) ~[na:na]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1820) ~[demo-tests.exe:6.1.2]
Caused by: org.springframework.test.context.aot.TestContextAotException: Failed to process test class [com.example.demo.DemoApplicationTests] for AOT
at org.springframework.test.context.aot.TestContextAotGenerator.processAheadOfTime(TestContextAotGenerator.java:323)
at org.springframework.test.context.aot.TestContextAotGenerator.lambda$processAheadOfTime$5(TestContextAotGenerator.java:277)
... 9 more
Caused by: org.springframework.boot.context.properties.bind.MissingParametersCompilerArgumentException: Constructor binding in a native image requires compilation with -parameters but the following classes were compiled without it:
com.alibaba.druid.stat.JdbcSqlStat
com.alibaba.druid.pool.DruidPooledConnection
at org.springframework.boot.context.properties.bind.BindableRuntimeHintsRegistrar.registerHints(BindableRuntimeHintsRegistrar.java:100)
at org.springframework.boot.context.properties.ConfigurationPropertiesBeanFactoryInitializationAotProcessor$ConfigurationPropertiesReflectionHintsC
//implementation 'com.alibaba:druid:1.2.21'
implementation files('D:\\githubProjects\\druid\\core\\target\\druid-1.2.21-SNAPSHOT.jar')
//implementation 'com.alibaba:druid-spring-boot-3-starter:1.2.21'
implementation files('D:\\githubProjects\\druid\\druid-spring-boot-3-starter\\target\\druid-spring-boot-3-starter-1.2.21-SNAPSHOT.jar')
我提交一下pr支持。
我又验证了一下是没有报错的, druid:1.2.8版本应该是太低了,使用 1.2.21版本验证吧
我又验证了一下是没有报错的, druid:1.2.8版本应该是太低了,使用 1.2.21版本验证吧
不能直接 implementation 'com.alibaba:druid-spring-boot-starter:1.2.21' 吗
我又验证了一下是没有报错的, druid:1.2.8版本应该是太低了,使用 1.2.21版本验证吧
不能直接 implementation 'com.alibaba:druid-spring-boot-starter:1.2.21' 吗
我是用的springboot3,当然是用druid-spring-boot-3-starter验证。
springboot2的,用druid-spring-boot-starter即可。
#5371 (comment) 请问下预计什么时候发布这个版本
预计春节前发布
#5371 (comment) 请问下预计什么时候发布这个版本
预计春节前发布
请问下发布了吗?我这边用的druid-spring-boot-3-starter:1.2.21版本,出现以下错误Caused by: java.lang.NoSuchMethodException: com.alibaba.druid.pool.DruidDataSource.
1.2.22已经支持
版本
springboot:3.2.0 druid:1.2.8 graalvm-community-jdk-21.0.1_linux-x64_bin
异常信息
使用 mvn -Pnative clean install 编译后启动可执行文件错误 `Failed to bind properties under 'spring.datasource.druid' to java.util.Properties:
Action: Update your application's configuration `