Thread: Ascend source java.lang.ArrayIndexOutOfBoundsException

Results 1 to 8 of 8
  1. #1 Ascend source java.lang.ArrayIndexOutOfBoundsException 
    Registered Member
    Join Date
    Aug 2012
    Posts
    190
    Thanks given
    12
    Thanks received
    13
    Rep Power
    29
    Hello,
    I wonder if anybody could help me.
    Sometimes when people try to login on the server it prints this
    java.lang.ArrayIndexOutOfBoundsException
    in the console and kicks them back out
    They have to try multiple times before the server lets them on.
    i've been looking everywhere for a solution some people say its cache related but i've put the cache
    in my data file so fuck noes
    Any help would be appreciated
    thanks
    Reply With Quote  
     

  2. #2  
    Community Veteran


    Arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,950
    Thanks given
    210
    Thanks received
    349
    Rep Power
    1376
    You sure it do not print out more like what file it causing it?


    "A fail act is something you do regular, but a dumb act is something you can learn from"
    Spoiler for Problem?:
    Reply With Quote  
     

  3. #3  
    Registered Member
    TheChosenOne's Avatar
    Join Date
    Jan 2013
    Posts
    967
    Thanks given
    47
    Thanks received
    161
    Rep Power
    366
    Have you tried running the server in debug mode with the option enabled to stop code execution when a certain type of exception is thrown?

    EDIT: I mean within an IDE
    Last edited by TheChosenOne; 06-04-2019 at 09:36 PM. Reason: Clarification
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Aug 2012
    Posts
    190
    Thanks given
    12
    Thanks received
    13
    Rep Power
    29
    Quote Originally Posted by arch337 View Post
    You sure it do not print out more like what file it causing it?
    java.lang.ArrayIndexOutOfBoundsException is the only thing that prints when it happens, If i go to the arrayutils file there is alot of outofbounds text so unsure which one it is.
    Apparently it happens on other servers using my source aswell. This is the code : https://pastebin.com/5iEBp7s6

    Quote Originally Posted by TheChosenOne View Post
    Have you tried running the server in debug mode with the option enabled to stop code execution when a certain type of exception is thrown?

    EDIT: I mean within an IDE
    So on eclipse just right click and click debug as? I've not clue how to enable that other option
    Reply With Quote  
     

  5. #5  
    Registered MrClassic
    MrClassic's Avatar
    Join Date
    Oct 2008
    Age
    15
    Posts
    2,063
    Thanks given
    24,154
    Thanks received
    551
    Rep Power
    5000
    Within eclipse you can click left of the line which you want to read data from. A small circle will appear and then run the server in debug mode. Once the debugger reaches the line of code, the server will pause
    Reply With Quote  
     

  6. #6  
    Registered Member
    TheChosenOne's Avatar
    Join Date
    Jan 2013
    Posts
    967
    Thanks given
    47
    Thanks received
    161
    Rep Power
    366
    Quote Originally Posted by Smidge View Post
    java.lang.ArrayIndexOutOfBoundsException is the only thing that prints when it happens, If i go to the arrayutils file there is alot of outofbounds text so unsure which one it is.
    Apparently it happens on other servers using my source aswell. This is the code : https://pastebin.com/5iEBp7s6



    So on eclipse just right click and click debug as? I've not clue how to enable that other option
    Take a look at this link, it explains how to break on certain exceptions: https://help.eclipse.org/oxygen/inde...exceptions.htm
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Aug 2012
    Posts
    190
    Thanks given
    12
    Thanks received
    13
    Rep Power
    29
    Thank you guys, i'll try this out.

    java.lang.ArrayIndexOutOfBoundsException: 512
    at ethos.util.Stream.writeBits(Stream.java:384)
    at ethos.model.players.Player.addNewNPC(Player.java:3 477)
    at ethos.model.players.PlayerHandler.updateNPC(Player Handler.java:251)
    at ethos.model.players.Player.update(Player.java:1260 )
    at ethos.model.players.PlayerHandler.process(PlayerHa ndler.java:195)
    at ethos.Server.lambda$0(Server.java:174)
    at java.util.concurrent.Executors$RunnableAdapter.cal l(Unknown Source)
    at java.util.concurrent.FutureTask.runAndReset(Unknow n Source)
    at java.util.concurrent.ScheduledThreadPoolExecutor$S cheduledFutureTask.access$301(Unknown Source)
    at java.util.concurrent.ScheduledThreadPoolExecutor$S cheduledFutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker( Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    This is what is causing it i'm fairly certain but no clue how to fix

    player.java reads : str.writeBits(14, id);
    I think its because its out of bounds, what should i change this to?
    Reply With Quote  
     

  8. #8  
    Registered MrClassic
    MrClassic's Avatar
    Join Date
    Oct 2008
    Age
    15
    Posts
    2,063
    Thanks given
    24,154
    Thanks received
    551
    Rep Power
    5000
    What did you try to change? The bits need to be the same server-sided as client-sided.
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Replies: 2
    Last Post: 02-09-2012, 01:50 PM
  2. Replies: 7
    Last Post: 12-03-2011, 09:38 AM
  3. java.lang.ArrayIndexOutOfBoundsException: 7390
    By zhstyle1990 in forum Help
    Replies: 0
    Last Post: 09-18-2011, 10:54 PM
  4. Replies: 1
    Last Post: 12-09-2009, 03:30 AM
  5. java.lang.ArrayIndexOutOfBoundsException: 0
    By Pilldom in forum Projects
    Replies: 0
    Last Post: 11-27-2008, 04:10 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •