-1

i have a java configuration based spring boot mvc project that clean build successfully.When i run the application using spring boot the follwing stack stace is shown.

2023-08-30 14:34:13.108  INFO 984 --- [  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-30 14:34:13.109  INFO 984 --- [  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-30 14:34:13.109  INFO 984 --- [  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-30 14:34:13.110  INFO 984 --- [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2023-08-30 14:34:13.110  INFO 984 --- [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'
2023-08-30 14:34:19.670  INFO 984 --- [  restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2023-08-30 14:34:22.443  INFO 984 --- [  restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 2759ms. Found 153 JPA repository interfaces.
2023-08-30 14:34:22.958  INFO 984 --- [  restartedMain] c.o.h.c.HCSCoreContext                   : Application properties loaded
2023-08-30 14:34:22.962  WARN 984 --- [  restartedMain] c.o.h.c.ApplicationPropertyResource      : properties loaded :(resource='application.properties')
2023-08-30 14:34:22.963  INFO 984 --- [  restartedMain] c.o.h.c.ApplicationPropertyResource      : application properties loaded
2023-08-30 14:34:22.966  WARN 984 --- [  restartedMain] c.o.h.c.ApplicationPropertyResource      : Could not find properties (file='C:\Users\ASUS\.hcs\application.properties'), ignoring this set of properties.
2023-08-30 14:34:23.174  INFO 984 --- [  restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'HCSServiceContext' of type [com.orsbv.hcs.config.HCSServiceContext$$EnhancerBySpringCGLIB$$e3154497] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-08-30 14:34:23.230  INFO 984 --- [  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-30 14:34:23.231  INFO 984 --- [  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-30 14:34:23.237  INFO 984 --- [  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-30 14:34:23.237  INFO 984 --- [  restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'HCSRepositoryContext' of type [com.orsbv.hcs.config.HCSRepositoryContext$$EnhancerBySpringCGLIB$$fd577ef0] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-08-30 14:34:23.753  INFO 984 --- [  restartedMain] c.z.h.HikariDataSource                   : HikariPool-1 - Starting...
2023-08-30 14:34:23.943  INFO 984 --- [  restartedMain] c.z.h.HikariDataSource                   : HikariPool-1 - Start completed.
2023-08-30 14:34:24.208  INFO 984 --- [  restartedMain] o.h.j.i.u.LogHelper                      : HHH000204: Processing PersistenceUnitInfo [name: default]
2023-08-30 14:34:24.305  INFO 984 --- [  restartedMain] o.h.Version                              : HHH000412: Hibernate ORM core version 5.4.12.Final
2023-08-30 14:34:24.507  INFO 984 --- [  restartedMain] o.h.a.c.Version                          : HCANN000001: Hibernate Commons Annotations {5.1.0.Final}
2023-08-30 14:34:25.682  INFO 984 --- [  restartedMain] o.h.d.Dialect                            : HHH000400: Using dialect: org.hibernate.dialect.MySQL5InnoDBDialect
2023-08-30 14:34:29.476  WARN 984 --- [  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-30 14:34:29.621  INFO 984 --- [  restartedMain] o.e.c.EhcacheManager                     : Cache 'com.orsbv.hcs.model.Company' created in EhcacheManager.
2023-08-30 14:34:29.642  WARN 984 --- [  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-30 14:34:29.647  INFO 984 --- [  restartedMain] o.e.c.EhcacheManager                     : Cache 'com.orsbv.hcs.model.function.Function' created in EhcacheManager.
2023-08-30 14:34:29.648  WARN 984 --- [  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-30 14:34:29.653  INFO 984 --- [  restartedMain] o.e.c.EhcacheManager                     : Cache 'com.orsbv.hcs.model.Dome' created in EhcacheManager.
2023-08-30 14:34:29.654  WARN 984 --- [  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-30 14:34:29.659  INFO 984 --- [  restartedMain] o.e.c.EhcacheManager                     : Cache 'com.orsbv.hcs.model.CareTeam' created in EhcacheManager.
2023-08-30 14:34:29.660  WARN 984 --- [  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-30 14:34:29.664  INFO 984 --- [  restartedMain] o.e.c.EhcacheManager                     : Cache 'com.orsbv.hcs.model.financier.Financier' created in EhcacheManager.
2023-08-30 14:34:29.665  WARN 984 --- [  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-30 14:34:29.668  INFO 984 --- [  restartedMain] o.e.c.EhcacheManager                     : Cache 'com.orsbv.hcs.model.multitenancy.Tenant' created in EhcacheManager.
2023-08-30 14:34:29.669  WARN 984 --- [  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-30 14:34:29.673  INFO 984 --- [  restartedMain] o.e.c.EhcacheManager                     : Cache 'com.orsbv.hcs.model.multitenancy.UserTenant' created in EhcacheManager.
2023-08-30 14:34:29.673  WARN 984 --- [  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-30 14:34:29.677  INFO 984 --- [  restartedMain] o.e.c.EhcacheManager                     : Cache 'com.orsbv.hcs.model.Person' created in EhcacheManager.
2023-08-30 14:34:29.678  WARN 984 --- [  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-30 14:34:29.684  INFO 984 --- [  restartedMain] o.e.c.EhcacheManager                     : Cache 'com.orsbv.hcs.model.CompanySettings' created in EhcacheManager.
2023-08-30 14:34:29.685  WARN 984 --- [  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-30 14:34:29.690  INFO 984 --- [  restartedMain] o.e.c.EhcacheManager                     : Cache 'com.orsbv.hcs.model.Province' created in EhcacheManager.
2023-08-30 14:34:33.247  INFO 984 --- [  restartedMain] o.h.o.c.access                           : HHH10001501: Connection obtained from JdbcConnectionAccess [org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator$MultiTenantConnectionProviderJdbcConnectionAccess@5530090c] 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-30 14:34:42.018  INFO 984 --- [  restartedMain] o.h.e.t.j.p.i.JtaPlatformInitiator       : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
2023-08-30 14:34:42.134  INFO 984 --- [  restartedMain] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2023-08-30 14:34:42.286  INFO 984 --- [  restartedMain] o.s.b.d.a.OptionalLiveReloadServer       : LiveReload server is running on port 35729
2023-08-30 14:34:49.908  INFO 984 --- [  restartedMain] o.s.s.c.ThreadPoolTaskExecutor           : Initializing ExecutorService 'clientInboundChannelExecutor'
2023-08-30 14:34:49.930  INFO 984 --- [  restartedMain] o.s.s.c.ThreadPoolTaskExecutor           : Initializing ExecutorService 'clientOutboundChannelExecutor'
2023-08-30 14:34:50.119  WARN 984 --- [  restartedMain] o.h.d.f.TemplateRenderer                 : HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
Aug 30, 2023 2:34:50 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 30, 2023 2:34:57 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-30 14:34:59.842  INFO 984 --- [  restartedMain] o.e.c.EhcacheManager                     : Cache 'hcs_custom_cache' created in EhcacheManager.
2023-08-30 14:34:59.846  INFO 984 --- [  restartedMain] o.e.j.Eh107CacheManager                  : Registering Ehcache MBean javax.cache:type=CacheStatistics,CacheManager=file./C./Users/ASUS/IdeaProjects/ZorgFlex-Boot/app/hcs-repository/target/classes/hcs_ehcache.xml,Cache=hcs_custom_cache
Aug 30, 2023 2:35:01 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 30, 2023 2:35:01 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 30, 2023 2:35:02 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-30 14:35:03.077  INFO 984 --- [  restartedMain] o.s.s.w.DefaultSecurityFilterChain       : Creating filter chain: Ant [pattern='/resend-token'], []
2023-08-30 14:35:03.077  INFO 984 --- [  restartedMain] o.s.s.w.DefaultSecurityFilterChain       : Creating filter chain: Ant [pattern='/robots.txt'], []
2023-08-30 14:35:03.077  INFO 984 --- [  restartedMain] o.s.s.w.DefaultSecurityFilterChain       : Creating filter chain: Ant [pattern='/demo-user'], []
2023-08-30 14:35:03.182  INFO 984 --- [  restartedMain] o.s.s.w.DefaultSecurityFilterChain       : Creating filter chain: any request, [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@53bc04ed, org.springframework.security.web.context.SecurityContextPersistenceFilter@37dcd189, org.springframework.security.web.header.HeaderWriterFilter@774c8c15, org.springframework.security.web.csrf.CsrfFilter@521e2d77, org.springframework.security.web.authentication.logout.LogoutFilter@559d630c, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter@63b53eda, org.springframework.security.web.session.ConcurrentSessionFilter@56effb7, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@2fd7df71, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@518ae296, org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter@6217c057, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@1935b3ae, org.springframework.security.web.session.SessionManagementFilter@166f76a3, org.springframework.security.web.access.ExceptionTranslationFilter@1b06fcc8, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@6d0b822a, com.orsbv.hcs.security.MultiTenantSwitchUserFilter@29bccec0]
2023-08-30 14:35:03.700  WARN 984 --- [  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-30 14:35:03.726  INFO 984 --- [  restartedMain] o.e.c.EhcacheManager                     : Cache 'hcs_custom_cache' removed from EhcacheManager.
2023-08-30 14:35:03.747  INFO 984 --- [  restartedMain] o.s.s.c.ThreadPoolTaskExecutor           : Shutting down ExecutorService 'clientOutboundChannelExecutor'
2023-08-30 14:35:03.747  INFO 984 --- [  restartedMain] o.s.s.c.ThreadPoolTaskExecutor           : Shutting down ExecutorService 'clientInboundChannelExecutor'
2023-08-30 14:35:03.855  INFO 984 --- [  restartedMain] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2023-08-30 14:35:03.855  INFO 984 --- [  restartedMain] o.e.c.EhcacheManager                     : Cache 'com.orsbv.hcs.model.Dome' removed from EhcacheManager.
2023-08-30 14:35:03.856  INFO 984 --- [  restartedMain] o.e.c.EhcacheManager                     : Cache 'com.orsbv.hcs.model.Person' removed from EhcacheManager.
2023-08-30 14:35:03.857  INFO 984 --- [  restartedMain] o.e.c.EhcacheManager                     : Cache 'com.orsbv.hcs.model.CareTeam' removed from EhcacheManager.
2023-08-30 14:35:03.857  INFO 984 --- [  restartedMain] o.e.c.EhcacheManager                     : Cache 'com.orsbv.hcs.model.CompanySettings' removed from EhcacheManager.
2023-08-30 14:35:03.858  INFO 984 --- [  restartedMain] o.e.c.EhcacheManager                     : Cache 'com.orsbv.hcs.model.multitenancy.Tenant' removed from EhcacheManager.
2023-08-30 14:35:03.858  INFO 984 --- [  restartedMain] o.e.c.EhcacheManager                     : Cache 'com.orsbv.hcs.model.financier.Financier' removed from EhcacheManager.
2023-08-30 14:35:03.859  INFO 984 --- [  restartedMain] o.e.c.EhcacheManager                     : Cache 'com.orsbv.hcs.model.Company' removed from EhcacheManager.
2023-08-30 14:35:03.860  INFO 984 --- [  restartedMain] o.e.c.EhcacheManager                     : Cache 'com.orsbv.hcs.model.Province' removed from EhcacheManager.
2023-08-30 14:35:03.860  INFO 984 --- [  restartedMain] o.e.c.EhcacheManager                     : Cache 'com.orsbv.hcs.model.multitenancy.UserTenant' removed from EhcacheManager.
2023-08-30 14:35:03.861  INFO 984 --- [  restartedMain] o.e.c.EhcacheManager                     : Cache 'com.orsbv.hcs.model.function.Function' removed from EhcacheManager.
2023-08-30 14:35:03.869  INFO 984 --- [  restartedMain] c.z.h.HikariDataSource                   : HikariPool-1 - Shutdown initiated...
2023-08-30 14:35:03.890  INFO 984 --- [  restartedMain] c.z.h.HikariDataSource                   : HikariPool-1 - Shutdown completed.
2023-08-30 14:35:03.908  INFO 984 --- [  restartedMain] ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2023-08-30 14:35:03.927 ERROR 984 --- [  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:46) [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


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

though i have set servlet context in main class

@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class, WebMvcAutoConfiguration.class,
        org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration.class})
@ServletComponentScan
public class AppApplication extends SpringBootServletInitializer {

    public static void main(String[] args) {
        SpringApplication.run(AppApplication.class, args);

    }

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(AppApplication.class);
    }
    @Override
    public void onStartup(ServletContext servletContext) throws ServletException {
        super.onStartup(servletContext);
    }

    @Bean
    public ServletWebServerFactory servletContainer() {
        TomcatServletWebServerFactory tomcat = new TomcatServletWebServerFactory();
         return tomcat;
    }
}
Jens
  • 67,715
  • 15
  • 98
  • 113
TanvirChowdhury
  • 2,498
  • 23
  • 28
  • Does this answer your question? [No ServletContext set when initiating resourceHandlerMapping bean](https://stackoverflow.com/questions/58100353/no-servletcontext-set-when-initiating-resourcehandlermapping-bean) – Jens Aug 30 '23 at 08:44
  • @Jens Thanks for response no this does not solve my problem. – TanvirChowdhury Aug 30 '23 at 08:58

0 Answers0