Spring Boot WSDL SOAP web service application does not start - spring-boot

I am trying to start a WSDL-SOAP web service application but it doesn't start. Gives the below exception:
2020-11-30 22:28:12.521 INFO 97564 --- [ main] c.c.ws.soap.SpringBootApplicationRun : Starting SpringBootApplicationRun on Ramazans-MacBook-Pro.local with PID 97564 (started by rdemir in /Users/rdemir/Projects/METU/SM704/Project Phase 2)
2020-11-30 22:28:12.525 INFO 97564 --- [ main] c.c.ws.soap.SpringBootApplicationRun : No active profile set, falling back to default profiles: default
2020-11-30 22:28:13.304 INFO 97564 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.ws.config.annotation.DelegatingWsConfiguration' of type [org.springframework.ws.config.annotation.DelegatingWsConfiguration$$EnhancerBySpringCGLIB$$6d2d075b] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-11-30 22:28:13.330 INFO 97564 --- [ main] .w.s.a.s.AnnotationActionEndpointMapping : Supporting [WS-Addressing August 2004, WS-Addressing 1.0]
2020-11-30 22:28:13.597 INFO 97564 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2020-11-30 22:28:13.623 INFO 97564 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2020-11-30 22:28:13.623 INFO 97564 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/9.0.13
2020-11-30 22:28:13.639 INFO 97564 --- [ main] o.a.catalina.core.AprLifecycleListener : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/Users/rdemir/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.]
2020-11-30 22:28:13.757 INFO 97564 --- [ main] o.a.c.c.C.[.[localhost].[/wsdlfirstws] : Initializing Spring embedded WebApplicationContext
2020-11-30 22:28:13.758 INFO 97564 --- [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 1165 ms
2020-11-30 22:28:14.064 INFO 97564 --- [ main] o.a.c.w.s.f.ReflectionServiceFactoryBean : Creating Service {http://soap.ws.ckranz.com/}BankingServiceImplementationService from class com.banking.BankingPortType
2020-11-30 22:28:14.145 WARN 97564 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'endpoint' defined in class path resource [com/ckranz/ws/soap/config/WebServiceConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.xml.ws.Endpoint]: Factory method 'endpoint' threw exception; nested exception is javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException
2020-11-30 22:28:14.148 INFO 97564 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2020-11-30 22:28:14.158 INFO 97564 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-11-30 22:28:14.164 ERROR 97564 --- [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'endpoint' defined in class path resource [com/ckranz/ws/soap/config/WebServiceConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.xml.ws.Endpoint]: Factory method 'endpoint' threw exception; nested exception is javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:627) ~[spring-beans-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:456) ~[spring-beans-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1288) ~[spring-beans-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1127) ~[spring-beans-5.1.3.RELEASE.jar:5.1.3.RELEASE]
Here is some code:
https://www.codepile.net/pile/Ym773bm2

Related

Factory method 'batchStubRunner' threw exception; nested exception is Assertion failed:

I am upgrading from spring-boot 2.1.13.RELEASE to 2.4.4.
After upgrading getting below errors in spring-cloud-contract testing, when running maven build.
Groovy version : 3.0.6
spring-cloud.version : Greenwich.SR6
wiremock.version : 2.27.2
spock.version : 2.0-M4-groovy-3.0
2021-05-14 15:51:01.471 WARN [test,,,] 8890 --- [ main] o.s.boot.StartupInfoLogger : InetAddress.getLocalHost().getHostName() took 5005 milliseconds to respond. Please verify your network configuration (macOS machines may need to add entries to /etc/hosts).
2021-05-14 15:51:06.477 INFO [test,,,] 8890 --- [ main] c.i.kea.web.contract.common.AddressSpec : Starting AddressSpec using Java 1.8.0_231 on pcusers-MacBook-Pro.local with PID 8890 (started by pcuser in /Users/pcuser/Workspace/branch/SR-1340/digital-investor-web-app)
2021-05-14 15:51:06.479 INFO [test,,,] 8890 --- [ main] c.i.kea.web.contract.common.AddressSpec : The following profiles are active: integrationtest,h2-test
2021-05-14 15:51:09.130 INFO [test,,,] 8890 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'com.ifds.kea.api.common.web.client.rewrite.UriCustomizerAutoConfiguration' of type [com.ifds.kea.api.common.web.client.rewrite.UriCustomizerAutoConfiguration$$EnhancerBySpringCGLIB$$a3e7890d] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-05-14 15:51:09.172 INFO [test,,,] 8890 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler#13803a94' 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)
2021-05-14 15:51:09.199 INFO [test,,,] 8890 --- [ 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)
2021-05-14 15:51:09.557 INFO [test,,,] 8890 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'stubrunner-org.springframework.cloud.contract.stubrunner.spring.StubRunnerProperties' of type [org.springframework.cloud.contract.stubrunner.spring.StubRunnerProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-05-14 15:51:09.561 INFO [test,,,] 8890 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.contract.stubrunner.spring.StubRunnerConfiguration' of type [org.springframework.cloud.contract.stubrunner.spring.StubRunnerConfiguration$$EnhancerBySpringCGLIB$$211927d4] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-05-14 15:51:09.589 INFO [test,,,] 8890 --- [ main] o.s.c.c.s.AetherStubDownloaderBuilder : Will download stubs and contracts via Aether
2021-05-14 15:51:10.017 INFO [test,,,] 8890 --- [ main] o.s.c.c.stubrunner.AetherStubDownloader : Desired version is [+] - will try to resolve the latest version
2021-05-14 15:51:13.216 INFO [test,,,] 8890 --- [ main] o.s.c.c.stubrunner.AetherStubDownloader : Resolved version is [1.0.0-20210423062638352]
2021-05-14 15:51:15.125 INFO [test,,,] 8890 --- [ main] o.s.c.c.stubrunner.AetherStubDownloader : Resolved artifact [com.ifds.kea.api:kea-code-api:jar:stubs:1.0.0-20210423062638352] to /var/folders/cv/c0f5gc8d7x19ymj6y5ww85wc0000gn/T/aether-local294260021435503282/com/ifds/kea/api/kea-code-api/1.0.0-20210423062638352/kea-code-api-1.0.0-20210423062638352-stubs.jar
2021-05-14 15:51:15.127 INFO [test,,,] 8890 --- [ main] o.s.c.c.stubrunner.AetherStubDownloader : Unpacking stub from JAR [URI: file:/var/folders/cv/c0f5gc8d7x19ymj6y5ww85wc0000gn/T/aether-local294260021435503282/com/ifds/kea/api/kea-code-api/1.0.0-20210423062638352/kea-code-api-1.0.0-20210423062638352-stubs.jar]
2021-05-14 15:51:15.144 INFO [test,,,] 8890 --- [ main] o.s.c.c.stubrunner.AetherStubDownloader : Unpacked file to [/var/folders/cv/c0f5gc8d7x19ymj6y5ww85wc0000gn/T/contracts2633830323280917374]
2021-05-14 15:51:18.008 INFO [test,,,] 8890 --- [ main] o.s.c.c.s.AetherStubDownloaderBuilder : Will download stubs and contracts via Aether
2021-05-14 15:51:18.011 INFO [test,,,] 8890 --- [ main] o.s.c.c.stubrunner.AetherStubDownloader : Desired version is [+] - will try to resolve the latest version
2021-05-14 15:51:20.683 INFO [test,,,] 8890 --- [ main] o.s.c.c.stubrunner.AetherStubDownloader : Resolved version is [1.0.0-20210423050528085]
2021-05-14 15:51:24.328 INFO [test,,,] 8890 --- [ main] o.s.c.c.stubrunner.AetherStubDownloader : Resolved artifact [com.ifds.kea.api:kea-customer-api:jar:stubs:1.0.0-20210423050528085] to /var/folders/cv/c0f5gc8d7x19ymj6y5ww85wc0000gn/T/aether-local6763085284579893391/com/ifds/kea/api/kea-customer-api/1.0.0-20210423050528085/kea-customer-api-1.0.0-20210423050528085-stubs.jar
2021-05-14 15:51:24.329 INFO [test,,,] 8890 --- [ main] o.s.c.c.stubrunner.AetherStubDownloader : Unpacking stub from JAR [URI: file:/var/folders/cv/c0f5gc8d7x19ymj6y5ww85wc0000gn/T/aether-local6763085284579893391/com/ifds/kea/api/kea-customer-api/1.0.0-20210423050528085/kea-customer-api-1.0.0-20210423050528085-stubs.jar]
2021-05-14 15:51:24.434 INFO [test,,,] 8890 --- [ main] o.s.c.c.stubrunner.AetherStubDownloader : Unpacked file to [/var/folders/cv/c0f5gc8d7x19ymj6y5ww85wc0000gn/T/contracts5025264596678888109]
2021-05-14 15:51:27.697 WARN [test,,,] 8890 --- [ main] o.s.w.c.s.GenericWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'batchStubRunnerBeanPostProcessor' defined in class path resource [org/springframework/cloud/contract/stubrunner/spring/StubRunnerConfiguration.class]: Unsatisfied dependency expressed through method 'batchStubRunnerBeanPostProcessor' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'batchStubRunner' defined in class path resource [org/springframework/cloud/contract/stubrunner/spring/StubRunnerConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.contract.stubrunner.BatchStubRunner]: Factory method 'batchStubRunner' threw exception; nested exception is Assertion failed:
assert value ==~ pattern.pattern
| | | |
| | | /api/v0/investors/[0-9]{8}/marketing-preferences
| | /api/v0/investors/[0-9]{8}/marketing-preferences
| false
'api/v0/investors/10035186/marketing-preferences'
2021-05-14 15:51:27.709 INFO [test,,,] 8890 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-05-14 15:51:27.753 WARN [test,,,] 8890 --- [ main] com.getsentry.raven.dsn.Dsn : Couldn't find a suitable DSN, defaulting to a Noop one.
2021-05-14 15:51:27.760 INFO [test,,,] 8890 --- [ main] com.getsentry.raven.DefaultRavenFactory : Using noop to send events.
2021-05-14 15:51:27.768 INFO [test,,,] 8890 --- [ main] com.getsentry.raven.Raven : Adding 'com.getsentry.raven.event.helper.HttpEventBuilderHelper#279afa4e' to the list of builder helpers.
2021-05-14 15:51:27.747 ERROR [test,,,] 8890 --- [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'batchStubRunnerBeanPostProcessor' defined in class path resource [org/springframework/cloud/contract/stubrunner/spring/StubRunnerConfiguration.class]: Unsatisfied dependency expressed through method 'batchStubRunnerBeanPostProcessor' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'batchStubRunner' defined in class path resource [org/springframework/cloud/contract/stubrunner/spring/StubRunnerConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.contract.stubrunner.BatchStubRunner]: Factory method 'batchStubRunner' threw exception; nested exception is Assertion failed:
assert value ==~ pattern.pattern
| | | |
| | | /api/v0/investors/[0-9]{8}/marketing-preferences
| | /api/v0/investors/[0-9]{8}/marketing-preferences
| false
'api/v0/investors/10035186/marketing-preferences'

Failed creating bean flywayInitializer - SpringBoot 2.3.0

I am trying to migrate a project from spring boot 2.0.0 to 2.3.0 with H2 database and Hibernate and I keep getting an error
on bean creation for flywayInitializer:
2020-11-20 14:05:51.999 INFO 4632 --- [ main] c.z.h.HikariDataSource : HikariPool-1 - Starting...
2020-11-20 14:05:53.125 INFO 4632 --- [ main] c.z.h.HikariDataSource : HikariPool-1 - Start completed.
2020-11-20 14:05:53.157 INFO 4632 --- [ main] o.s.b.a.h.H2ConsoleAutoConfiguration : H2 console available at '/h2-console'. Database available at 'jdbc:h2:D:/Workspace/username/projectName_db/projectName_db'
2020-11-20 14:05:53.313 INFO 4632 --- [ main] w.s.s.SecurityFilterProviderCollection : using 'waffle.servlet.spi.NegotiateSecurityFilterProvider'
2020-11-20 14:05:53.453 INFO 4632 --- [ main] s.s.l.DefaultSpringSecurityContextSource : URL 'ldaps://0200P-CDC201.banst-s.banst-pt.int:636/', root DN is ''
2020-11-20 14:05:53.641 INFO 4632 --- [ main] o.s.b.w.s.RegistrationBean : Filter negotiateSecurityFilter was not registered (disabled)
2020-11-20 14:05:53.922 INFO 4632 --- [ main] o.f.c.i.l.VersionPrinter : Flyway Community Edition 6.4.1 by Redgate
2020-11-20 14:05:53.953 INFO 4632 --- [ main] o.f.c.i.d.DatabaseFactory : Database: jdbc:h2:D:/Workspace/username/projectName_db/projectName_db (H2 1.4)
2020-11-20 14:05:54.203 INFO 4632 --- [ main] o.f.c.i.c.DbMigrate : Current version of schema "FLAYWAY": 1.18.0
2020-11-20 14:05:54.219 WARN 4632 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: 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.api.FlywayException: Schema "FLAYWAY" contains a failed migration to version 1.18.0 !
2020-11-20 14:05:54.219 INFO 4632 --- [ main] c.z.h.HikariDataSource : HikariPool-1 - Shutdown initiated...
2020-11-20 14:05:54.266 INFO 4632 --- [ main] c.z.h.HikariDataSource : HikariPool-1 - Shutdown completed.
2020-11-20 14:05:54.282 INFO 4632 --- [ main] o.a.c.c.StandardService : Stopping service [Tomcat]
2020-11-20 14:05:54.297 INFO 4632 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-11-20 14:05:54.328 ERROR 4632 --- [ main] o.s.b.SpringApplication : Application run failed
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.api.FlywayException: Schema "FLAYWAY" contains a failed migration to version 1.18.0 !
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1796) ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE]
Caused by: org.flywaydb.core.api.FlywayException: Schema "FLAYWAY" contains a failed migration to version 1.18.0 !
at org.flywaydb.core.internal.command.DbMigrate.migrateGroup(DbMigrate.java:227) ~[flyway-core-6.4.1.jar:?]
... 19 more
My application.yml has the following configurations
spring:
main:
banner-mode: "off"
allow-bean-definition-overriding: true
h2:
console:
enabled: true
settings:
web-allow-others: true
jackson:
serialization:
WRITE_DATES_AS_TIMESTAMPS: false
jpa:
hibernate:
ddl-auto: validate
database: default
show-sql: false
quartz:
job-store-type: memory
jdbc:
initialize-schema: never
flyway:
locations: "classpath:database/projectName/migrations/{vendor}/"
schemas: "FLAYWAY"
table: "schema_version"
baseline-on-migrate: true
validate-on-migrate: false
Does anyone know what I can I do in this case?
The error states that there is a failed migration:
Schema "FLAYWAY" contains a failed migration to version 1.18.0 !
Try deleting the failed entry and run again.
Or try to run:
mvn flyway:validate -Dflyway.configFile=myFlywayConfig.properties
to validate everything first.

Field repository in com.App.Shopping.model.service.UserServiceImpl required a bean named 'entityManagerFactory' that could not be found

. ____ _ __ _ _
/\ / ' __ _ () __ __ _ \ \ \
( ( )__ | '_ | '| | ' / ` | \ \ \
\/ __)| |)| | | | | || (| | ) ) ) )
' || .__|| ||| |_, | / / / /
=========||==============|/=////
:: Spring Boot :: (v2.3.3.RELEASE)
2020-08-30 18:09:53.081 INFO 4536 --- [ restartedMain] com.App.Shopping.ShoppingApplication : Starting ShoppingApplication on DESKTOP-DSCQJON with PID 4536 (D:\sarat\eclipse-workspace\Shopping.zip_expanded\Shopping\target\classes started by sarat in D:\sarat\eclipse-workspace\Shopping.zip_expanded\Shopping)
2020-08-30 18:09:53.081 INFO 4536 --- [ restartedMain] com.App.Shopping.ShoppingApplication : No active profile set, falling back to default profiles: default
2020-08-30 18:09:53.148 INFO 4536 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2020-08-30 18:09:53.151 INFO 4536 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 3ms. Found 1 JPA repository interfaces.
2020-08-30 18:09:53.256 INFO 4536 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8083 (http)
2020-08-30 18:09:53.256 INFO 4536 --- [ restartedMain] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2020-08-30 18:09:53.256 INFO 4536 --- [ restartedMain] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.37]
2020-08-30 18:09:53.325 INFO 4536 --- [ restartedMain] org.apache.jasper.servlet.TldScanner : At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
2020-08-30 18:09:53.327 INFO 4536 --- [ restartedMain] o.a.c.c.C.[Tomcat-24].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2020-08-30 18:09:53.327 INFO 4536 --- [ restartedMain] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 244 ms
2020-08-30 18:09:53.339 WARN 4536 --- [ restartedMain] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'shoppingController': Unsatisfied dependency expressed through field 'userservice'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userServiceImpl': Unsatisfied dependency expressed through field 'repository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userRepository' defined in com.App.Shopping.model.repository.UserRepository defined in #EnableJpaRepositories declared on ShoppingApplication: Cannot create inner bean '(inner bean)#71a2245c' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#71a2245c': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'entityManagerFactory' available
2020-08-30 18:09:53.340 INFO 4536 --- [ restartedMain] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2020-08-30 18:09:53.344 INFO 4536 --- [ restartedMain] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-08-30 18:09:53.400 ERROR 4536 --- [ restartedMain] o.s.b.d.LoggingFailureAnalysisReporter :
APPLICATION FAILED TO START
Description:
Field repository in com.App.Shopping.model.service.UserServiceImpl required a bean named 'entity manager factory' that could not be found.
The injection point has the following annotations:
- #org.springframework.beans.factory.annotation.Autowired(required=true)
Action:
Consider defining a bean named 'entity manager factory' in your configuration.
I can see from stack trace that your entitymanagerfactory is not available.
Are you trying to autowire by name in your UserServiceImpl which means have you added Qualifier annotation ?

spring cloud gateway exception Illegal character in authority at index error

I'm trying to setup spring cloud gateway for a api, but seeing an illegal argument exception with the route uri. Any help is appreciated.
Running this app on Ubuntu and I got the same exception with both Spring boot 2.1.4 and 2.1.5.
This is how configured my application.properties file in the gateway app.
eureka.client.serviceUrl.defaultZone = http://localhost:8761/eureka
spring.application.name= api-gateway
spring.cloud.gateway.discovery.locator.enabled=true
spring.cloud.gateway.discovery.locator.lowerCaseServiceId=true
spring.cloud.gateway.routes[0].id=reporting-service
spring.cloud.gateway.routes[0].uri = lb://reporting-service
spring.cloud.gateway.routes[0].predicates[0]=Path=/api/reporting/**
This is the exception that I see.
2019-06-06 09:56:17.304 WARN 4561 --- [ main] onfigReactiveWebServerApplicationContext : Exception encountered during context initializ ation - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Failed to start bean 'eurekaAutoServiceRegistration'; nested exception is reactor.core.Exceptions$ErrorCallbackNotImplemented: java.lang.IllegalArgumentException: Illegal character in authority at in dex 5: lb://REPORTING-SERVICE
2019-06-06 09:56:17.316 INFO 4561 --- [ main] com.netflix.discovery.DiscoveryClient : Shutting down DiscoveryClient ...
2019-06-06 09:56:20.317 INFO 4561 --- [ main] com.netflix.discovery.DiscoveryClient : Unregistering ...
2019-06-06 09:56:20.324 INFO 4561 --- [ main] com.netflix.discovery.DiscoveryClient : DiscoveryClient_API-GATEWAY/apitest.****.*****.com:api-gateway:8080 - deregister status: 200
2019-06-06 09:56:20.342 INFO 4561 --- [ main] com.netflix.discovery.DiscoveryClient : Completed shut down of DiscoveryClient
2019-06-06 09:56:20.353 INFO 4561 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-06-06 09:56:20.365 ERROR 4561 --- [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.context.ApplicationContextException: Failed to start bean 'eurekaAutoServiceRegistration'; nested exception is reactor.core.Ex ceptions$ErrorCallbackNotImplemented: java.lang.IllegalArgumentException: Illegal character in authority at index 5: lb://REPORTING-SERVICE
at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:185) ~[spring-context-5.1.6.RELEAS E.jar!/:5.1.6.RELEASE]
at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:53) ~[spring-context-5.1.6.RELE ASE.jar!/:5.1.6.RELEASE]
at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:360) ~[spring-context -5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:158) ~[spring-context-5.1.6.REL EASE.jar!/:5.1.6.RELEASE]
at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:122) ~[spring-context-5.1.6.RELE ASE.jar!/:5.1.6.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:893) ~[spring-context-5.1. 6.RELEASE.jar!/:5.1.6.RELEASE]
at org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.finishRefresh(ReactiveWebServerApplicationContext.jav a:121) ~[spring-boot-2.1.4.RELEASE.jar!/:2.1.4.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:552) ~[spring-context-5.1.6.RELE ASE.jar!/:5.1.6.RELEASE]
at org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.refresh(ReactiveWebServerApplicationContext.java:67) ~[spring-boot-2.1.4.RELEASE.jar!/:2.1.4.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775) [spring-boot-2.1.4.RELEASE.jar!/:2.1.4.RELEASE]
Fix the property:
spring.cloud.gateway.routes[0].predicates=Path=/api/reporting/**
spring.cloud.gateway.routes[0].uri=lb://reporting-service
Reference : issue-56480485

spring initialization hangs for few min

When starting Spring it will get hang for like 5 min
If you look at the log WebApplicationContext: initialization happens in 16:36
the next message is Initialized JPA EntityManagerFactory happens in 16:41 almost 5 min later
What could be the issue?
Thank you!
2019-05-09 16:36:59.619 INFO 18120 --- [ restartedMain] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 10419 ms
2019-05-09 16:41:18.196 INFO 18120 --- [ restartedMain] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'portal'
2019-05-09 16:41:18.362 INFO 18120 --- [ restartedMain] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729
2019-05-09 16:41:26.759 INFO 18120 --- [ restartedMain] s.s.l.DefaultSpringSecurityContextSource : URL 'ldap://ldap01:389', root DN is ''
2019-05-09 16:41:26.863 INFO 18120 --- [ restartedMain] .s.s.l.u.DefaultLdapAuthoritiesPopulator : groupSearchBase is empty. Searches will be performed from the context source base
2019-05-09 16:41:27.128 DEBUG 18120 --- [ restartedMain] com.xerox.printerfarm.config.SecurityConfig : secureEndPoints => /printers/**,/employees/user/**
2019-05-09 16:41:27.984 INFO 18120 --- [ restartedMain] o.s.s.web.DefaultSecurityFilterChain : Creating filter chain: any request, [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter#6935ce05, org.springframework.security.web.context.SecurityContextPersistenceFilter#5c58f813, org.springframework.security.web.header.HeaderWriterFilter#54fe23e9, org.springframework.security.web.authentication.logout.LogoutFilter#1f81a1d8, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#43759aa7, org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter#40017880, org.springframework.security.web.authentication.ui.DefaultLogoutPageGeneratingFilter#60c590e1, org.springframework.security.web.savedrequest.RequestCacheAwareFilter#64a8529a, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter#4cd90a9, org.springframework.security.web.authentication.AnonymousAuthenticationFilter#6dd6807b, org.springframework.security.web.session.SessionManagementFilter#b218290, org.springframework.security.web.access.ExceptionTranslationFilter#b52b511, org.springframework.security.web.access.intercept.FilterSecurityInterceptor#6d4bb1]
2019-05-09 16:41:28.354 INFO 18120 --- [ restartedMai
UPDATE
with some debug code from logger.org.springframework set to debug
2019-05-14 11:45:16.891 DEBUG 22824 --- [ restartedMain] o.s.b.f.s.DefaultListableBeanFactory : Autowiring by type from bean name 'entityManagerFactory' via factory method to bean named 'entityManagerFactoryBuilder'
2019-05-14 11:45:16.891 DEBUG 22824 --- [ restartedMain] o.s.b.f.s.DefaultListableBeanFactory : Autowiring by type from bean name 'entityManagerFactory' via factory method to bean named 'dataSource'
2019-05-14 11:45:16.995 DEBUG 22824 --- [ restartedMain] j.LocalContainerEntityManagerFactoryBean : Building JPA container EntityManagerFactory for persistence unit 'portal'
2019-05-14 11:45:18.665 DEBUG 22824 --- [ restartedMain] o.s.j.d.DriverManagerDataSource : Creating new JDBC DriverManager Connection to [jdbc:oracle:thin:#devserv1:1521/DEV01SID]
2019-05-14 11:45:24.169 DEBUG 22824 --- [ restartedMain] o.s.j.d.DriverManagerDataSource : Creating new JDBC DriverManager Connection to [jdbc:oracle:thin:#devserv1:1521/DEV01SID]
2019-05-14 11:45:24.703 DEBUG 22824 --- [ restartedMain] o.s.j.d.DriverManagerDataSource : Creating new JDBC DriverManager Connection to [jdbc:oracle:thin:#devserv1:1521/DEV01SID]
2019-05-14 11:46:14.229 DEBUG 22824 --- [alina-utility-2] org.apache.catalina.session.ManagerBase : Start expire sessions StandardManager at 1557848774228 sessioncount 0
2019-05-14 11:46:14.229 DEBUG 22824 --- [alina-utility-2] org.apache.catalina.session.ManagerBase : End expire sessions StandardManager processingTime 1 expired sessions: 0
---- 1 min here
2019-05-14 11:47:14.240 DEBUG 22824 --- [alina-utility-1] org.apache.catalina.session.ManagerBase : Start expire sessions StandardManager at 1557848834240 sessioncount 0
2019-05-14 11:47:14.240 DEBUG 22824 --- [alina-utility-1] org.apache.catalina.session.ManagerBase : End expire sessions StandardManager processingTime 0 expired sessions: 0
---- 1 min here
2019-05-14 11:48:14.246 DEBUG 22824 --- [alina-utility-1] org.apache.catalina.session.ManagerBase : Start expire sessions StandardManager at 1557848894246 sessioncount 0
2019-05-14 11:48:14.246 DEBUG 22824 --- [alina-utility-1] org.apache.catalina.session.ManagerBase : End expire sessions StandardManager processingTime 0 expired sessions: 0
---- 1 min here
2019-05-14 11:49:13.998 INFO 22824 --- [ restartedMain] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'portal'
2019-05-14 11:49:14.009 DEBUG 22824 --- [ restartedMain] o.s.b.f.s.DefaultListableBeanFactory : Creating shared instance of singleton bean 'delegatingApplicationListener'
2019-05-14 11:49:14.018 DEBUG 22824 --- [ restartedMain] o.s.b.f.s.DefaultListableBeanFactory : Creating shared instance of singleton bean 'liveReloadServerEventListener'
2019-05-14 11:49:14.019 DEBUG 22824 --- [ restartedMain] o.s.b.f.s.DefaultListableBeanFactory : Creating shared instance of singleton bean 'org.springframework.boot.devtools.autoconfigure.LocalDevToolsAutoConfiguration$LiveReloadConfiguration'
2019-05-14 11:49:14.031 DEBUG 22824 --- [ restartedMain] o.s.b.f.s.DefaultListableBeanFactory : Creating shared instance of singleton bean 'optionalLiveReloadServer'
2019-05-14 11:49:14.035 DEBUG 22824 --- [ restartedMain] o.s.b.f.s.DefaultListableBeanFactory : Creating shared instance of singleton bean 'spring.devtools-org.springframework.boot.devtools.autoconfigure.DevToolsProperties'
2019-05-14 11:49:14.043 DEBUG 22824 --- [ restartedMain] o.s.b.f.s.DefaultListableBeanFactory : Autowiring by type from bean name 'liveReloadServer' via factory method to bean named 'spring.devtools-org.springframework.boot.devtools.autoconfigure.DevToolsProperties'
2019-05-14 11:49:14.071 DEBUG 22824 --- [ restartedMain] o.s.b.f.s.DefaultListableBeanFactory : Autowiring by type from bean name 'optionalLiveReloadServer' via factory method to bean named 'liveReloadServer'
2019-05-14 11:49:14.083 DEBUG 22824 --- [ restartedMain] o.s.b.d.livereload.LiveReloadServer : Starting live reload server on port 35729

Resources