My Spirng boot application is deployed successfully, But while running the application it get error.

himanshusingourHOBBY

a year ago

this type of error but in local its running fine

2024-04-14T16:28:53.582Z WARN 7 --- [ main] ConfigServletWebServerApplicationContext : 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/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Failed to instantiate [org.springframework.web.servlet.HandlerMapping]: Factory method 'resourceHandlerMapping' threw exception with message: Uncaught exception during scan

3 Replies

himanshusingourHOBBY

a year ago

at org.webjars.WebJarAssetLocator.scanForWebJars(WebJarAssetLocator.java:188) ~[webjars-locator-core-0.55.jar!/:na]

at org.webjars.WebJarAssetLocator.(WebJarAssetLocator.java:210) ~[webjars-locator-core-0.55.jar!/:na]

at org.webjars.WebJarAssetLocator.(WebJarAssetLocator.java:194) ~[webjars-locator-core-0.55.jar!/:na]

at org.springframework.web.servlet.resource.WebJarsResourceResolver.(WebJarsResourceResolver.java:63) ~[spring-webmvc-6.1.2.jar!/:6.1.2]

at org.springframework.web.servlet.config.annotation.ResourceChainRegistration.getResourceResolvers(ResourceChainRegistration.java:114) ~[spring-webmvc-6.1.2.jar!/:6.1.2]

at org.springframework.web.servlet.config.annotation.ResourceHandlerRegistration.getRequestHandler(ResourceHandlerRegistration.java:235) ~[spring-webmvc-6.1.2.jar!/:6.1.2]

at org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry.getRequestHandler(ResourceHandlerRegistry.java:178) ~[spring-webmvc-6.1.2.jar!/:6.1.2]

at org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry.getHandlerMapping(ResourceHandlerRegistry.java:168) ~[spring-webmvc-6.1.2.jar!/:6.1.2]

at org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.resourceHandlerMapping(WebMvcConfigurationSupport.java:589) ~[spring-webmvc-6.1.2.jar!/:6.1.2]

at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) ~[na:na]

at java.base/java.lang.reflect.Method.invoke(Method.java:580) ~[na:na]

at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:140) ~[spring-beans-6.1.2.jar!/:6.1.2]

… 25 common frames omitted

Caused by: java.lang.UnsupportedOperationException: Unable to resolve nested path

at org.springframework.boot.loader.nio.file.NestedPath.resolve(NestedPath.java:130) ~[spring-app.jar:0.0.1-SNAPSHOT]

at java.base/java.nio.file.Path.resolve(Path.java:516) ~[na:na]

at io.github.classgraph.Scanner$2.newInstance(Scanner.java:479) ~[classgraph-4.8.116.jar!/:4.8.116]

at io.github.classgraph.Scanner$2.newInstance(Scanner.java:388) ~[classgraph-4.8.116.jar!/:4.8.116]

at nonapi.io.github.classgraph.concurrency.SingletonMap.get(SingletonMap.java:189) ~[classgraph-4.8.116.jar!/:4.8.116]

at io.github.classgraph.Scanner$3.processWorkUnit(Scanner.java:583) ~[classgraph-4.8.116.jar!/:4.8.116]

at io.github.classgraph.Scanner$3.processWorkUnit(Scanner.java:574) ~[classgraph-4.8.116.jar!/:4.8.116]

at nonapi.io.github.classgraph.concurrency.WorkQueue.runWorkLoop(WorkQueue.java:246) ~[classgraph-4.8.116.jar!/:4.8.116]

at nonapi.io.github.classgraph.concurrency.WorkQueue.runWorkQueue(WorkQueue.java:161) ~[classgraph-4.8.116.jar!/:4.8.116]

at io.github.classgraph.Scanner.processWorkUnits(Scanner.java:342) ~[classgraph-4.8.116.jar!/:4.8.116]

at io.github.classgraph.Scanner.openClasspathElementsThenScan(Scanner.java:1057) ~[classgraph-4.8.116.jar!/:4.8.116]

at io.github.classgraph.Scanner.call(Scanner.java:1156) ~[classgraph-4.8.116.jar!/:4.8.116]

at io.github.classgraph.Scanner.call(Scanner.java:83) ~[classgraph-4.8.116.jar!/:4.8.116]

at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) ~[na:na]

at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[na:na]

at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[na:na]


a year ago

Can you share your code? Is it trying to do any file manipulation on startup?


mahajanrahuls89TRIAL

a year ago

@himanshusingour any luck resolving this error, same is the case with me, running fine locally.


My Spirng boot application is deployed successfully, But while running the application it get error. - Railway Help Station