lets-blade/blade

2.1.2 RELEASE static resources 500 substring error -1

kalshen2018 opened this issue · 2 comments

  • System Version (e.g. Mac Os 10.14.3):
  • Build tools (e.g. maven/gradle):
  • JDK Version (e.g. 1.8):
  • Blade Version (e.g. 2.1.2.RELEASE):

Describe the bug

ERROR [ worker@thread-1 ] c.h.b.m.h.DefaultExceptionHandler : java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1931)
at com.hellokaton.blade.server.StaticFileHandler.getResourceListing(StaticFileHandler.java:470)
at com.hellokaton.blade.server.StaticFileHandler.writeJarResource(StaticFileHandler.java:380)
at com.hellokaton.blade.server.StaticFileHandler.writeWithJarFile(StaticFileHandler.java:343)
at com.hellokaton.blade.server.StaticFileHandler.handle(StaticFileHandler.java:135)
at com.hellokaton.blade.server.HttpServerHandler.executeLogic(HttpServerHandler.java:139)
at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:616)
at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:591)
at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:456)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:469)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at java.lang.Thread.run(Thread.java:748)

To Reproduce

Steps to reproduce the behavior:

  1. Operating system and its version
  2. Build tools (e.g. maven or gradle)
  3. JDK version and blade version(e.g 1.8)
  4. Blade Version (e.g. 2.1.2.RELEASE):
  5. See error

Expected behavior:

A clear and concise description of what you expected to happen.

Screenshots:

If applicable, add screenshots to help explain your problem.

Additional context:

Add any other context about the problem here.

auula commented
  • System Version (e.g. Mac Os 10.14.3):
  • Build tools (e.g. maven/gradle):
  • JDK Version (e.g. 1.8):
  • Blade Version (e.g. 2.1.2.RELEASE):

Describe the bug

ERROR [ worker@thread-1 ] c.h.b.m.h.DefaultExceptionHandler : java.lang.StringIndexOutOfBoundsException: String index out of range: -1 at java.lang.String.substring(String.java:1931) at com.hellokaton.blade.server.StaticFileHandler.getResourceListing(StaticFileHandler.java:470) at com.hellokaton.blade.server.StaticFileHandler.writeJarResource(StaticFileHandler.java:380) at com.hellokaton.blade.server.StaticFileHandler.writeWithJarFile(StaticFileHandler.java:343) at com.hellokaton.blade.server.StaticFileHandler.handle(StaticFileHandler.java:135) at com.hellokaton.blade.server.HttpServerHandler.executeLogic(HttpServerHandler.java:139) at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:616) at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:591) at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:456) at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164) at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:469) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500) at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986) at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) at java.lang.Thread.run(Thread.java:748)

To Reproduce

Steps to reproduce the behavior:

  1. Operating system and its version
  2. Build tools (e.g. maven or gradle)
  3. JDK version and blade version(e.g 1.8)
  4. Blade Version (e.g. 2.1.2.RELEASE):
  5. See error

Expected behavior:

A clear and concise description of what you expected to happen.

Screenshots:

If applicable, add screenshots to help explain your problem.

Additional context:

Add any other context about the problem here.

Maybe there is a problem with your static file directory storage, please check your static directory settings or give you a screenshot of your code, thanks.

auula commented

StringIndexOutOfBoundsException

Is the directory path in Chinese? Note that the exception is of type StringIndexOutOfBoundsException.