Tag Archives: springboot

Spring boot running appears java.lang.IllegalStateException : Failed to load ApplicationContext

complete error:

2019-04-27 19:09:18.946  INFO 12312 --- [           main] c.b.s.SpringbootHelloApplicationTests    : Starting SpringbootHelloApplicationTests on SKY-20180829MGY with PID 12312 (started by Administrator in D:\IntelliJ IDEA File\springboot_hello)
2019-04-27 19:09:18.951  INFO 12312 --- [           main] c.b.s.SpringbootHelloApplicationTests    : No active profile set, falling back to default profiles: default
2019-04-27 19:09:19.282  WARN 12312 --- [           main] o.m.s.mapper.ClassPathMapperScanner      : No MyBatis mapper was found in '[com.boot.springboot_hello]' package. Please check your configuration.
2019-04-27 19:09:19.675  WARN 12312 --- [           main] s.c.a.AnnotationConfigApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class
2019-04-27 19:09:19.680  INFO 12312 --- [           main] ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-04-27 19:09:19.682 ERROR 12312 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

Reason: Failed to determine a suitable driver class


Action:

Consider the following:
	If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
	If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).

2019-04-27 19:09:19.695 ERROR 12312 --- [           main] o.s.test.context.TestContextManager      : Caught exception while allowing TestExecutionListener [org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener@48aaecc3] to prepare test instance [com.boot.springboot_hello.SpringbootHelloApplicationTests@1700915]

java.lang.IllegalStateException: Failed to load ApplicationContext
	at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:125) ~[spring-test-5.1.6.RELEASE.jar:5.1.6.RELEASE]
	at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:108) ~[spring-test-5.1.6.RELEASE.jar:5.1.6.RELEASE]
	at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:118) ~[spring-test-5.1.6.RELEASE.jar:5.1.6.RELEASE]
	at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:83) ~[spring-test-5.1.6.RELEASE.jar:5.1.6.RELEASE]
	at org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener.prepareTestInstance(SpringBootDependencyInjectionTestExecutionListener.java:44) ~[spring-boot-test-autoconfigure-2.1.4.RELEASE.jar:2.1.4.RELEASE]
	at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:246) ~[spring-test-5.1.6.RELEASE.jar:5.1.6.RELEASE]
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:227) [spring-test-5.1.6.RELEASE.jar:5.1.6.RELEASE]
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:289) [spring-test-5.1.6.RELEASE.jar:5.1.6.RELEASE]
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) [junit-4.12.jar:4.12]
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:291) [spring-test-5.1.6.RELEASE.jar:5.1.6.RELEASE]
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:246) [spring-test-5.1.6.RELEASE.jar:5.1.6.RELEASE]
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97) [spring-test-5.1.6.RELEASE.jar:5.1.6.RELEASE]
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) [junit-4.12.jar:4.12]
	at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) [spring-test-5.1.6.RELEASE.jar:5.1.6.RELEASE]
	at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70) [spring-test-5.1.6.RELEASE.jar:5.1.6.RELEASE]
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363) [junit-4.12.jar:4.12]
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190) [spring-test-5.1.6.RELEASE.jar:5.1.6.RELEASE]
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137) [junit-4.12.jar:4.12]
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68) [junit-rt.jar:na]
	at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47) [junit-rt.jar:na]
	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242) [junit-rt.jar:na]
	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70) [junit-rt.jar:na]
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class
	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:627) ~[spring-beans-5.1.6.RELEASE.jar:5.1.6.RELEASE]
	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:607) ~[spring-beans-5.1.6.RELEASE.jar:5.1.6.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1321) ~[spring-beans-5.1.6.RELEASE.jar:5.1.6.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1160) ~[spring-beans-5.1.6.RELEASE.jar:5.1.6.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555) ~[spring-beans-5.1.6.RELEASE.jar:5.1.6.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.1.6.RELEASE.jar:5.1.6.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.6.RELEASE.jar:5.1.6.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory$$Lambda$90/1819940427.getObject(Unknown Source) ~[na:na]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.6.RELEASE.jar:5.1.6.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.6.RELEASE.jar:5.1.6.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.6.RELEASE.jar:5.1.6.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:849) ~[spring-beans-5.1.6.RELEASE.jar:5.1.6.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877) ~[spring-context-5.1.6.RELEASE.jar:5.1.6.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549) ~[spring-context-5.1.6.RELEASE.jar:5.1.6.RELEASE]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775) ~[spring-boot-2.1.4.RELEASE.jar:2.1.4.RELEASE]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) ~[spring-boot-2.1.4.RELEASE.jar:2.1.4.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:316) ~[spring-boot-2.1.4.RELEASE.jar:2.1.4.RELEASE]
	at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:127) ~[spring-boot-test-2.1.4.RELEASE.jar:2.1.4.RELEASE]
	at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:99) ~[spring-test-5.1.6.RELEASE.jar:5.1.6.RELEASE]
	at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:117) ~[spring-test-5.1.6.RELEASE.jar:5.1.6.RELEASE]
	... 25 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.1.6.RELEASE.jar:5.1.6.RELEASE]
	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:622) ~[spring-beans-5.1.6.RELEASE.jar:5.1.6.RELEASE]
	... 44 common frames omitted
Caused by: org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class
	at org.springframework.boot.autoconfigure.jdbc.DataSourceProperties.determineDriverClassName(DataSourceProperties.java:236) ~[spring-boot-autoconfigure-2.1.4.RELEASE.jar:2.1.4.RELEASE]
	at org.springframework.boot.autoconfigure.jdbc.DataSourceProperties.initializeDataSourceBuilder(DataSourceProperties.java:176) ~[spring-boot-autoconfigure-2.1.4.RELEASE.jar:2.1.4.RELEASE]
	at org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration.createDataSource(DataSourceConfiguration.java:44) ~[spring-boot-autoconfigure-2.1.4.RELEASE.jar:2.1.4.RELEASE]
	at org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration$Hikari.dataSource(DataSourceConfiguration.java:88) ~[spring-boot-autoconfigure-2.1.4.RELEASE.jar:2.1.4.RELEASE]
	at org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration$Hikari$$EnhancerBySpringCGLIB$$8f48811e.CGLIB$dataSource$0(<generated>) ~[spring-boot-autoconfigure-2.1.4.RELEASE.jar:2.1.4.RELEASE]
	at org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration$Hikari$$EnhancerBySpringCGLIB$$8f48811e$$FastClassBySpringCGLIB$$897813f0.invoke(<generated>) ~[spring-boot-autoconfigure-2.1.4.RELEASE.jar:2.1.4.RELEASE]
	at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244) ~[spring-core-5.1.6.RELEASE.jar:5.1.6.RELEASE]
	at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:363) ~[spring-context-5.1.6.RELEASE.jar:5.1.6.RELEASE]
	at org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration$Hikari$$EnhancerBySpringCGLIB$$8f48811e.dataSource(<generated>) ~[spring-boot-autoconfigure-2.1.4.RELEASE.jar:2.1.4.RELEASE]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_31]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_31]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_31]
	at java.lang.reflect.Method.invoke(Method.java:483) ~[na:1.8.0_31]
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.1.6.RELEASE.jar:5.1.6.RELEASE]
	... 45 common frames omitted


java.lang.IllegalStateException: Failed to load ApplicationContext

	at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:125)
	at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:108)
	at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:118)
	at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:83)
	at org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener.prepareTestInstance(SpringBootDependencyInjectionTestExecutionListener.java:44)
	at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:246)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:227)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:289)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:291)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:246)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
	at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
	at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class
	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:627)
	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:607)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1321)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1160)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
	at org.springframework.beans.factory.support.AbstractBeanFactory$$Lambda$90/1819940427.getObject(Unknown Source)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:849)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:316)
	at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:127)
	at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:99)
	at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:117)
	... 25 more
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:622)
	... 44 more
Caused by: org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class
	at org.springframework.boot.autoconfigure.jdbc.DataSourceProperties.determineDriverClassName(DataSourceProperties.java:236)
	at org.springframework.boot.autoconfigure.jdbc.DataSourceProperties.initializeDataSourceBuilder(DataSourceProperties.java:176)
	at org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration.createDataSource(DataSourceConfiguration.java:44)
	at org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration$Hikari.dataSource(DataSourceConfiguration.java:88)
	at org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration$Hikari$$EnhancerBySpringCGLIB$$8f48811e.CGLIB$dataSource$0(<generated>)
	at org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration$Hikari$$EnhancerBySpringCGLIB$$8f48811e$$FastClassBySpringCGLIB$$897813f0.invoke(<generated>)
	at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244)
	at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:363)
	at org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration$Hikari$$EnhancerBySpringCGLIB$$8f48811e.dataSource(<generated>)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
	... 45 more


Process finished with exit code -1

The

error may be caused by running a dependency that has nothing to do with the program, in other words, the pom.xml file is loaded with dependencies, and when you run it, you add dependencies when you know it’s not useful for the program, and that’s gilding the lily.
solution:
I found this sentence in the top five lines:

2019-04-27 19:09:17.346  WARN 12312 --- [           main] o.m.s.mapper.ClassPathMapperScanner      : No MyBatis mapper was found in '[com.boot.springboot_hello]'

, ClassPathMapperScanner is not found in my project.
because there is no mapping file for mybatis in my project, the problem is in the pot.xml.
in the pom file I found this dependency:

<dependency>
            <groupId>org.mybatis.spring.boot</groupId>
            <artifactId>mybatis-spring-boot-starter</artifactId>
            <version>2.0.1</version>
        </dependency>

delete or comment out the dependency, run, and you’re done.

Spring boot JPA Repository exception Validation failed for query for method

is

when making a jpa

code as follows

Repository

 @Query("select HomepageSection from HomepageSection where parent_id = :parentid and del_flag = '0'")
    List<HomepageSection> findChildrenSectionsByParent(@Param("parentid") String parentid);

DB

创建表HOMEPageSection(
id varchar(64) not null主键,
parent_id varchar(64)
)

实体

@Entity
@Table(name = "Homepage_section")
@Data
public class HomepageSection {
    @Id
    String id;
    String parent_id;
    String section_type;
    String section_title;
    String section_description;
    String section_image;
    String create_by;
    String update_by;
    Date create_date;
    Date update_date;
    String del_flag;


}

then exception

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'companyDescriptionServiceImpl': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'HOMEpageSectionRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Validation failed for query for method public abstract java.util.List xxx.repository.xxxweb.HOMEpageSectionRepository.findChildrenSectionsByParent(java.lang.String)!
	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:321)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1264)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)
	at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:303)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107)
	at xxx.Application.main(Application.java:23)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'HOMEpageSectionRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Validation failed for query for method public abstract java.util.List xxx.repository.xxxweb.HOMEpageSectionRepository.findChildrenSectionsByParent(java.lang.String)!
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1628)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066)
	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.autowireResource(CommonAnnotationBeanPostProcessor.java:518)
	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.getResource(CommonAnnotationBeanPostProcessor.java:496)
	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor$ResourceElement.getResourceToInject(CommonAnnotationBeanPostProcessor.java:627)
	at org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:169)
	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:318)
	... 22 common frames omitted
Caused by: java.lang.IllegalArgumentException: Validation failed for query for method public abstract java.util.List xxx.repository.xxxweb.HOMEpageSectionRepository.findChildrenSectionsByParent(java.lang.String)!
	at org.springframework.data.jpa.repository.query.SimpleJpaQuery.validateQuery(SimpleJpaQuery.java:92)
	at org.springframework.data.jpa.repository.query.SimpleJpaQuery.<init>(SimpleJpaQuery.java:62)
	at org.springframework.data.jpa.repository.query.JpaQueryFactory.fromMethodWithQueryString(JpaQueryFactory.java:72)
	at org.springframework.data.jpa.repository.query.JpaQueryFactory.fromQueryAnnotation(JpaQueryFactory.java:53)
	at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$DeclaredQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:144)
	at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$CreateIfNotFoundQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:212)
	at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$AbstractQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:77)
	at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.<init>(RepositoryFactorySupport.java:436)
	at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:221)
	at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.initAndReturn(RepositoryFactoryBeanSupport.java:277)
	at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.afterPropertiesSet(RepositoryFactoryBeanSupport.java:263)
	at org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean.afterPropertiesSet(JpaRepositoryFactoryBean.java:101)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1687)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1624)
	... 37 common frames omitted
Caused by: java.lang.IllegalStateException: No data type for node: org.hibernate.hql.internal.ast.tree.IdentNode 
 \-[IDENT] IdentNode: 'h' {originalText=h}

	at org.hibernate.hql.internal.ast.tree.SelectClause.initializeExplicitSelectClause(SelectClause.java:160)
	at org.hibernate.hql.internal.ast.HqlSqlWalker.useSelectClause(HqlSqlWalker.java:920)
	at org.hibernate.hql.internal.ast.HqlSqlWalker.processQuery(HqlSqlWalker.java:688)
	at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:673)
	at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:309)
	at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:257)
	at org.hibernate.hql.internal.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:262)
	at org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:190)
	at org.hibernate.hql.internal.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:142)
	at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:115)
	at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:76)
	at org.hibernate.engine.query.spi.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:150)
	at org.hibernate.internal.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:302)
	at org.hibernate.internal.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:240)
	at org.hibernate.internal.SessionImpl.createQuery(SessionImpl.java:1894)
	at org.hibernate.jpa.spi.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:291)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:347)
	at com.sun.proxy.$Proxy100.createQuery(Unknown Source)
	at org.springframework.data.jpa.repository.query.SimpleJpaQuery.validateQuery(SimpleJpaQuery.java:86)
	... 50 common frames omitted

tried many times and finally found the problem

because the table name HOMEpage_section cannot automatically become Entity’s table name. So I use @table (name=”HOMEpage_section”), but I feel in repository that the jpa resolution does not indicate that entity class name should be placed after the select

alias will solve the problem

 @Query("select h from HomepageSection as h where parent_id = :parentid and del_flag = '0'")
    List<HomepageSection> findChildrenSectionsByParent(@Param("parentid") String parentid);


Failed to configure a DataSource: ‘ url’ attribute

Description:. Failed to configure a DataSource: ‘ url’ attribute is not specif:Reason: Failed to determine a suitable driver class

  • error cause: database not configured
  • solution:

error cause: database

is not configured

solution:

1.配置数据库

2. Set do not configure database

  • 1
  • 2
  • 3
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)

 
 
  • 1

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile)

packaging error as shown in the figure below. Prompt: Compile the JDK version too low. Add maven packaging plug-in

to the parent project

adds the packaging plug-in

<build>

    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.1</version>
            <configuration>
                <source>11</source>
                <target>11</target>
            </configuration>
        </plugin>
    </plugins>
</build>

Local date time conversion in java8

note : LocalDateTime is

1. LocalDateTime converted to custom time format string

public static String getDateTimeAsString(LocalDateTime localDateTime, String format) {
    DateTimeFormatter formatter = DateTimeFormatter.ofPattern(format);
    return localDateTime.format(formatter);
}

2. Convert long type timestamp to LocalDateTime

public static LocalDateTime getDateTimeOfTimestamp(long timestamp) {
    Instant instant = Instant.ofEpochMilli(timestamp);
    ZoneId zone = ZoneId.systemDefault();
    return LocalDateTime.ofInstant(instant, zone);
}

3. LocalDateTime to long type timestamp

public static long getTimestampOfDateTime(LocalDateTime localDateTime) {
    ZoneId zone = ZoneId.systemDefault();
    Instant instant = localDateTime.atZone(zone).toInstant();
    return instant.toEpochMilli();
}

4. LocalDateTime

converts a time string to a custom time format

public static LocalDateTime parseStringToDateTime(String time, String format) {
    DateTimeFormatter df = DateTimeFormatter.ofPattern(format);
    return LocalDateTime.parse(time, df);
}


Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure (How to Fix)

springboot + mybatis multi-database + druid connection pool configuration was successful. Normal after the operation, access to the first database access after the second database, then the first one to visit the database complains:
the Error querying the database. The Cause: com.mysql.jdbc.exceptions.jdbc4.Com municationsException: Communications link failure
The last packet promotion received from The server was 16,202 milliseconds ago. The last packet sent to The server was 2 milliseconds ago.

complete error as follows :

2019-06-26 23:30:02.726  INFO 26160 --- [nio-8081-exec-4] o.s.b.f.xml.XmlBeanDefinitionReader      : Loading XML bean definitions from class path resource [org/springframework/jdbc/support/sql-error-codes.xml]
2019-06-26 23:30:02.754 ERROR 26160 --- [nio-8081-exec-4] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.dao.RecoverableDataAccessException: 
### Error querying database.  Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet successfully received from the server was 16,202 milliseconds ago.  The last packet sent successfully to the server was 2 milliseconds ago.
### The error may exist in com/yyd/logicserver/mapper/information/ContentMapper.java (best guess)
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: SELECT name FROM t_content limit 1
### Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet successfully received from the server was 16,202 milliseconds ago.  The last packet sent successfully to the server was 2 milliseconds ago.
; ]; Communications link failure

The last packet successfully received from the server was 16,202 milliseconds ago.  The last packet sent successfully to the server was 2 milliseconds ago.; nested exception is com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet successfully received from the server was 16,202 milliseconds ago.  The last packet sent successfully to the server was 2 milliseconds ago.] with root cause

java.io.EOFException: Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost.
	at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:3014) ~[mysql-connector-java-5.1.46.jar:5.1.46]
	at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3472) ~[mysql-connector-java-5.1.46.jar:5.1.46]
	at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3462) ~[mysql-connector-java-5.1.46.jar:5.1.46]
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3903) ~[mysql-connector-java-5.1.46.jar:5.1.46]
	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2530) ~[mysql-connector-java-5.1.46.jar:5.1.46]
	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2683) ~[mysql-connector-java-5.1.46.jar:5.1.46]
	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2486) ~[mysql-connector-java-5.1.46.jar:5.1.46]
	at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1858) ~[mysql-connector-java-5.1.46.jar:5.1.46]
	at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1197) ~[mysql-connector-java-5.1.46.jar:5.1.46]
	at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:3005) ~[druid-1.1.0.jar:1.1.0]
	at com.alibaba.druid.wall.WallFilter.preparedStatement_execute(WallFilter.java:601) ~[druid-1.1.0.jar:1.1.0]
	at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:3003) ~[druid-1.1.0.jar:1.1.0]
	at com.alibaba.druid.filter.FilterEventAdapter.preparedStatement_execute(FilterEventAdapter.java:440) ~[druid-1.1.0.jar:1.1.0]
	at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:3003) ~[druid-1.1.0.jar:1.1.0]
	at com.alibaba.druid.proxy.jdbc.PreparedStatementProxyImpl.execute(PreparedStatementProxyImpl.java:136) ~[druid-1.1.0.jar:1.1.0]
	at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:493) ~[druid-1.1.0.jar:1.1.0]
	at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:63) ~[mybatis-3.4.6.jar:3.4.6]
	at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79) ~[mybatis-3.4.6.jar:3.4.6]
	at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:63) ~[mybatis-3.4.6.jar:3.4.6]
	at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:326) ~[mybatis-3.4.6.jar:3.4.6]
	at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156) ~[mybatis-3.4.6.jar:3.4.6]
	at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109) ~[mybatis-3.4.6.jar:3.4.6]
	at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83) ~[mybatis-3.4.6.jar:3.4.6]
	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:148) ~[mybatis-3.4.6.jar:3.4.6]
	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141) ~[mybatis-3.4.6.jar:3.4.6]
	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:77) ~[mybatis-3.4.6.jar:3.4.6]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_201]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_201]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_201]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_201]
	at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:433) ~[mybatis-spring-1.3.1.jar:1.3.1]
	at com.sun.proxy.$Proxy64.selectOne(Unknown Source) ~[na:na]
	at org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:166) ~[mybatis-spring-1.3.1.jar:1.3.1]
	at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:83) ~[mybatis-3.4.6.jar:3.4.6]
	at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59) ~[mybatis-3.4.6.jar:3.4.6]
	at com.sun.proxy.$Proxy67.findContentName(Unknown Source) ~[na:na]
	at com.yyd.logicserver.controller.TestController.test(TestController.java:24) ~[classes/:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_201]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_201]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_201]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_201]
	at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:209) ~[spring-web-5.0.8.RELEASE.jar:5.0.8.RELEASE]
	at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136) ~[spring-web-5.0.8.RELEASE.jar:5.0.8.RELEASE]
	at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102) ~[spring-webmvc-5.0.8.RELEASE.jar:5.0.8.RELEASE]
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:877) ~[spring-webmvc-5.0.8.RELEASE.jar:5.0.8.RELEASE]
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:783) ~[spring-webmvc-5.0.8.RELEASE.jar:5.0.8.RELEASE]
	at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.0.8.RELEASE.jar:5.0.8.RELEASE]
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:991) ~[spring-webmvc-5.0.8.RELEASE.jar:5.0.8.RELEASE]
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:925) ~[spring-webmvc-5.0.8.RELEASE.jar:5.0.8.RELEASE]
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:974) ~[spring-webmvc-5.0.8.RELEASE.jar:5.0.8.RELEASE]
	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:866) ~[spring-webmvc-5.0.8.RELEASE.jar:5.0.8.RELEASE]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:635) ~[tomcat-embed-core-8.5.32.jar:8.5.32]
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:851) ~[spring-webmvc-5.0.8.RELEASE.jar:5.0.8.RELEASE]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) ~[tomcat-embed-core-8.5.32.jar:8.5.32]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) ~[tomcat-embed-core-8.5.32.jar:8.5.32]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.32.jar:8.5.32]
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) ~[tomcat-embed-websocket-8.5.32.jar:8.5.32]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.32.jar:8.5.32]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.32.jar:8.5.32]
	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) ~[spring-web-5.0.8.RELEASE.jar:5.0.8.RELEASE]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.8.RELEASE.jar:5.0.8.RELEASE]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.32.jar:8.5.32]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.32.jar:8.5.32]
	at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:109) ~[spring-web-5.0.8.RELEASE.jar:5.0.8.RELEASE]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.8.RELEASE.jar:5.0.8.RELEASE]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.32.jar:8.5.32]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.32.jar:8.5.32]
	at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93) ~[spring-web-5.0.8.RELEASE.jar:5.0.8.RELEASE]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.8.RELEASE.jar:5.0.8.RELEASE]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.32.jar:8.5.32]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.32.jar:8.5.32]
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200) ~[spring-web-5.0.8.RELEASE.jar:5.0.8.RELEASE]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.8.RELEASE.jar:5.0.8.RELEASE]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.32.jar:8.5.32]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.32.jar:8.5.32]
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) ~[tomcat-embed-core-8.5.32.jar:8.5.32]
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat-embed-core-8.5.32.jar:8.5.32]
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493) [tomcat-embed-core-8.5.32.jar:8.5.32]
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) [tomcat-embed-core-8.5.32.jar:8.5.32]
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) [tomcat-embed-core-8.5.32.jar:8.5.32]
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) [tomcat-embed-core-8.5.32.jar:8.5.32]
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) [tomcat-embed-core-8.5.32.jar:8.5.32]
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800) [tomcat-embed-core-8.5.32.jar:8.5.32]
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-embed-core-8.5.32.jar:8.5.32]
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:800) [tomcat-embed-core-8.5.32.jar:8.5.32]
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1471) [tomcat-embed-core-8.5.32.jar:8.5.32]
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-8.5.32.jar:8.5.32]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_201]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_201]
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.5.32.jar:8.5.32]
	at java.lang.Thread.run(Thread.java:748) [na:1.8.0_201]

, the reason is
MySQL server default “wait_timeout” is 28,800 seconds or 8 hours. (check the actual MySQL wait_timeout. If a connection is idle for more than 8 hours, MySQL automatically disconnects the connection, but the connection pool considers the connection to be valid (because the connection is not validated), resulting in an error when the application requests to use the connection.

solution :

  • 1, modify my. CNF:
    [mysqld]
    wait_timeout=31536000
    interactive_timeout=31536000
    modify the expiration time to 1 year.
  • 2. Add parameters on the connection URL: & autoReconnect=true& failOverReadOnly=false

my solution is the second method, adding &amp to the URL; autoReconnect=true& With failOverReadOnly=false, my rebuid project + restarted idea ok, no more error

Mybatis custom list collection parser

1. Write type parser

scheme 1: implement TypeHandler rewriting method
package com.aliyun.kuxuandemo.typeHandler;

import org.apache.ibatis.type.*;

import java.sql.*;
import java.util.Arrays;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *
 * @author: wb-zcx696752
 * @description:
 * @data: 2020/10/13 11:19 PM
 */

@MappedJdbcTypes(JdbcType.VARCHAR)
@MappedTypes(List.class)
public class ListTypeHandler implements TypeHandler<List<String>> {

    @Override
    public void setParameter(PreparedStatement ps, int i, List<String> parameter, JdbcType jdbcType) throws SQLException {
        StringBuffer sb = new StringBuffer();
        for (String pa : parameter) {
            sb.append(pa).append(",");
        }

        ps.setString(i, sb.toString().substring(0, sb.toString().length() - 1));
    }

    @Override
    public List<String> getResult(ResultSet resultSet, String s) throws SQLException {
        String[] split = resultSet.getString(s).split(",");
        return Arrays.asList(split);
    }

    @Override
    public List<String> getResult(ResultSet resultSet, int i) throws SQLException {
        String[] split = resultSet.getString(i).split(",");
        return Arrays.asList(split);
    }

    @Override
    public List<String> getResult(CallableStatement callableStatement, int i) throws SQLException {
        String[] split = callableStatement.getString(i).split(",");
        return Arrays.asList(split);
    }

}
scheme 2: inherit BaseTypeHandler class, override method
package com.aliyun.kuxuandemo.typeHandler;

import org.apache.ibatis.type.BaseTypeHandler;
import org.apache.ibatis.type.JdbcType;
import org.apache.ibatis.type.MappedJdbcTypes;
import org.apache.ibatis.type.MappedTypes;

import java.sql.CallableStatement;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Arrays;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *
 * @author: wb-zcx696752
 * @description:
 * @data: 2020/10/13 12:56 PM
 */
@MappedJdbcTypes(JdbcType.VARCHAR)
@MappedTypes(List.class)
public class ListTypeHandler extends BaseTypeHandler<List<String>> {
    @Override
    public void setNonNullParameter(PreparedStatement preparedStatement, int i, List<String> strings, JdbcType jdbcType) throws SQLException {
        //1.List集合转字符串
        StringBuffer sb = new StringBuffer();
        for (String string : strings) {
            sb.append(string).append(",");
        }
        //2.设置给ps
        preparedStatement.setString(i, sb.toString().substring(0, sb.toString().length() - 1));
    }

    @Override
    public List<String> getNullableResult(ResultSet resultSet, String s) throws SQLException {
        String[] split = resultSet.getString(s).split(",");
        return Arrays.asList(split);
    }

    @Override
    public List<String> getNullableResult(ResultSet resultSet, int i) throws SQLException {
        String[] split = resultSet.getString(i).split(",");
        return Arrays.asList(split);
    }

    @Override
    public List<String> getNullableResult(CallableStatement callableStatement, int i) throws SQLException {
        String[] split = callableStatement.getString(i).split(",");
        return Arrays.asList(split);
    }
}

2. Register the parser in mybatis config. XML

<typeHandlers>
        <typeHandler handler="com.aliyun.kuxuandemo.typeHandler.ListTypeHandler"/>
    </typeHandlers>

3. Use custom type parser

query
@Select("select video_id,corp_id,oss_url,title,category_list,description from video_basic_info " +
            "where video_id=#{VideoID} and corp_id=#{CorpID}")
    @Results({
            @Result(property = "videoId", column = "video_id"),
            @Result(property = "corpId", column = "corp_id"),
            @Result(property = "ossUrl", column = "oss_url"),
            @Result(property = "categoryList", column = "category_list", typeHandler = com.aliyun.kuxuandemo.typeHandler.ListTypeHandler.class)
    })
insert modification
@Update({
            "<script> ",
            "update video_basic_info ",
            "<set> ",
            "<if test = \"Title != null and Title != '' \"> ",
            "title=#{Title}, ",
            "</if> ",
            "<if test = \"Desc != null and Desc != '' \"> ",
            "description=#{Desc}, ",
            "</if> ",
            "<if test = \"Tag != null and Tag.size() > 0 \"> ",
            "category_list=#{Tag,javaType=List,jdbcType=VARCHAR,typeHandler=com.aliyun.kuxuandemo.typeHandler.ArrayTypeHandler} ",
            "</if> ",
            "</set> ",
            "where video_id=#{VideoID} and corp_id=#{CorpID}",
            "</script>"
    })
    int updateVideoBasicInfoTitleDescTag(BaseRequestParameterValidationModel parameter);

Caused by: org.yaml.snakeyaml.parser.ParserException: while parsing a block collection

Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dspring.jmx.enabled=true -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true -javaagent:D:\LANCE_SYSTEM_TOOLS\Tools\After_Tools\JetBrains\IntelliJIDEA2020.1.1\lib\idea_rt.jar=4156:D:\LANCE_SYSTEM_TOOLS\Tools\After_Tools\JetBrains\IntelliJIDEA2020.1.1\bin -Dfile.encoding=UTF-8 -classpath D:\LANCE_SYSTEM_TOOLS\Configuration\Java\Java_1.8.0_131\jre\lib\charsets.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Java\Java_1.8.0_131\jre\lib\deploy.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Java\Java_1.8.0_131\jre\lib\ext\access-bridge-64.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Java\Java_1.8.0_131\jre\lib\ext\cldrdata.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Java\Java_1.8.0_131\jre\lib\ext\dnsns.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Java\Java_1.8.0_131\jre\lib\ext\jaccess.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Java\Java_1.8.0_131\jre\lib\ext\jfxrt.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Java\Java_1.8.0_131\jre\lib\ext\localedata.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Java\Java_1.8.0_131\jre\lib\ext\nashorn.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Java\Java_1.8.0_131\jre\lib\ext\sunec.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Java\Java_1.8.0_131\jre\lib\ext\sunjce_provider.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Java\Java_1.8.0_131\jre\lib\ext\sunmscapi.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Java\Java_1.8.0_131\jre\lib\ext\sunpkcs11.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Java\Java_1.8.0_131\jre\lib\ext\zipfs.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Java\Java_1.8.0_131\jre\lib\javaws.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Java\Java_1.8.0_131\jre\lib\jce.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Java\Java_1.8.0_131\jre\lib\jfr.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Java\Java_1.8.0_131\jre\lib\jfxswt.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Java\Java_1.8.0_131\jre\lib\jsse.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Java\Java_1.8.0_131\jre\lib\management-agent.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Java\Java_1.8.0_131\jre\lib\plugin.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Java\Java_1.8.0_131\jre\lib\resources.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Java\Java_1.8.0_131\jre\lib\rt.jar;E:\Java\IDEA\SpringCloud\cloud-gateway\target\classes;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\springframework\cloud\spring-cloud-starter-gateway\2.2.3.RELEASE\spring-cloud-starter-gateway-2.2.3.RELEASE.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\springframework\cloud\spring-cloud-starter\2.2.3.RELEASE\spring-cloud-starter-2.2.3.RELEASE.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\springframework\cloud\spring-cloud-context\2.2.3.RELEASE\spring-cloud-context-2.2.3.RELEASE.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\springframework\security\spring-security-crypto\5.3.2.RELEASE\spring-security-crypto-5.3.2.RELEASE.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\springframework\cloud\spring-cloud-commons\2.2.3.RELEASE\spring-cloud-commons-2.2.3.RELEASE.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\springframework\security\spring-security-rsa\1.0.9.RELEASE\spring-security-rsa-1.0.9.RELEASE.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\bouncycastle\bcpkix-jdk15on\1.64\bcpkix-jdk15on-1.64.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\bouncycastle\bcprov-jdk15on\1.64\bcprov-jdk15on-1.64.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\springframework\cloud\spring-cloud-gateway-core\2.2.3.RELEASE\spring-cloud-gateway-core-2.2.3.RELEASE.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\springframework\boot\spring-boot-starter-validation\2.3.0.RELEASE\spring-boot-starter-validation-2.3.0.RELEASE.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\glassfish\jakarta.el\3.0.3\jakarta.el-3.0.3.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\hibernate\validator\hibernate-validator\6.1.5.Final\hibernate-validator-6.1.5.Final.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\jakarta\validation\jakarta.validation-api\2.0.2\jakarta.validation-api-2.0.2.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\jboss\logging\jboss-logging\3.4.1.Final\jboss-logging-3.4.1.Final.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\com\fasterxml\classmate\1.5.1\classmate-1.5.1.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\io\projectreactor\addons\reactor-extra\3.3.3.RELEASE\reactor-extra-3.3.3.RELEASE.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\io\projectreactor\reactor-core\3.3.5.RELEASE\reactor-core-3.3.5.RELEASE.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\reactivestreams\reactive-streams\1.0.3\reactive-streams-1.0.3.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\springframework\boot\spring-boot-starter-webflux\2.3.0.RELEASE\spring-boot-starter-webflux-2.3.0.RELEASE.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\springframework\boot\spring-boot-starter-json\2.3.0.RELEASE\spring-boot-starter-json-2.3.0.RELEASE.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.11.0\jackson-datatype-jdk8-2.11.0.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.11.0\jackson-datatype-jsr310-2.11.0.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\com\fasterxml\jackson\module\jackson-module-parameter-names\2.11.0\jackson-module-parameter-names-2.11.0.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\springframework\boot\spring-boot-starter-reactor-netty\2.3.0.RELEASE\spring-boot-starter-reactor-netty-2.3.0.RELEASE.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\io\projectreactor\netty\reactor-netty\0.9.7.RELEASE\reactor-netty-0.9.7.RELEASE.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\io\netty\netty-codec-http\4.1.49.Final\netty-codec-http-4.1.49.Final.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\io\netty\netty-common\4.1.49.Final\netty-common-4.1.49.Final.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\io\netty\netty-buffer\4.1.49.Final\netty-buffer-4.1.49.Final.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\io\netty\netty-transport\4.1.49.Final\netty-transport-4.1.49.Final.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\io\netty\netty-codec\4.1.49.Final\netty-codec-4.1.49.Final.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\io\netty\netty-codec-http2\4.1.49.Final\netty-codec-http2-4.1.49.Final.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\io\netty\netty-handler\4.1.49.Final\netty-handler-4.1.49.Final.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\io\netty\netty-resolver\4.1.49.Final\netty-resolver-4.1.49.Final.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\io\netty\netty-handler-proxy\4.1.49.Final\netty-handler-proxy-4.1.49.Final.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\io\netty\netty-codec-socks\4.1.49.Final\netty-codec-socks-4.1.49.Final.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\io\netty\netty-transport-native-epoll\4.1.49.Final\netty-transport-native-epoll-4.1.49.Final-linux-x86_64.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\io\netty\netty-transport-native-unix-common\4.1.49.Final\netty-transport-native-unix-common-4.1.49.Final.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\springframework\spring-web\5.2.6.RELEASE\spring-web-5.2.6.RELEASE.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\springframework\spring-beans\5.2.6.RELEASE\spring-beans-5.2.6.RELEASE.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\springframework\spring-webflux\5.2.6.RELEASE\spring-webflux-5.2.6.RELEASE.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\synchronoss\cloud\nio-multipart-parser\1.1.0\nio-multipart-parser-1.1.0.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\synchronoss\cloud\nio-stream-storage\1.1.3\nio-stream-storage-1.1.3.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\springframework\cloud\spring-cloud-starter-netflix-eureka-client\2.2.3.RELEASE\spring-cloud-starter-netflix-eureka-client-2.2.3.RELEASE.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\springframework\cloud\spring-cloud-netflix-hystrix\2.2.3.RELEASE\spring-cloud-netflix-hystrix-2.2.3.RELEASE.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\springframework\boot\spring-boot-autoconfigure\2.3.0.RELEASE\spring-boot-autoconfigure-2.3.0.RELEASE.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\springframework\boot\spring-boot-starter-aop\2.3.0.RELEASE\spring-boot-starter-aop-2.3.0.RELEASE.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\springframework\spring-aop\5.2.6.RELEASE\spring-aop-5.2.6.RELEASE.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\aspectj\aspectjweaver\1.9.5\aspectjweaver-1.9.5.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\springframework\cloud\spring-cloud-netflix-eureka-client\2.2.3.RELEASE\spring-cloud-netflix-eureka-client-2.2.3.RELEASE.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\com\netflix\eureka\eureka-client\1.9.21\eureka-client-1.9.21.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\codehaus\jettison\jettison\1.3.7\jettison-1.3.7.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\stax\stax-api\1.0.1\stax-api-1.0.1.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\com\netflix\netflix-commons\netflix-eventbus\0.3.0\netflix-eventbus-0.3.0.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\com\netflix\netflix-commons\netflix-infix\0.3.0\netflix-infix-0.3.0.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\commons-jxpath\commons-jxpath\1.3\commons-jxpath-1.3.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\joda-time\joda-time\2.3\joda-time-2.3.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\antlr\antlr-runtime\3.4\antlr-runtime-3.4.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\antlr\stringtemplate\3.2.1\stringtemplate-3.2.1.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\antlr\antlr\2.7.7\antlr-2.7.7.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\com\google\code\gson\gson\2.8.6\gson-2.8.6.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\apache\commons\commons-math\2.2\commons-math-2.2.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\com\netflix\archaius\archaius-core\0.7.6\archaius-core-0.7.6.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\com\google\guava\guava\29.0-android\guava-29.0-android.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\com\google\guava\failureaccess\1.0.1\failureaccess-1.0.1.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\com\google\guava\listenablefuture\9999.0-empty-to-avoid-conflict-with-guava\listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\checkerframework\checker-compat-qual\2.5.5\checker-compat-qual-2.5.5.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\com\google\errorprone\error_prone_annotations\2.3.4\error_prone_annotations-2.3.4.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\com\google\j2objc\j2objc-annotations\1.3\j2objc-annotations-1.3.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\javax\ws\rs\jsr311-api\1.1.1\jsr311-api-1.1.1.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\com\netflix\servo\servo-core\0.12.21\servo-core-0.12.21.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\com\sun\jersey\jersey-core\1.19.1\jersey-core-1.19.1.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\com\sun\jersey\jersey-client\1.19.1\jersey-client-1.19.1.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\com\sun\jersey\contribs\jersey-apache-client4\1.19.1\jersey-apache-client4-1.19.1.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\apache\httpcomponents\httpclient\4.5.12\httpclient-4.5.12.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\apache\httpcomponents\httpcore\4.4.13\httpcore-4.4.13.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\commons-codec\commons-codec\1.14\commons-codec-1.14.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\commons-configuration\commons-configuration\1.10\commons-configuration-1.10.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\commons-lang\commons-lang\2.6\commons-lang-2.6.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\com\google\inject\guice\4.1.0\guice-4.1.0.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\javax\inject\javax.inject\1\javax.inject-1.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\aopalliance\aopalliance\1.0\aopalliance-1.0.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\com\fasterxml\jackson\core\jackson-annotations\2.11.0\jackson-annotations-2.11.0.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\com\fasterxml\jackson\core\jackson-core\2.11.0\jackson-core-2.11.0.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\com\fasterxml\jackson\core\jackson-databind\2.11.0\jackson-databind-2.11.0.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\com\fasterxml\jackson\dataformat\jackson-dataformat-xml\2.11.0\jackson-dataformat-xml-2.11.0.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\com\fasterxml\jackson\module\jackson-module-jaxb-annotations\2.11.0\jackson-module-jaxb-annotations-2.11.0.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\codehaus\woodstox\stax2-api\4.2\stax2-api-4.2.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\com\fasterxml\woodstox\woodstox-core\5.3.0\woodstox-core-5.3.0.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\com\netflix\eureka\eureka-core\1.9.21\eureka-core-1.9.21.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\springframework\cloud\spring-cloud-starter-netflix-archaius\2.2.3.RELEASE\spring-cloud-starter-netflix-archaius-2.2.3.RELEASE.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\springframework\cloud\spring-cloud-netflix-ribbon\2.2.3.RELEASE\spring-cloud-netflix-ribbon-2.2.3.RELEASE.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\springframework\cloud\spring-cloud-netflix-archaius\2.2.3.RELEASE\spring-cloud-netflix-archaius-2.2.3.RELEASE.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\springframework\cloud\spring-cloud-starter-netflix-ribbon\2.2.3.RELEASE\spring-cloud-starter-netflix-ribbon-2.2.3.RELEASE.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\com\netflix\ribbon\ribbon\2.3.0\ribbon-2.3.0.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\com\netflix\ribbon\ribbon-transport\2.3.0\ribbon-transport-2.3.0.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\io\reactivex\rxnetty-contexts\0.4.9\rxnetty-contexts-0.4.9.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\io\reactivex\rxnetty-servo\0.4.9\rxnetty-servo-0.4.9.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\com\netflix\hystrix\hystrix-core\1.5.18\hystrix-core-1.5.18.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\hdrhistogram\HdrHistogram\2.1.9\HdrHistogram-2.1.9.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\io\reactivex\rxnetty\0.4.9\rxnetty-0.4.9.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\com\netflix\ribbon\ribbon-core\2.3.0\ribbon-core-2.3.0.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\com\netflix\ribbon\ribbon-httpclient\2.3.0\ribbon-httpclient-2.3.0.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\commons-collections\commons-collections\3.2.2\commons-collections-3.2.2.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\com\netflix\netflix-commons\netflix-commons-util\0.3.0\netflix-commons-util-0.3.0.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\com\netflix\ribbon\ribbon-loadbalancer\2.3.0\ribbon-loadbalancer-2.3.0.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\com\netflix\netflix-commons\netflix-statistics\0.1.1\netflix-statistics-0.1.1.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\io\reactivex\rxjava\1.3.8\rxjava-1.3.8.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\springframework\cloud\spring-cloud-starter-loadbalancer\2.2.3.RELEASE\spring-cloud-starter-loadbalancer-2.2.3.RELEASE.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\springframework\cloud\spring-cloud-loadbalancer\2.2.3.RELEASE\spring-cloud-loadbalancer-2.2.3.RELEASE.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\springframework\boot\spring-boot-starter-cache\2.3.0.RELEASE\spring-boot-starter-cache-2.3.0.RELEASE.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\springframework\spring-context-support\5.2.6.RELEASE\spring-context-support-5.2.6.RELEASE.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\com\stoyanr\evictor\1.0.0\evictor-1.0.0.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\com\netflix\ribbon\ribbon-eureka\2.3.0\ribbon-eureka-2.3.0.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\slf4j\slf4j-api\1.7.30\slf4j-api-1.7.30.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\com\thoughtworks\xstream\xstream\1.4.11.1\xstream-1.4.11.1.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\xmlpull\xmlpull\1.1.3.1\xmlpull-1.1.3.1.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\xpp3\xpp3_min\1.1.4c\xpp3_min-1.1.4c.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\springframework\boot\spring-boot-starter\2.3.0.RELEASE\spring-boot-starter-2.3.0.RELEASE.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\springframework\boot\spring-boot\2.3.0.RELEASE\spring-boot-2.3.0.RELEASE.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\springframework\spring-context\5.2.6.RELEASE\spring-context-5.2.6.RELEASE.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\springframework\spring-expression\5.2.6.RELEASE\spring-expression-5.2.6.RELEASE.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\springframework\boot\spring-boot-starter-logging\2.3.0.RELEASE\spring-boot-starter-logging-2.3.0.RELEASE.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\ch\qos\logback\logback-classic\1.2.3\logback-classic-1.2.3.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\ch\qos\logback\logback-core\1.2.3\logback-core-1.2.3.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\apache\logging\log4j\log4j-to-slf4j\2.13.2\log4j-to-slf4j-2.13.2.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\apache\logging\log4j\log4j-api\2.13.2\log4j-api-2.13.2.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\slf4j\jul-to-slf4j\1.7.30\jul-to-slf4j-1.7.30.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\jakarta\annotation\jakarta.annotation-api\1.3.5\jakarta.annotation-api-1.3.5.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\yaml\snakeyaml\1.26\snakeyaml-1.26.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\jakarta\xml\bind\jakarta.xml.bind-api\2.3.3\jakarta.xml.bind-api-2.3.3.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\jakarta\activation\jakarta.activation-api\1.2.2\jakarta.activation-api-1.2.2.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\springframework\spring-core\5.2.6.RELEASE\spring-core-5.2.6.RELEASE.jar;D:\LANCE_SYSTEM_TOOLS\Configuration\Maven\repository\org\springframework\spring-jcl\5.2.6.RELEASE\spring-jcl-5.2.6.RELEASE.jar com.springboot.CloudGatewayApplication
2020-06-07 11:12:17.927 ERROR 14380 --- [           main] o.s.boot.SpringApplication               : Application run failed

java.lang.IllegalStateException: Failed to load property source from 'file:/E:/Java/IDEA/SpringCloud/cloud-gateway/target/classes/application.yml' (classpath:/application.yml)
	at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.load(ConfigFileApplicationListener.java:554) ~[spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE]
	at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.loadForFileExtension(ConfigFileApplicationListener.java:499) ~[spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE]
	at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.load(ConfigFileApplicationListener.java:469) ~[spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE]
	at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.lambda$null$7(ConfigFileApplicationListener.java:448) ~[spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE]
	at java.lang.Iterable.forEach(Iterable.java:75) ~[na:1.8.0_131]
	at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.lambda$load$8(ConfigFileApplicationListener.java:448) ~[spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE]
	at java.lang.Iterable.forEach(Iterable.java:75) ~[na:1.8.0_131]
	at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.load(ConfigFileApplicationListener.java:445) ~[spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE]
	at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.lambda$load$0(ConfigFileApplicationListener.java:348) ~[spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE]
	at org.springframework.boot.context.config.FilteredPropertySource.apply(FilteredPropertySource.java:54) ~[spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE]
	at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.load(ConfigFileApplicationListener.java:336) ~[spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE]
	at org.springframework.boot.context.config.ConfigFileApplicationListener.addPropertySources(ConfigFileApplicationListener.java:226) ~[spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE]
	at org.springframework.boot.context.config.ConfigFileApplicationListener.postProcessEnvironment(ConfigFileApplicationListener.java:210) ~[spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE]
	at org.springframework.boot.context.config.ConfigFileApplicationListener.onApplicationEnvironmentPreparedEvent(ConfigFileApplicationListener.java:200) ~[spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE]
	at org.springframework.boot.context.config.ConfigFileApplicationListener.onApplicationEvent(ConfigFileApplicationListener.java:188) ~[spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE]
	at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) ~[spring-context-5.2.6.RELEASE.jar:5.2.6.RELEASE]
	at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) ~[spring-context-5.2.6.RELEASE.jar:5.2.6.RELEASE]
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) ~[spring-context-5.2.6.RELEASE.jar:5.2.6.RELEASE]
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:127) ~[spring-context-5.2.6.RELEASE.jar:5.2.6.RELEASE]
	at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:80) ~[spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE]
	at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:53) ~[spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE]
	at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:345) [spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:308) [spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237) [spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) [spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE]
	at com.springboot.CloudGatewayApplication.main(CloudGatewayApplication.java:15) [classes/:na]
Caused by: org.yaml.snakeyaml.parser.ParserException: while parsing a block collection
 in 'reader', line 7, column 9:
            - id: CLOUD-PROVIDER-MOVIE     # ... 
            ^
expected <block end>, but found '?'
 in 'reader', line 8, column 9:
            uri: http://localhost:9000   # 配 ... 
            ^

	at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockSequenceEntry.produce(ParserImpl.java:516) ~[snakeyaml-1.26.jar:na]
	at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:158) ~[snakeyaml-1.26.jar:na]
	at org.yaml.snakeyaml.parser.ParserImpl.checkEvent(ParserImpl.java:148) ~[snakeyaml-1.26.jar:na]
	at org.yaml.snakeyaml.composer.Composer.composeSequenceNode(Composer.java:208) ~[snakeyaml-1.26.jar:na]
	at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:160) ~[snakeyaml-1.26.jar:na]
	at org.yaml.snakeyaml.composer.Composer.composeValueNode(Composer.java:257) ~[snakeyaml-1.26.jar:na]
	at org.yaml.snakeyaml.composer.Composer.composeMappingChildren(Composer.java:248) ~[snakeyaml-1.26.jar:na]
	at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:236) ~[snakeyaml-1.26.jar:na]
	at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:162) ~[snakeyaml-1.26.jar:na]
	at org.yaml.snakeyaml.composer.Composer.composeValueNode(Composer.java:257) ~[snakeyaml-1.26.jar:na]
	at org.yaml.snakeyaml.composer.Composer.composeMappingChildren(Composer.java:248) ~[snakeyaml-1.26.jar:na]
	at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:236) ~[snakeyaml-1.26.jar:na]
	at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:162) ~[snakeyaml-1.26.jar:na]
	at org.yaml.snakeyaml.composer.Composer.composeValueNode(Composer.java:257) ~[snakeyaml-1.26.jar:na]
	at org.yaml.snakeyaml.composer.Composer.composeMappingChildren(Composer.java:248) ~[snakeyaml-1.26.jar:na]
	at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:236) ~[snakeyaml-1.26.jar:na]
	at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:162) ~[snakeyaml-1.26.jar:na]
	at org.yaml.snakeyaml.composer.Composer.composeValueNode(Composer.java:257) ~[snakeyaml-1.26.jar:na]
	at org.yaml.snakeyaml.composer.Composer.composeMappingChildren(Composer.java:248) ~[snakeyaml-1.26.jar:na]
	at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:236) ~[snakeyaml-1.26.jar:na]
	at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:162) ~[snakeyaml-1.26.jar:na]
	at org.yaml.snakeyaml.composer.Composer.getNode(Composer.java:95) ~[snakeyaml-1.26.jar:na]
	at org.yaml.snakeyaml.constructor.BaseConstructor.getData(BaseConstructor.java:134) ~[snakeyaml-1.26.jar:na]
	at org.yaml.snakeyaml.Yaml$1.next(Yaml.java:494) ~[snakeyaml-1.26.jar:na]
	at org.springframework.beans.factory.config.YamlProcessor.process(YamlProcessor.java:160) ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE]
	at org.springframework.beans.factory.config.YamlProcessor.process(YamlProcessor.java:134) ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE]
	at org.springframework.boot.env.OriginTrackedYamlLoader.load(OriginTrackedYamlLoader.java:75) ~[spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE]
	at org.springframework.boot.env.YamlPropertySourceLoader.load(YamlPropertySourceLoader.java:50) ~[spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE]
	at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.loadDocuments(ConfigFileApplicationListener.java:608) ~[spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE]
	at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.load(ConfigFileApplicationListener.java:524) ~[spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE]
	... 25 common frames omitted


Process finished with exit code 1

solution :

  1. check whether the node directory level in the yml configuration file checks

against its

  • YAML, yml online editor (validator)
  • Result Maps collection already contains value for com.xxx.xxxMapper . baseresultmap problem solving

    remove the cache first,

    mybatis appear Result Maps collection already contains the value for the com. XXX. XxxMapper. R. aseResultMap mistakes,

    could both be a problem with MybatisGenerator’s reverse generation.

    suppose MybatisGenerator is used to reverse-engineer the code to generate the dao file and mapper.xml file,

    after clearing the cache, carefully examine the mapper.xml file that was previously generated!

    if the code is generated again, the generated code must be deleted first, otherwise it will be appended to the original file. Carefully check the mapper.xml file

    to see if there are two resultMap with id BaseResultMap, delete the redundant ones, and keep only one to solve the problem.

    or remove the mapper.xml file and regenerate.

    Springboot error: property ‘sqlsessionfactory’ or ‘sqlsessiontemplate’ are required error details

    problem 1

    is in the Mapper layer and it needs to be annotated with @mapper, but then someone put @respository online and it gets mixed up and it could be either one. It’s always going to be @mapper. Add the annotations, but if the Mapper layer in the configuration main class SpringBootMybatisApplication inside there is no need for @ MapperScan (” com. Example. Demo. Mapper “) scans annotations, add scan to the configuration class notes mean under this package all annotations into Mapper.

    problem 2

    SpringBoot project created with STS, where the configuration file defaults to application.properties, where the data source is typically configured. But want to play this file, you must add @ EnableAutoConfiguration to configure the main class (exclude = {DataSourceAutoConfiguration. Class}) automatic injection, otherwise the configuration in the configuration file is invalid. Failed to configure a DataSource: ‘URL’ attribute is not specified and no embedded DataSource could be configured. Error

    but if this annotation is added at this time,

    is dependent on the jar package in Mybatis

    <dependency>
    	<groupId>org.mybatis.spring.boot</groupId>
    	<artifactId>mybatis-spring-boot-starter</artifactId>
    	<version>1.3.2</ version>
    </dependency>
    

    problem three

    Automatic injection of SqlSessionFactory and SqlSessionTemplate is cancelled in

    mybatis spring-1.3.2, so Property ‘SqlSessionFactory’ or ‘SqlSessionTemplate’ are required error will be reported.
    you need to find a solution, so search the web for a solution, refer to this article, create a base class, and then let your dao inherit.

    https://www.cnblogs.com/hawk0035/p/3337283.html?utm_source=tuicool

    but my Mapper layer is using the annotated version of Mybatis, which is an interface and cannot inherit classes. So that’s not going to work.
    since auto injection was eliminated in mybatis spring-1.3.2, I switched to a lower version of mybatis spring-1.1.1, but the fact remains the same, nothing has changed.

    it is to find a way to don’t @ EnableAutoConfiguration (exclude = {DataSourceAutoConfiguration. Class}) automatic injection, so must the application. The properties to the application configuration file. The yml. The problem was finally solved.

    Solution of redisconnection factory in springboot2 not Autowired

    1. No redis package imported, then import the following jar package to solve

    <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-data-redis</artifactId>
            </dependency>
    

    2. Do the project separation, so pay attention to the @component scanning scope of the Application startup class, default scanning of the Application startup class package and the beans under the subpackage.
    is redis – common such as A project, A project of the package name is com.zhangsan.com mon. Redis. B project imports the JAR package of A project, the package name of B project is com. Zhangsan.service.B, then the Application start-up class of B project should be placed under com. Zhangsan, so as to load the beans of A project into A project.