简体   繁体   English

Flyway 嵌套异常是 java.lang.IllegalArgumentException: Name must not be null

[英]Flyway nested exception is java.lang.IllegalArgumentException: Name must not be null

I cannot deploy my Spring boot application due to this exception when I am trying to connect Flyway to Oracle db.当我尝试将 Flyway 连接到 Oracle db 时,由于此异常,我无法部署我的 Spring Boot 应用程序。 Below are the configuration and stacktrace.下面是配置和堆栈跟踪。

The application.yml:应用程序.yml:

spring:
  flyway:
    url: jdbc.url=jdbc:oracle:thin:@localhost:1521:XE
    user: TEST
    password: TEST
    schemas: TEST
    locations: classpath:scripts/oracle
    encoding: UTF-8
    baseline-on-migrate: true
    baseline-version: 0

The exception例外

Exception is thrown during application deployment.应用程序部署期间抛出异常。 Scripts are in place.脚本已到位。

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flyway' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.flywaydb.core.Flyway]: Factory method 'flyway' threw exception; nested exception is java.lang.IllegalArgumentException: Name must not be null
    at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:658) ~[spring-beans-5.3.15.jar:5.3.15]
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:638) ~[spring-beans-5.3.15.jar:5.3.15]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352) ~[spring-beans-5.3.15.jar:5.3.15]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195) ~[spring-beans-5.3.15.jar:5.3.15]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) ~[spring-beans-5.3.15.jar:5.3.15]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.15.jar:5.3.15]
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.15.jar:5.3.15]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.15.jar:5.3.15]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.15.jar:5.3.15]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.15.jar:5.3.15]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) ~[spring-beans-5.3.15.jar:5.3.15]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.15.jar:5.3.15]
    at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1154) ~[spring-context-5.3.15.jar:5.3.15]
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:908) ~[spring-context-5.3.15.jar:5.3.15]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.15.jar:5.3.15]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.6.3.jar:2.6.3]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:732) ~[spring-boot-2.6.3.jar:2.6.3]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:414) ~[spring-boot-2.6.3.jar:2.6.3]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:302) ~[spring-boot-2.6.3.jar:2.6.3]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1303) ~[spring-boot-2.6.3.jar:2.6.3]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1292) ~[spring-boot-2.6.3.jar:2.6.3]
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.flywaydb.core.Flyway]: Factory method 'flyway' threw exception; nested exception is java.lang.IllegalArgumentException: Name must not be null
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.3.15.jar:5.3.15]
    at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653) ~[spring-beans-5.3.15.jar:5.3.15]
    ... 21 common frames omitted
Caused by: java.lang.IllegalArgumentException: Name must not be null
    at org.springframework.util.Assert.notNull(Assert.java:201) ~[spring-core-5.3.15.jar:5.3.15]
    at org.springframework.util.ClassUtils.forName(ClassUtils.java:248) ~[spring-core-5.3.15.jar:5.3.15]
    at org.springframework.util.ClassUtils.resolveClassName(ClassUtils.java:324) ~[spring-core-5.3.15.jar:5.3.15]
    at org.springframework.boot.jdbc.DataSourceBuilder$MappedDataSourceProperty.convertFromString(DataSourceBuilder.java:487) ~[spring-boot-2.6.3.jar:2.6.3]
    at org.springframework.boot.jdbc.DataSourceBuilder$MappedDataSourceProperty.set(DataSourceBuilder.java:460) ~[spring-boot-2.6.3.jar:2.6.3]
    at org.springframework.boot.jdbc.DataSourceBuilder$MappedDataSourceProperties.set(DataSourceBuilder.java:355) ~[spring-boot-2.6.3.jar:2.6.3]
    at org.springframework.boot.jdbc.DataSourceBuilder.build(DataSourceBuilder.java:190) ~[spring-boot-2.6.3.jar:2.6.3]
    at org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration$FlywayConfiguration.getMigrationDataSource(FlywayAutoConfiguration.java:144) ~[spring-boot-autoconfigure-2.6.3.jar:2.6.3]
    at org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration$FlywayConfiguration.configureDataSource(FlywayAutoConfiguration.java:131) ~[spring-boot-autoconfigure-2.6.3.jar:2.6.3]
    at org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration$FlywayConfiguration.flyway(FlywayAutoConfiguration.java:117) ~[spring-boot-autoconfigure-2.6.3.jar:2.6.3]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
    at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.3.15.jar:5.3.15]
    ... 22 common frames omitted

I had the exact error with a postgres database.我对postgres数据库有确切的错误。 In my case I had to change the spring.flyway.url from jdbc:postgres://localhost:5432/postgres to jdbc:postgresql://localhost:5432/postgres .就我而言,我必须将spring.flyway.urljdbc:postgres://localhost:5432/postgres更改为jdbc:postgresql://localhost:5432/postgres

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 给定的 id 不能是 null;。 嵌套异常是 java.lang.IllegalArgumentException - The given id must not be null!; nested exception is java.lang.IllegalArgumentException 线程“ main”中的异常java.lang.IllegalArgumentException:in不能为null - Exception in thread “main” java.lang.IllegalArgumentException: in must not be null java.lang.IllegalArgumentException:参数绑定的名称不得为 null 或空 - java.lang.IllegalArgumentException: Name for parameter binding must not be null or empty java.lang.IllegalArgumentException:方法不能为null - java.lang.IllegalArgumentException: Method must not be null java.lang.IllegalArgumentException:上下文不得为null - java.lang.IllegalArgumentException: Context must not be null java.lang.IllegalArgumentException:目标不能为空 - java.lang.IllegalArgumentException: Target must not be null 获取异常:java.lang.IllegalArgumentException:无法添加到布局:约束必须为字符串(或为null) - getting Exception : java.lang.IllegalArgumentException: cannot add to layout: constraint must be a string (or null) 获取 java.lang.IllegalArgumentException “名称不能为空!” 更新 MongoDB 集合时 - Getting java.lang.IllegalArgumentException “Name must not be null!” when updating MongoDB collection 线程“ main”中的异常java.lang.IllegalArgumentException:绑定必须为正 - Exception in thread “main” java.lang.IllegalArgumentException: bound must be positive 线程“main”中的异常java.lang.IllegalArgumentException:n必须为正数 - Exception in thread “main” java.lang.IllegalArgumentException: n must be positive
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM