Java 更新您的应用程序';Spring Boot中的s配置
运行Spring引导应用程序时,在Spring引导错误中更新应用程序的配置 maven已成功构建,但错误仍然存在 我应该怎么做才能克服这个错误Java 更新您的应用程序';Spring Boot中的s配置,java,spring-boot,spring-hateoas,Java,Spring Boot,Spring Hateoas,运行Spring引导应用程序时,在Spring引导错误中更新应用程序的配置 maven已成功构建,但错误仍然存在 我应该怎么做才能克服这个错误 . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____|
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.0.0.M4)
2018-06-08 12:45:36.422 INFO 8904 --- [ main] com.lankydan.Application : Starting Application on GH-6C9HNH2 with PID 8904 (C:\Users\E080978\Downloads\Maven\spring-boot-hateoas-master\target\classes started by E080978 in C:\Users\E080978\Downloads\Maven\spring-boot-hateoas-master)
2018-06-08 12:45:36.426 INFO 8904 --- [ main] com.lankydan.Application : No active profile set, falling back to default profiles: default
2018-06-08 12:45:36.484 INFO 8904 --- [ main] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@2805c96b: startup date [Fri Jun 08 12:45:36 IST 2018]; root of context hierarchy
2018-06-08 12:45:37.897 INFO 8904 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$3a19c841] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-06-08 12:45:38.652 INFO 8904 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8090 (http)
2018-06-08 12:45:38.672 INFO 8904 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2018-06-08 12:45:38.673 INFO 8904 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.20
2018-06-08 12:45:38.818 INFO 8904 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2018-06-08 12:45:38.818 INFO 8904 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 2337 ms
2018-06-08 12:45:39.020 INFO 8904 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Mapping servlet: 'dispatcherServlet' to [/]
2018-06-08 12:45:39.025 INFO 8904 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*]
2018-06-08 12:45:39.025 INFO 8904 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2018-06-08 12:45:39.026 INFO 8904 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2018-06-08 12:45:39.026 INFO 8904 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*]
2018-06-08 12:45:39.075 WARN 8904 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Unsatisfied dependency expressed through method 'dataSource' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'spring.datasource-org.springframework.boot.autoconfigure.jdbc.DataSourceProperties': Could not bind properties to 'DataSourceProperties': prefix=spring.datasource, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'spring.datasource.password' to java.lang.String
2018-06-08 12:45:39.077 INFO 8904 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2018-06-08 12:45:39.098 INFO 8904 --- [ main] utoConfigurationReportLoggingInitializer :
Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2018-06-08 12:45:39.103 ERROR 8904 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
Binding to target [Bindable@6bff19ff type = java.lang.String, value = 'provided', annotations = array<Annotation>[[empty]]] failed:
Property: spring.datasource.password
Value: ${password}
Origin: class path resource [application.properties]:7:28
Reason: Could not resolve placeholder 'password' in value "${password}"
Action:
Update your application's configuration
。\uuuuuuuuuuuu_
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
::弹簧靴::(v2.0.0.M4)
2018-06-08 12:45:36.422 INFO 8904-[main]com.lankydan.Application:使用PID 8904在GH-6C9HNH2上启动应用程序(C:\Users\E080978\Downloads\Maven\spring boot hateoas master\target\由E080978在C:\Users\E080978\Downloads\Maven\spring boot hateoas master中启动的类)
2018-06-08 12:45:36.426信息8904---[main]com.lankydan.Application:未设置活动配置文件,返回默认配置文件:默认
2018-06-08 12:45:36.484信息8904---[main]配置ServletWebServerApplicationContext:刷新org.springframework.boot.web.servlet.context。AnnotationConfigServletWebServerApplicationContext@2805c96b:启动日期[Fri Jun 08 12:45:36 IST 2018];上下文层次结构的根
2018-06-08 12:45:37.897信息8904-[main]trationlegate$BeanPostProcessorChecker:Bean'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration'类型为[org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$3a19c841]不符合由所有BeanPostProcessor处理的条件(例如:不符合自动代理的条件)
2018-06-08 12:45:38.652信息8904---[main]o.s.b.w.embedded.tomcat.TomcatWebServer:tomcat已用端口初始化:8090(http)
2018-06-08 12:45:38.672信息8904---[main]o.apache.catalina.core.StandardService:启动服务[Tomcat]
2018-06-08 12:45:38.673信息8904---[main]org.apache.catalina.core.StandardEngine:启动Servlet引擎:apache Tomcat/8.5.20
2018-06-08 12:45:38.818信息8904---[ost-startStop-1]o.a.c.c.c.[Tomcat].[localhost].[/]:初始化Spring嵌入式WebApplicationContext
2018-06-08 12:45:38.818信息8904---[ost-startStop-1]o.s.web.context.ContextLoader:根WebApplicationContext:初始化在2337毫秒内完成
2018-06-08 12:45:39.020信息8904---[ost-startStop-1]o.s.b.w.servlet.ServletRegistrationBean:将servlet:“dispatcherServlet”映射到[/]
2018-06-08 12:45:39.025信息8904---[ost-startStop-1]o.s.b.w.servlet.FilterRegistrationBean:将筛选器:“characterEncodingFilter”映射到:[/*]
2018-06-08 12:45:39.025信息8904---[ost-startStop-1]o.s.b.w.servlet.FilterRegistrationBean:将筛选器:“hiddenHttpMethodFilter”映射到:[/*]
2018-06-08 12:45:39.026信息8904---[ost-startStop-1]o.s.b.w.servlet.FilterRegistrationBean:将筛选器:“httpPutFormContentFilter”映射到:[/*]
2018-06-08 12:45:39.026信息8904---[ost-startStop-1]o.s.b.w.servlet.FilterRegistrationBean:将筛选器:“requestContextFilter”映射到:[/*]
2018-06-08 12:45:39.075警告8904---[主要]ConfigServletWebServerApplicationContext:在上下文初始化过程中遇到异常-取消刷新尝试:org.springframework.beans.factory.unsatifiedDependencyException:创建名为“org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration”的bean时出错:未满足的依赖项通过构造函数参数0;嵌套异常为org.springframework.beans.factory.UnsatisfiedDependencyException:创建名为“dataSource”的bean时出错,该bean在类路径资源[org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]:通过方法“dataSource”参数0表示的未满足的依赖关系;嵌套异常为org.springframework.beans.factory.BeanCreationException:创建名为“spring.datasource org.springframework.boot.autoconfigure.jdbc.DataSourceProperties”的bean时出错:无法将属性绑定到“DataSourceProperties”:前缀=spring.datasource,ignoreInvalidFields=false,ignoreUnknownFields=true;嵌套异常为org.springframework.boot.context.properties.bind.BindException:未能将“spring.datasource.password”下的属性绑定到java.lang.String
2018-06-08 12:45:39.077信息8904---[main]o.apache.catalina.core.StandardService:停止服务[Tomcat]
2018-06-08 12:45:39.098信息8904---[main]自动配置报告日志初始化器:
启动ApplicationContext时出错。要显示自动配置报告,请在启用“调试”的情况下重新运行应用程序。
2018-06-08 12:45:39.103错误8904---[main]o.s.b.d.记录故障分析报告员:
***************************
应用程序无法启动
***************************
说明:
绑定到目标[Bindable@6bff19ff类型=java.lang.String,值='provided',注释=数组[[empty]]]]失败:
属性:spring.datasource.password
值:${password}
来源:类路径资源[应用程序.属性]:7:28
原因:无法解析值“${password}”中的占位符“password”
行动:
更新应用程序的配置
您似乎尚未声明您试图在“spring.datasource.password”属性中使用的属性“password”(或其声明有问题)。
但是,如果看不到整个属性文件,就很难说清楚。您必须打开maven资源插件的筛选功能。您必须在POM中添加一个
标记,并将其设置为true
在“流程资源”阶段,maven可能需要用真实密码替换${password}
变量
有关更多信息,请参阅: