Я попытался обновить приложение до более новой версии Spring Boot 2, и теперь у меня возникла проблема во время запуска, которую я не могу объяснить.
Здесь журнал:
2020-05-28 09:23:41.408 INFO 10784 --- [ main] d.v.h.Application : Starting Application on E0088856 with PID 10784 (_\target\classes started by _ in _)
2020-05-28 09:23:41.412 INFO 10784 --- [ main] d.v.h.Application : The following profiles are active: server
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/_/Maven_Repository/org/codehaus/groovy/groovy/2.5.11/groovy-2.5.11.jar) to method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
2020-05-28 09:23:42.927 INFO 10784 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2020-05-28 09:23:43.334 INFO 10784 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 401ms. Found 10 JPA repository interfaces.
2020-05-28 09:23:44.055 INFO 10784 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler@508ad266' of type [org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-05-28 09:23:44.060 INFO 10784 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'methodSecurityMetadataSource' of type [org.springframework.security.access.method.DelegatingMethodSecurityMetadataSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-05-28 09:23:44.455 INFO 10784 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2020-05-28 09:23:44.464 INFO 10784 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2020-05-28 09:23:44.464 INFO 10784 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.35]
2020-05-28 09:23:44.662 INFO 10784 --- [ main] o.a.c.c.C.[.[localhost].[/hamster] : Initializing Spring embedded WebApplicationContext
2020-05-28 09:23:44.662 INFO 10784 --- [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 3076 ms
2020-05-28 09:23:44.914 WARN 10784 --- [ main] JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2020-05-28 09:23:44.995 INFO 10784 --- [ main] o.f.c.internal.license.VersionPrinter : Flyway Community Edition 6.4.1 by Redgate
2020-05-28 09:24:01.370 ERROR 10784 --- [ main] o.s.b.web.embedded.tomcat.TomcatStarter : Error starting Tomcat context. Exception: org.springframework.beans.factory.UnsatisfiedDependencyException. Message: Error creating bean with name 'webSecurityConfig': Unsatisfied dependency expressed through method 'setContentNegotationStrategy' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration$EnableWebMvcConfiguration': Unsatisfied dependency expressed through method 'setConfigurers' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'openEntityManagerInViewInterceptorConfigurer' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/JpaBaseConfiguration$JpaWebConfiguration.class]: Unsatisfied dependency expressed through method 'openEntityManagerInViewInterceptorConfigurer' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'openEntityManagerInViewInterceptor' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/JpaBaseConfiguration$JpaWebConfiguration.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flywayInitializer' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Invocation of init method failed; nested exception is org.flywaydb.core.internal.exception.FlywaySqlException:
Unable to obtain connection from database (jdbc:db2://CORRECT_URL;retrieveMessagesFromServerOnGetMessage=true;) for user 'CORRECT USER': [jcc][10214][10050][4.26.14] An java.sql.Driver.connect() übergebenes java.util.Properties-Objekt kann von URL nicht überschrieben werden: CORRECT_URL;retrieveMessagesFromServerOnGetMessage=true;. ERRORCODE=-4461, SQLSTATE=42815
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL State : 42815
Error Code : -4461
Message : [jcc][10214][10050][4.26.14] An java.sql.Driver.connect() übergebenes java.util.Properties-Objekt kann von URL nicht überschrieben werden: CORRECT_URL;retrieveMessagesFromServerOnGetMessage=true;. ERRORCODE=-4461, SQLSTATE=42815
2020-05-28 09:24:01.390 INFO 10784 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2020-05-28 09:24:01.397 WARN 10784 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
2020-05-28 09:24:01.410 INFO 10784 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-05-28 09:24:01.419 ERROR 10784 --- [ main] o.s.boot.SpringApplication : Application run failed
Здесь мой пом. xml:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.0.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jooq</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>com.ibm.db2</groupId>
<artifactId>jcc</artifactId>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
</dependency>
А вот мои application.properties:
# Spring Datasource
spring.datasource.url=@DB_URL@
spring.datasource.driverClassName=com.ibm.db2.jcc.DB2Driver
spring.datasource.username=@DB_USERNAME@
spring.datasource.password=@DB_PASSWORD@
# JPA / Hibernate
spring.jpa.database-platform=org.hibernate.dialect.DB2Dialect
spring.jpa.hibernate.ddl-auto=none
# Flyway
spring.flyway.enabled=true
spring.flyway.table=schema_version
spring.flyway.validate-on-migrate=false
spring.flyway.placeholders.tablespace=@FLYWAY_PLACEHOLDER_TABLESPACE@
spring.flyway.placeholders.username=@FLYWAY_PLACEHOLDER_USERNAME@
spring.flyway.url=@FLYWAY_DB_URL@
spring.flyway.user=@FLYWAY_DB_USERNAME@
spring.flyway.password=@FLYWAY_DB_PASSWORD@
@ DB_URL @ = @ FLYWAY_DB_URL @ @ DB_USERNAME @! = @ FLYWAY_DB_USERNAME @
Похоже, что соединение не может быть обновлено для инициализатора пролетного пути с учетными данными из application.properties.
Понятия не имею, почему. Я не могу найти аббревиатуру в руководстве по пружинам / пролетным путям, с которыми я столкнулся.