Jump to content
  • 0
Le Pebz

Exception in main thread

Question

Okay well I figured it out like a while ago but anyone who reads this and gets this error you just need to load a cache lol

So what I did is uhmmmmmm depending on how accurate you want to be 
Is lets say you have a 718 uhm well download a source with a cache in the source and move the cache to your shit
And thats about it.


For eclipse (Like me)
Uhmmm if you tried to load a cache and it didnt work just remove what you did then extract the cache from the source to your desktop then import it lol 
I did it wrong 

How to read this error?
I have no idea, just know it has something to do with the cache and the int with the server 

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 10
    at com.lel.utils.huffman.Huffman.init(Huffman.java:15)
    at com.lel.Server.initCentralCores(Server.java:63)
    at com.lel.Server.startEngine(Server.java:126)
    at com.lel.Server.main(Server.java:49)
Edited by Le Pebz

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

For future reference, how to read a stack trace:

First line pretty much says "something went wrong in this thread, and this is what went wrong". In this case, in the main thread an ArrayIndexOutOfBoundsException happened with index 10. This means that, the code tried to access an array on index 10, but the array didn't have that many indices.

Every line below is a stack trace element. That basically means, every method (to a certain extent) that was called to lead to this exception. Usually only the first few elements are relevant.

Main method called startEngine, startEngine called initCentralCores, and that in turn called Huffman.init. The digit after the class name tells you on which line it broke. Note that it only actually broke at the top most element (Huffman.init) but because that broke, everything else that counted on it working broke aswell.

 

The more you know.

Share this post


Link to post
Share on other sites
  • 0

For future reference, how to read a stack trace:

First line pretty much says "something went wrong in this thread, and this is what went wrong". In this case, in the main thread an ArrayIndexOutOfBoundsException happened with index 10. This means that, the code tried to access an array on index 10, but the array didn't have that many indices.

Every line below is a stack trace element. That basically means, every method (to a certain extent) that was called to lead to this exception. Usually only the first few elements are relevant.

Main method called startEngine, startEngine called initCentralCores, and that in turn called Huffman.init. The digit after the class name tells you on which line it broke. Note that it only actually broke at the top most element (Huffman.init) but because that broke, everything else that counted on it working broke aswell.

 

The more you know.

Thank you, I appreciate the explanation and kind of had a idea of what happened but not really till now  


I guess my next question is........

How do you determine that it is a problem because there was no cache to load...

Because like you said "The code tried to access an array on index 10."

But pretty much it really didn't exist, because the code wasn't able to find and load nothing causing the exception?

And it went wrong in the thread because it had nothing to run?
And then it threw exceptions, explaining where it went wrong and why it didn't start? Kind of ish?

Edited by Le Pebz

Share this post


Link to post
Share on other sites
  • 0

Thank you, I appreciate the explanation and kind of had a idea of what happened but not really till now  

I guess my next question is........

How do you determine that it is a problem because there was no cache to load...

Because like you said "The code tried to access an array on index 10."

But pretty much it really didn't exist, because the code wasn't able to find and load nothing causing the exception?

And it went wrong in the thread because it had nothing to run?
And then it threw exceptions, explaining where it went wrong and why it didn't start? Kind of ish?

It really depends on what the code does. If the code is responsible for loading cache stuff into this array (either directly or indirectly) then yes, it most likely failed to load the array (the code expected index 10 was a valid index in the array but instead it was not). The array probably wasn't filled with anything and you can then assume either the cache is broken, missing or incompatible, causing the code that is responsible for filling the array and all the called code that depends on this array to fail.

Edited by Arix

Share this post


Link to post
Share on other sites

×