带有Postgresq的Spring云数据流

问题描述 投票:1回答:1

我安装了scdf,并且可以通过url和shell正确访问它。问题是,一旦我重新启动系统,我将失去所做的一切(看到使用基础H2)。当我尝试如下使用Postgresql时:

 java -Dloader.path=lib -jar spring-cloud-dataflow-server-2.2.1.RELEASE.jar \
  --spring.datasource.url=jdbc:postgresql://localhost:5432 / test \
  --spring.datasource.username=postgres \
  --spring.datasource.password=root \
  --spring.datasource.driver-class-name=org.postgresql.Driver &. I have the following error: 
 [           main] ConfigServletWebServerApplicationContext : Exception encountered during context 
 initialization - cancelling refresh attempt: 
 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.RuntimeException: Driver org.postgresql.Driver claims to not accept jdbcUrl, 
 jdbc:postgresql://localhost:5432
 2019-11-20 13:38:54.610  INFO 29707 --- [           main] o.apache.catalina.core.StandardService   
 : Stopping service [Tomcat]
 2019-11-20 13:38:54.640 ERROR 29707 --- [           main] o.s.boot.SpringApplication               
 : Application run failed

 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.RuntimeException: Driver org.postgresql.Driver claims to not accept jdbcUrl, 
 jdbc:postgresql://localhost:5432
    at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:627)
    at  

org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:456)在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1321)处在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1160)在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)上在org.springframework.beans.factory.support.AbstractBeanFactory.lambda $ doGetBean $ 0(AbstractBeanFactory.java:320)在org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)在org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)在org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)在org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:307)在org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)在org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1105)在org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)在org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549)在org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140)在org.springframework.boot.SpringApplication.refresh(SpringApplication.java:742)在org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:389)在org.springframework.boot.SpringApplication.run(SpringApplication.java:311)在org.springframework.boot.SpringApplication.run(SpringApplication.java:1213)在org.springframework.boot.SpringApplication.run(SpringApplication.java:1202)在org.springframework.cloud.dataflow.server.single.DataFlowServerApplication.main(DataFlowServerApplication.java:50)在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)处在sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)在java.lang.reflect.Method.invoke(Method.java:498)在org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:47)在org.springframework.boot.loader.Launcher.launch(Launcher.java:86)在org.springframework.boot.loader.Launcher.launch(Launcher.java:50)在org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)引起原因:org.springframework.beans.BeanInstantiationException:无法实例化[org.flywaydb.core.Flyway]:工厂方法'flyway'抛出异常;嵌套异常为java.lang.RuntimeException:驱动程序org.postgresql.Driver声称不接受jdbcUrl,jdbc:postgresql:// localhost:5432在org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)在org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:622)...省略了29个通用框架引起原因:java.lang.RuntimeException:驱动程序org.postgresql.Driver声称不接受jdbcUrl,jdbc:postgresql:// localhost:5432在com.zaxxer.hikari.util.DriverDataSource。(DriverDataSource.java:108)在com.zaxxer.hikari.pool.PoolBase.initializeDataSource(PoolBase.java:336)在com.zaxxer.hikari.pool.PoolBase。(PoolBase.java:109)在com.zaxxer.hikari.pool.HikariPool。(HikariPool.java:108)在com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112)在com.zaxxer.hikari.HikariDataSource $$ FastClassBySpringCGLIB $$ eeb1ae86.invoke()在org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)在org.springframework.aop.framework.CglibAopProxy $ CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:749)在org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)在org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:136)在org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:124)在org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)在org.springframework.aop.framework.CglibAopProxy $ DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)在com.zaxxer.hikari.HikariDataSource $$ EnhancerBySpringCGLIB $$ d16b7abf.getConnection()在org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:157)在org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:115)在org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:78)在org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java:319)在org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java:356)在org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration $ LocationResolver.getDatabaseDriver(FlywayAutoConfiguration.java:395)在org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration $ LocationResolver.resolveLocations(FlywayAutoConfiguration.java:378)在org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration $ LocationResolver.resolveLocations(FlywayAutoConfiguration.java:373)在org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration $ FlywayConfiguration.configureProperties(FlywayAutoConfiguration.java:192)在org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration $ FlywayConfiguration.flyway(FlywayAutoConfiguration.java:150)处在org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration $ FlywayConfiguration $$ EnhancerBySpringCGLIB $$ 1bc90f93.CGLIB $ flyway $ 1()在org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration $ FlywayConfiguration $$ EnhancerBySpringCGLIB $$ 1bc90f93 $$ FastClassBySpringCGLIB $$ 61f0455.invoke()在org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244)在org.springframework.context.annotation.ConfigurationClassEnhancer $ BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:363)处在org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration $ FlywayConfiguration $$ EnhancerBySpringCGLIB $$ 1bc90f93.flyway()在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)处在sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)在java.lang.reflect.Method.invoke(Method.java:498)在org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)...省略30个共同的框架

您能帮我吗!

postgresql-9.3 spring-cloud-dataflow
1个回答
0
投票

似乎根本原因指向:

Driver org.postgresql.Driver声称不接受jdbcUrl,jdbc:postgresql:// localhost:5432

我注意到您的价值部分中有明显的事情。在数据库模式[ee:/ test]之前和之后似乎都有一个“空格”。您可能想尝试以下方法:

 java -Dloader.path=lib -jar spring-cloud-dataflow-server-2.2.1.RELEASE.jar \
  --spring.datasource.url=jdbc:postgresql://localhost:5432/test \
  --spring.datasource.username=postgres \
  --spring.datasource.password=root \
  --spring.datasource.driver-class-name=org.postgresql.Driver

除此之外,我认为您的属性中没有任何错误,但是我看到有些人成功地用双引号将值引起来了[请参阅:example]。

也许您也可以尝试:

-spring.datasource.url =“ jdbc:postgresql:// localhost:5432 / test”

© www.soinside.com 2019 - 2024. All rights reserved.