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

2.1.2 RELEASE static resources 500 substring error -1 #437

Open
kalshen2018 opened this issue Aug 29, 2022 · 2 comments
Open

2.1.2 RELEASE static resources 500 substring error -1 #437

kalshen2018 opened this issue Aug 29, 2022 · 2 comments

Comments

@kalshen2018
Copy link

  • 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
Copy link

auula commented Oct 15, 2022

  • 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
Copy link

auula commented Oct 15, 2022

StringIndexOutOfBoundsException

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

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

2 participants