I have a multi tenant spring mvc application which i want to convert to spring boot web mvc application. I have changed the related dependencies and the project compiles good and also the entities are generated. But in runtime getting the below exception
`2023-08-27 13:16:47.640 INFO 22872 --- [ restartedMain] c.o.h.AppApplication : Starting AppApplication on LAPTOP-POCB5T7C with PID 22872 (C:\Users\ASUS\IdeaProjects\ZorgFlex\app\hcs-web\target\classes started by ASUS in C:\Users\ASUS\IdeaProjects\ZorgFlex) 2023-08-27 13:16:47.648 INFO 22872 --- [ restartedMain] c.o.h.AppApplication : The following profiles are active: dev WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by org.codehaus.groovy.vmplugin.v7.Java7$1 (file:/C:/Users/ASUS/.m2/repository/org/codehaus/groovy/groovy/2.5.9/groovy-2.5.9.jar) to constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class,int) WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.vmplugin.v7.Java7$1 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 2023-08-27 13:16:47.859 INFO 22872 --- [ restartedMain] o.s.b.d.r.ChangeableUrls : The Class-Path manifest attribute in C:\Users\ASUS.m2\repository\org\glassfish\jaxb\jaxb-runtime\2.3.2\jaxb-runtime-2.3.2.jar referenced one or more files that do not exist: file:/C:/Users/ASUS/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/jakarta.xml.bind-api-2.3.2.jar,file:/C:/Users/ASUS/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/txw2-2.3.2.jar,file:/C:/Users/ASUS/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/istack-commons-runtime-3.0.8.jar,file:/C:/Users/ASUS/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/stax-ex-1.8.1.jar,file:/C:/Users/ASUS/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/FastInfoset-1.2.16.jar,file:/C:/Users/ASUS/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/jakarta.activation-api-1.2.1.jar 2023-08-27 13:16:47.860 INFO 22872 --- [ restartedMain] o.s.b.d.r.ChangeableUrls : The Class-Path manifest attribute in C:\Users\ASUS.m2\repository\com\sun\xml\bind\jaxb-impl\2.2.11\jaxb-impl-2.2.11.jar referenced one or more files that do not exist: file:/C:/Users/ASUS/.m2/repository/com/sun/xml/bind/jaxb-impl/2.2.11/jaxb-core.jar 2023-08-27 13:16:47.860 INFO 22872 --- [ restartedMain] o.s.b.d.r.ChangeableUrls : The Class-Path manifest attribute in C:\Users\ASUS.m2\repository\com\sun\xml\bind\jaxb-core\2.2.11\jaxb-core-2.2.11.jar referenced one or more files that do not exist: file:/C:/Users/ASUS/.m2/repository/com/sun/xml/bind/jaxb-core/2.2.11/jaxb-api.jar 2023-08-27 13:16:47.860 INFO 22872 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable 2023-08-27 13:16:47.860 INFO 22872 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG' 2023-08-27 13:16:50.184 INFO 22872 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode. 2023-08-27 13:16:50.799 INFO 22872 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 607ms. Found 153 JPA repository interfaces. 2023-08-27 13:16:51.574 INFO 22872 --- [ restartedMain] c.o.h.c.HCSCoreContext : Application properties loaded 2023-08-27 13:16:51.578 WARN 22872 --- [ restartedMain] c.o.h.c.ApplicationPropertyResource : properties loaded :(resource='application.properties') 2023-08-27 13:16:51.578 INFO 22872 --- [ restartedMain] c.o.h.c.ApplicationPropertyResource : application properties loaded 2023-08-27 13:16:51.580 WARN 22872 --- [ restartedMain] c.o.h.c.ApplicationPropertyResource : Could not find properties (file='C:\Users\ASUS.hcs\application.properties'), ignoring this set of properties. 2023-08-27 13:16:51.876 INFO 22872 --- [ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'HCSServiceContext' of type [com.orsbv.hcs.config.HCSServiceContext$$EnhancerBySpringCGLIB$$eddd1207] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2023-08-27 13:16:51.913 INFO 22872 --- [ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'mailConfiguration' of type [com.orsbv.hcs.config.SMTPConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2023-08-27 13:16:51.914 INFO 22872 --- [ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'com.orsbv.hcs.config.HCSCoreContext' of type [com.orsbv.hcs.config.HCSCoreContext] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2023-08-27 13:16:51.917 INFO 22872 --- [ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'dataSourceConfiguration' of type [com.orsbv.hcs.config.DataSourceConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2023-08-27 13:16:51.917 INFO 22872 --- [ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'HCSRepositoryContext' of type [com.orsbv.hcs.config.HCSRepositoryContext$$EnhancerBySpringCGLIB$$81f4c60] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2023-08-27 13:16:52.263 INFO 22872 --- [ restartedMain] c.z.h.HikariDataSource : HikariPool-1 - Starting... 2023-08-27 13:16:52.428 INFO 22872 --- [ restartedMain] c.z.h.HikariDataSource : HikariPool-1 - Start completed. 2023-08-27 13:16:52.650 INFO 22872 --- [ restartedMain] o.h.j.i.u.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default] 2023-08-27 13:16:52.714 INFO 22872 --- [ restartedMain] o.h.Version : HHH000412: Hibernate ORM core version 5.4.12.Final 2023-08-27 13:16:52.835 INFO 22872 --- [ restartedMain] o.h.a.c.Version : HCANN000001: Hibernate Commons Annotations {5.1.0.Final} 2023-08-27 13:16:53.400 INFO 22872 --- [ restartedMain] o.h.d.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQL5InnoDBDialect 2023-08-27 13:16:55.317 WARN 22872 --- [ restartedMain] o.h.o.cache : HHH90001006: Missing cache[com.orsbv.hcs.model.financier.Financier] was created on-the-fly. The created cache will use a provider-specific default configuration: make sure you defined one. You can disable this warning by setting 'hibernate.javax.cache.missing_cache_strategy' to 'create'. 2023-08-27 13:16:55.405 INFO 22872 --- [ restartedMain] o.e.c.EhcacheManager : Cache 'com.orsbv.hcs.model.financier.Financier' created in EhcacheManager. 2023-08-27 13:16:55.417 WARN 22872 --- [ restartedMain] o.h.o.cache : HHH90001006: Missing cache[com.orsbv.hcs.model.Dome] was created on-the-fly. The created cache will use a provider-specific default configuration: make sure you defined one. You can disable this warning by setting 'hibernate.javax.cache.missing_cache_strategy' to 'create'. 2023-08-27 13:16:55.421 INFO 22872 --- [ restartedMain] o.e.c.EhcacheManager : Cache 'com.orsbv.hcs.model.Dome' created in EhcacheManager. 2023-08-27 13:16:55.422 WARN 22872 --- [ restartedMain] o.h.o.cache : HHH90001006: Missing cache[com.orsbv.hcs.model.Company] was created on-the-fly. The created cache will use a provider-specific default configuration: make sure you defined one. You can disable this warning by setting 'hibernate.javax.cache.missing_cache_strategy' to 'create'. 2023-08-27 13:16:55.425 INFO 22872 --- [ restartedMain] o.e.c.EhcacheManager : Cache 'com.orsbv.hcs.model.Company' created in EhcacheManager. 2023-08-27 13:16:55.427 WARN 22872 --- [ restartedMain] o.h.o.cache : HHH90001006: Missing cache[com.orsbv.hcs.model.Province] was created on-the-fly. The created cache will use a provider-specific default configuration: make sure you defined one. You can disable this warning by setting 'hibernate.javax.cache.missing_cache_strategy' to 'create'. 2023-08-27 13:16:55.430 INFO 22872 --- [ restartedMain] o.e.c.EhcacheManager : Cache 'com.orsbv.hcs.model.Province' created in EhcacheManager. 2023-08-27 13:16:55.431 WARN 22872 --- [ restartedMain] o.h.o.cache : HHH90001006: Missing cache[com.orsbv.hcs.model.multitenancy.UserTenant] was created on-the-fly. The created cache will use a provider-specific default configuration: make sure you defined one. You can disable this warning by setting 'hibernate.javax.cache.missing_cache_strategy' to 'create'. 2023-08-27 13:16:55.435 INFO 22872 --- [ restartedMain] o.e.c.EhcacheManager : Cache 'com.orsbv.hcs.model.multitenancy.UserTenant' created in EhcacheManager. 2023-08-27 13:16:55.435 WARN 22872 --- [ restartedMain] o.h.o.cache : HHH90001006: Missing cache[com.orsbv.hcs.model.CompanySettings] was created on-the-fly. The created cache will use a provider-specific default configuration: make sure you defined one. You can disable this warning by setting 'hibernate.javax.cache.missing_cache_strategy' to 'create'. 2023-08-27 13:16:55.439 INFO 22872 --- [ restartedMain] o.e.c.EhcacheManager : Cache 'com.orsbv.hcs.model.CompanySettings' created in EhcacheManager. 2023-08-27 13:16:55.440 WARN 22872 --- [ restartedMain] o.h.o.cache : HHH90001006: Missing cache[com.orsbv.hcs.model.CareTeam] was created on-the-fly. The created cache will use a provider-specific default configuration: make sure you defined one. You can disable this warning by setting 'hibernate.javax.cache.missing_cache_strategy' to 'create'. 2023-08-27 13:16:55.443 INFO 22872 --- [ restartedMain] o.e.c.EhcacheManager : Cache 'com.orsbv.hcs.model.CareTeam' created in EhcacheManager. 2023-08-27 13:16:55.444 WARN 22872 --- [ restartedMain] o.h.o.cache : HHH90001006: Missing cache[com.orsbv.hcs.model.Person] was created on-the-fly. The created cache will use a provider-specific default configuration: make sure you defined one. You can disable this warning by setting 'hibernate.javax.cache.missing_cache_strategy' to 'create'. 2023-08-27 13:16:55.447 INFO 22872 --- [ restartedMain] o.e.c.EhcacheManager : Cache 'com.orsbv.hcs.model.Person' created in EhcacheManager. 2023-08-27 13:16:55.447 WARN 22872 --- [ restartedMain] o.h.o.cache : HHH90001006: Missing cache[com.orsbv.hcs.model.multitenancy.Tenant] was created on-the-fly. The created cache will use a provider-specific default configuration: make sure you defined one. You can disable this warning by setting 'hibernate.javax.cache.missing_cache_strategy' to 'create'. 2023-08-27 13:16:55.452 INFO 22872 --- [ restartedMain] o.e.c.EhcacheManager : Cache 'com.orsbv.hcs.model.multitenancy.Tenant' created in EhcacheManager. 2023-08-27 13:16:55.452 WARN 22872 --- [ restartedMain] o.h.o.cache : HHH90001006: Missing cache[com.orsbv.hcs.model.function.Function] was created on-the-fly. The created cache will use a provider-specific default configuration: make sure you defined one. You can disable this warning by setting 'hibernate.javax.cache.missing_cache_strategy' to 'create'. 2023-08-27 13:16:55.455 INFO 22872 --- [ restartedMain] o.e.c.EhcacheManager : Cache 'com.orsbv.hcs.model.function.Function' created in EhcacheManager. 2023-08-27 13:16:57.345 INFO 22872 --- [ restartedMain] o.h.o.c.access : HHH10001501: Connection obtained from JdbcConnectionAccess [org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator$MultiTenantConnectionProviderJdbcConnectionAccess@75d8d529] for (non-JTA) DDL execution was not in auto-commit mode; the Connection 'local transaction' will be committed and the Connection will be set into auto-commit mode. 2023-08-27 13:16:59.982 INFO 22872 --- [ restartedMain] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform] 2023-08-27 13:17:00.052 INFO 22872 --- [ restartedMain] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default' 2023-08-27 13:17:04.068 INFO 22872 --- [ restartedMain] o.s.s.c.ThreadPoolTaskExecutor : Initializing ExecutorService 'clientInboundChannelExecutor' 2023-08-27 13:17:04.076 INFO 22872 --- [ restartedMain] o.s.s.c.ThreadPoolTaskExecutor : Initializing ExecutorService 'clientOutboundChannelExecutor' 2023-08-27 13:17:04.154 WARN 22872 --- [ restartedMain] o.h.d.f.TemplateRenderer : HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered Aug 27, 2023 1:17:04 PM org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean buildServiceFromClass INFO: Creating Service {http://nigw.soap.services}PatientPortTypeService from class services.soap.nigw.patient.PatientPortType Aug 27, 2023 1:17:06 PM org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean buildServiceFromClass INFO: Creating Service {http://services.cibg.nl/ExternalUser}PublicV4SoapService from class com.orsbv.hcs.external.model.PublicV4Soap 2023-08-27 13:17:07.605 INFO 22872 --- [ restartedMain] o.e.c.EhcacheManager : Cache 'hcs_custom_cache' created in EhcacheManager. 2023-08-27 13:17:07.606 INFO 22872 --- [ restartedMain] o.e.j.Eh107CacheManager : Registering Ehcache MBean javax.cache:type=CacheStatistics,CacheManager=file./C./Users/ASUS/IdeaProjects/ZorgFlex/app/hcs-repository/target/classes/hcs_ehcache.xml,Cache=hcs_custom_cache Aug 27, 2023 1:17:08 PM org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean buildServiceFromClass INFO: Creating Service {http://nigw.soap.services}OrganizationPortTypeService from class services.soap.nigw.organization.OrganizationPortType Aug 27, 2023 1:17:08 PM org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean buildServiceFromClass INFO: Creating Service {http://nigw.soap.services}EmployeePortTypeService from class services.soap.nigw.employee.EmployeePortType Aug 27, 2023 1:17:08 PM org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean buildServiceFromClass INFO: Creating Service {http://nigw.soap.services}PatientArchivePortTypeService from class services.soap.nigw.archivePatient.PatientArchivePortType 2023-08-27 13:17:08.918 INFO 22872 --- [ restartedMain] o.s.s.w.DefaultSecurityFilterChain : Creating filter chain: Ant [pattern='/resend-token'], [] 2023-08-27 13:17:08.918 INFO 22872 --- [ restartedMain] o.s.s.w.DefaultSecurityFilterChain : Creating filter chain: Ant [pattern='/robots.txt'], [] 2023-08-27 13:17:08.918 INFO 22872 --- [ restartedMain] o.s.s.w.DefaultSecurityFilterChain : Creating filter chain: Ant [pattern='/demo-user'], [] 2023-08-27 13:17:08.980 INFO 22872 --- [ restartedMain] o.s.s.w.DefaultSecurityFilterChain : Creating filter chain: any request, [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@5ac2b26b, org.springframework.security.web.context.SecurityContextPersistenceFilter@7cddbd72, org.springframework.security.web.header.HeaderWriterFilter@2663f88c, org.springframework.security.web.csrf.CsrfFilter@1d063466, org.springframework.security.web.authentication.logout.LogoutFilter@7e20d283, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter@3637847c, org.springframework.security.web.session.ConcurrentSessionFilter@54f51586, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@16890040, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@417b8d58, org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter@3419810a, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@50dcc92b, org.springframework.security.web.session.SessionManagementFilter@4763316a, org.springframework.security.web.access.ExceptionTranslationFilter@431ee67c, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@5a369062, com.orsbv.hcs.security.MultiTenantSwitchUserFilter@2aa84978] 2023-08-27 13:17:09.238 WARN 22872 --- [ restartedMain] s.c.a.AnnotationConfigApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'resourceHandlerMapping' defined in class path resource [org/springframework/web/servlet/config/annotation/DelegatingWebMvcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.HandlerMapping]: Factory method 'resourceHandlerMapping' threw exception; nested exception is java.lang.IllegalStateException: No ServletContext set 2023-08-27 13:17:09.247 INFO 22872 --- [ restartedMain] o.e.c.EhcacheManager : Cache 'hcs_custom_cache' removed from EhcacheManager. 2023-08-27 13:17:09.256 INFO 22872 --- [ restartedMain] o.s.s.c.ThreadPoolTaskExecutor : Shutting down ExecutorService 'clientOutboundChannelExecutor' 2023-08-27 13:17:09.256 INFO 22872 --- [ restartedMain] o.s.s.c.ThreadPoolTaskExecutor : Shutting down ExecutorService 'clientInboundChannelExecutor' 2023-08-27 13:17:09.290 INFO 22872 --- [ restartedMain] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default' 2023-08-27 13:17:09.291 INFO 22872 --- [ restartedMain] o.e.c.EhcacheManager : Cache 'com.orsbv.hcs.model.Dome' removed from EhcacheManager. 2023-08-27 13:17:09.291 INFO 22872 --- [ restartedMain] o.e.c.EhcacheManager : Cache 'com.orsbv.hcs.model.Person' removed from EhcacheManager. 2023-08-27 13:17:09.292 INFO 22872 --- [ restartedMain] o.e.c.EhcacheManager : Cache 'com.orsbv.hcs.model.CompanySettings' removed from EhcacheManager. 2023-08-27 13:17:09.292 INFO 22872 --- [ restartedMain] o.e.c.EhcacheManager : Cache 'com.orsbv.hcs.model.CareTeam' removed from EhcacheManager. 2023-08-27 13:17:09.292 INFO 22872 --- [ restartedMain] o.e.c.EhcacheManager : Cache 'com.orsbv.hcs.model.multitenancy.Tenant' removed from EhcacheManager. 2023-08-27 13:17:09.292 INFO 22872 --- [ restartedMain] o.e.c.EhcacheManager : Cache 'com.orsbv.hcs.model.financier.Financier' removed from EhcacheManager. 2023-08-27 13:17:09.292 INFO 22872 --- [ restartedMain] o.e.c.EhcacheManager : Cache 'com.orsbv.hcs.model.Company' removed from EhcacheManager. 2023-08-27 13:17:09.293 INFO 22872 --- [ restartedMain] o.e.c.EhcacheManager : Cache 'com.orsbv.hcs.model.Province' removed from EhcacheManager. 2023-08-27 13:17:09.293 INFO 22872 --- [ restartedMain] o.e.c.EhcacheManager : Cache 'com.orsbv.hcs.model.multitenancy.UserTenant' removed from EhcacheManager. 2023-08-27 13:17:09.293 INFO 22872 --- [ restartedMain] o.e.c.EhcacheManager : Cache 'com.orsbv.hcs.model.function.Function' removed from EhcacheManager. 2023-08-27 13:17:09.298 INFO 22872 --- [ restartedMain] c.z.h.HikariDataSource : HikariPool-1 - Shutdown initiated... 2023-08-27 13:17:09.310 INFO 22872 --- [ restartedMain] c.z.h.HikariDataSource : HikariPool-1 - Shutdown completed. 2023-08-27 13:17:09.318 INFO 22872 --- [ restartedMain] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2023-08-27 13:17:09.320 ERROR 22872 --- [ restartedMain] o.s.b.SpringApplication : Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'resourceHandlerMapping' defined in class path resource [org/springframework/web/servlet/config/annotation/DelegatingWebMvcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.HandlerMapping]: Factory method 'resourceHandlerMapping' threw exception; nested exception is java.lang.IllegalStateException: No ServletContext set at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:656) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:636) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1338) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1177) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:557) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:879) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:878) ~[spring-context-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) ~[spring-context-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) [spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) [spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) [spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE] at com.orsbv.hcs.AppApplication.main(AppApplication.java:32) [classes/:?] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?] at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?] at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) [spring-boot-devtools-2.2.5.RELEASE.jar:2.2.5.RELEASE] Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.HandlerMapping]: Factory method 'resourceHandlerMapping' threw exception; nested exception is java.lang.IllegalStateException: No ServletContext set at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:651) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] ... 23 more Caused by: java.lang.IllegalStateException: No ServletContext set at org.springframework.util.Assert.state(Assert.java:73) ~[spring-core-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.resourceHandlerMapping(WebMvcConfigurationSupport.java:534) ~[spring-webmvc-5.2.4.RELEASE.jar:5.2.4.RELEASE] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?] at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?] at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:651) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] ... 23 more`
This is my Servlet contect configuration class.
`@Configuration
@EnableWebMvc
@ComponentScan(basePackages = {"com.orsbv.hcs.controller", "com.orsbv.hcs.advice", "com.orsbv.hcs.validator"})
@Import({MethodSecurityConfig.class, HCSSpringDataWebConfiguration.class, HCSWebSocketConfig.class,
HCSWebSocketSecurityConfig.class})
public class HCSServletContext extends WebMvcConfigurationSupport {
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler(JS_ROUTE + "/**")
.addResourceLocations(PATH + "/js/")
.setCacheControl(CacheControl.maxAge(1, TimeUnit.HOURS).cachePublic());
registry.addResourceHandler(CSS_ROUTE + "/**")
.addResourceLocations(PATH + "/css/", PATH + "/css/writer/bootstrap/css/",
PATH + "/css/writer/font-awesome/css/")
.setCacheControl(CacheControl.maxAge(1, TimeUnit.HOURS).cachePublic());
registry.addResourceHandler(IMAGE_ROUTE + "/**")
.addResourceLocations(PATH + "/images/")
.setCacheControl(CacheControl.maxAge(1, TimeUnit.HOURS).cachePublic());
}
@Override
public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
configurer.enable();
}
@Override
public void addInterceptors(InterceptorRegistry registry) {
super.addInterceptors(registry);
registry.addInterceptor(localeChangeInterceptor());
registry.addInterceptor(tenantIdentifierInterceptor());
}
@Bean
public LocaleChangeInterceptor localeChangeInterceptor() {
LocaleChangeInterceptor interceptor = new LocaleChangeInterceptor();
interceptor.setParamName(LANGUAGE_PARAM);
return interceptor;
}
@Bean
public TenantIdentifierInterceptor tenantIdentifierInterceptor() {
return new TenantIdentifierInterceptor();
}
@Override
public Validator getValidator() {
LocalValidatorFactoryBean factory = new LocalValidatorFactoryBean();
factory.setMessageInterpolator(new ResourceBundleMessageInterpolator(new PlatformResourceBundleLocator("messages", null, true)));
return factory;
}
}`