Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start spring boot jar error: java.lang.UnsupportedOperationException: Unable to resolve nested path #659

Closed
89lovelc opened this issue Jan 23, 2024 · 1 comment

Comments

@89lovelc
Copy link

when i start jar ,like

 java -jar -Dzeebe-importer=kafka  zeebe-simple-monitor-2.6.3.jar

Error like this:

__                 __
 _/  _  _ |_   _   (_  .  _   _  |  _   |\/|  _   _  . |_  _   _
/__ (- (- |_) (-   __) | ||| |_) | (-   |  | (_) | ) | |_ (_) |
                             |

================================================================
                                

2024-01-23T12:27:09.826+08:00  INFO 88130 --- [           main] io.zeebe.monitor.ZeebeSimpleMonitorApp   : Starting ZeebeSimpleMonitorApp using Java 17.0.6 with PID 88130 (/Users/huangjianhui/Downloads/target/nexus-staging/deferred/io/zeebe/zeebe-simple-monitor/2.6.3/zeebe-simple-monitor-2.6.3.jar started by huangjianhui in /Users/huangjianhui)
2024-01-23T12:27:09.846+08:00 DEBUG 88130 --- [           main] io.zeebe.monitor.ZeebeSimpleMonitorApp   : Running with Spring Boot v3.2.1, Spring v6.1.2
2024-01-23T12:27:09.847+08:00  INFO 88130 --- [           main] io.zeebe.monitor.ZeebeSimpleMonitorApp   : No active profile set, falling back to 1 default profile: "default"
2024-01-23T12:27:16.424+08:00 ERROR 88130 --- [           main] i.c.c.auth.DefaultNoopAuthentication     : Unable to determine authentication. Please check your configuration
2024-01-23T12:27:17.647+08:00 ERROR 88130 --- [           main] o.s.boot.SpringApplication               : Application run failed

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
	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:655) ~[spring-beans-6.1.2.jar!/:6.1.2]
	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:643) ~[spring-beans-6.1.2.jar!/:6.1.2]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1334) ~[spring-beans-6.1.2.jar!/:6.1.2]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1164) ~[spring-beans-6.1.2.jar!/:6.1.2]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:561) ~[spring-beans-6.1.2.jar!/:6.1.2]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:521) ~[spring-beans-6.1.2.jar!/:6.1.2]
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:325) ~[spring-beans-6.1.2.jar!/:6.1.2]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.1.2.jar!/:6.1.2]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:323) ~[spring-beans-6.1.2.jar!/:6.1.2]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-6.1.2.jar!/:6.1.2]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:975) ~[spring-beans-6.1.2.jar!/:6.1.2]
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:960) ~[spring-context-6.1.2.jar!/:6.1.2]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:625) ~[spring-context-6.1.2.jar!/:6.1.2]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.2.1.jar!/:3.2.1]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:762) ~[spring-boot-3.2.1.jar!/:3.2.1]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:464) ~[spring-boot-3.2.1.jar!/:3.2.1]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:334) ~[spring-boot-3.2.1.jar!/:3.2.1]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1358) ~[spring-boot-3.2.1.jar!/:3.2.1]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1347) ~[spring-boot-3.2.1.jar!/:3.2.1]
	at io.zeebe.monitor.ZeebeSimpleMonitorApp.main(ZeebeSimpleMonitorApp.java:55) ~[!/:na]
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na]
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
	at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na]
	at org.springframework.boot.loader.launch.Launcher.launch(Launcher.java:91) ~[zeebe-simple-monitor-2.6.3.jar:2.6.3]
	at org.springframework.boot.loader.launch.Launcher.launch(Launcher.java:53) ~[zeebe-simple-monitor-2.6.3.jar:2.6.3]
	at org.springframework.boot.loader.launch.JarLauncher.main(JarLauncher.java:58) ~[zeebe-simple-monitor-2.6.3.jar:2.6.3]
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.HandlerMapping]: Factory method 'resourceHandlerMapping' threw exception with message: Uncaught exception during scan
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:177) ~[spring-beans-6.1.2.jar!/:6.1.2]
	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:651) ~[spring-beans-6.1.2.jar!/:6.1.2]
	... 26 common frames omitted
Caused by: io.github.classgraph.ClassGraphException: Uncaught exception during scan
	at io.github.classgraph.ClassGraph.scan(ClassGraph.java:1570) ~[classgraph-4.8.108.jar!/:4.8.108]
	at io.github.classgraph.ClassGraph.scan(ClassGraph.java:1587) ~[classgraph-4.8.108.jar!/:4.8.108]
	at io.github.classgraph.ClassGraph.scan(ClassGraph.java:1600) ~[classgraph-4.8.108.jar!/:4.8.108]
	at org.webjars.WebJarAssetLocator.scanForWebJars(WebJarAssetLocator.java:188) ~[webjars-locator-core-0.55.jar!/:na]
	at org.webjars.WebJarAssetLocator.<init>(WebJarAssetLocator.java:210) ~[webjars-locator-core-0.55.jar!/:na]
	at org.webjars.WebJarAssetLocator.<init>(WebJarAssetLocator.java:194) ~[webjars-locator-core-0.55.jar!/:na]
	at org.springframework.web.servlet.resource.WebJarsResourceResolver.<init>(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.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na]
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
	at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na]
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:140) ~[spring-beans-6.1.2.jar!/:6.1.2]
	... 27 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) ~[zeebe-simple-monitor-2.6.3.jar:2.6.3]
	at java.base/java.nio.file.Path.resolve(Path.java:515) ~[na:na]
	at io.github.classgraph.Scanner$2.newInstance(Scanner.java:479) ~[classgraph-4.8.108.jar!/:4.8.108]
	at io.github.classgraph.Scanner$2.newInstance(Scanner.java:388) ~[classgraph-4.8.108.jar!/:4.8.108]
	at nonapi.io.github.classgraph.concurrency.SingletonMap.get(SingletonMap.java:189) ~[classgraph-4.8.108.jar!/:4.8.108]
	at io.github.classgraph.Scanner$3.processWorkUnit(Scanner.java:576) ~[classgraph-4.8.108.jar!/:4.8.108]
	at io.github.classgraph.Scanner$3.processWorkUnit(Scanner.java:567) ~[classgraph-4.8.108.jar!/:4.8.108]
	at nonapi.io.github.classgraph.concurrency.WorkQueue.runWorkLoop(WorkQueue.java:246) ~[classgraph-4.8.108.jar!/:4.8.108]
	at nonapi.io.github.classgraph.concurrency.WorkQueue.runWorkQueue(WorkQueue.java:161) ~[classgraph-4.8.108.jar!/:4.8.108]
	at io.github.classgraph.Scanner.processWorkUnits(Scanner.java:342) ~[classgraph-4.8.108.jar!/:4.8.108]
	at io.github.classgraph.Scanner.openClasspathElementsThenScan(Scanner.java:1047) ~[classgraph-4.8.108.jar!/:4.8.108]
	at io.github.classgraph.Scanner.call(Scanner.java:1146) ~[classgraph-4.8.108.jar!/:4.8.108]
	at io.github.classgraph.Scanner.call(Scanner.java:83) ~[classgraph-4.8.108.jar!/:4.8.108]
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[na:na]
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[na:na]
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[na:na]
	at java.base/java.lang.Thread.run(Thread.java:833) ~[na:na]

but docker not like this ...

@89lovelc
Copy link
Author

I think this error maybe is caused by the spring version. I use spring.boot.version= 3.1.5 , jar can work normally

nitram509 added a commit that referenced this issue Jan 24, 2024
…Exception

fix #659 implement a workaround to fix UnsupportedOperationException
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant