question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Forwarding to error page from request [/starter.zip]due to exception [String index out of range: -1]

See original GitHub issue

Forwarding to error page from request [/starter.zip]due to exception [String index out of range: -1]

It happened in linux environment. Exception is threw from this class:

io.spring.initializr.generator.project.contributor.MultipleResourcesProjectContributor.contribute(MultipleResourcesProjectContributor.java:59)
String filename =resource.getURI().toString().substring(root.getURI().toString().length()+1);

if your java project run in the linux environment,the rootResource will get “/” in last char,so the exception will happen in this time. so I modified it like this

String filename =resource.getURI().toString().substring(root.getURI().toString().length());

when java project run in the linux environment.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
snicollcommented, Feb 15, 2019

“Running in Linux” is not helping either and we’ve spent more time getting the information than actually working on a fix.

I can reproduce the issue when deploying to an existing container.

0reactions
weishi2010commented, Feb 15, 2019

“Running in Linux” is not helping either and we’ve spent more time getting the information than actually working on a fix.

I can reproduce the issue when deploying to an existing container.

Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

java.lang.StringIndexOutOfBoundsException: String index out ...
The reason you are getting this error is therefore that you are trying to execute a substring(0,1) on a String with less than...
Read more >
How to Handle String Index Out Of Bounds Exception in Java
The StringOutOfBoundsException in Java that occurs when accessing a string at an index which is negative/greater than the string length.
Read more >
List Index Out of Range – Python Error [Solved] - freeCodeCamp
In this article, we'll talk about the IndexError: list index out of range error in Python. In each section of the article, I'll...
Read more >
Retain Error: String index out of range: -1 - Support
When running an archive job, we are getting errors on just a few users out of an entire post office that continue to...
Read more >
Apache Tomcat 9 (9.0.70) - Changelog
Fix: Update the memory leak protection code to support stopping application created executor threads when running on Java 19 and later. · Fix:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found