apache / shenyu

Apache ShenYu is a Java native API Gateway for service proxy, protocol conversion and API governance.
https://shenyu.apache.org/
Apache License 2.0
8.41k stars 2.92k forks source link

[BUG] SpringMvcClientBeanPostProcessor path process error in diferent platform #2184

Closed qicz closed 2 years ago

qicz commented 2 years ago

Is there an existing issue for this?

Current Behavior

run the "shenyu-examples-http", the path process is a fault.

Expected Behavior

the URI path is invalid. 24e9012702eae1f770e8ca94029c0be

Steps To Reproduce

No response

Environment

ShenYu version(s): 2.4.1-SNAPSHOT
Windows platform

Debug logs

Exception in thread "shenyu-spring-mvc-client-thread-pool-0" java.nio.file.InvalidPathException: Illegal char <*> at index 14: /\/http\/test/ at sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182) at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153) at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77) at sun.nio.fs.WindowsPath.parse(WindowsPath.java:94) at sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:255) at java.nio.file.Paths.get(Paths.java:84) at org.apache.shenyu.client.springmvc.init.SpringMvcClientBeanPostProcessor.buildMetaDataDTO(SpringMvcClientBeanPostProcessor.java:127) at org.apache.shenyu.client.springmvc.init.SpringMvcClientBeanPostProcessor.lambda$postProcessAfterInitialization$0(SpringMvcClientBeanPostProcessor.java:103) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Exception in thread "shenyu-spring-mvc-client-thread-pool-1" java.nio.file.InvalidPathException: Illegal char <*> at index 21: /\/http\/order\/path/*/name at sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182) at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153) at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77) at sun.nio.fs.WindowsPath.parse(WindowsPath.java:94) at sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:255) at java.nio.file.Paths.get(Paths.java:84) at org.apache.shenyu.client.springmvc.init.SpringMvcClientBeanPostProcessor.buildMetaDataDTO(SpringMvcClientBeanPostProcessor.java:127) at org.apache.shenyu.client.springmvc.init.SpringMvcClientBeanPostProcessor.lambda$postProcessAfterInitialization$1(SpringMvcClientBeanPostProcessor.java:112) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Exception in thread "shenyu-spring-mvc-client-thread-pool-2" java.nio.file.InvalidPathException: Illegal char <> at index 21: /\/http\/order\/path/ at sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182) at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153) at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77) at sun.nio.fs.WindowsPath.parse(WindowsPath.java:94) at sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:255) at java.nio.file.Paths.get(Paths.java:84) at org.apache.shenyu.client.springmvc.init.SpringMvcClientBeanPostProcessor.buildMetaDataDTO(SpringMvcClientBeanPostProcessor.java:127) at org.apache.shenyu.client.springmvc.init.SpringMvcClientBeanPostProcessor.lambda$postProcessAfterInitialization$1(SpringMvcClientBeanPostProcessor.java:112) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Exception in thread "shenyu-spring-mvc-client-thread-pool-3" java.nio.file.InvalidPathException: Illegal char <*> at index 17: /\/http\/request/** at sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182) at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153) at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77) at sun.nio.fs.WindowsPath.parse(WindowsPath.java:94) at sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:255) at java.nio.file.Paths.get(Paths.java:84) at org.apache.shenyu.client.springmvc.init.SpringMvcClientBeanPostProcessor.buildMetaDataDTO(SpringMvcClientBeanPostProcessor.java:127) at org.apache.shenyu.client.springmvc.init.SpringMvcClientBeanPostProcessor.lambda$postProcessAfterInitialization$0(SpringMvcClientBeanPostProcessor.java:103) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)

Anything else?

No response

qicz commented 2 years ago

@sunrui849 The Paths.get api will use different FileSystemProvider, windows start with \ , Unix like start with /, but URI path must use /.

image image