Author Topic: "Array Index Out of Bounds Exception" Alert  (Read 8726 times)

Offline Phisk

  • Vagabond
  • *
  • Posts: 3
  • Merit: 0
  • I haven't updated my profile yet!
    • View Profile
"Array Index Out of Bounds Exception" Alert
« on: December 16, 2014, 04:07:05 PM »
What does this alert mean and why does it show up? Thanks for your help!

Linkback: https://www.carcassonnecentral.com/community/index.php?topic=1353.0

Offline Paul

  • Marquis Chevalier
  • ***
  • Posts: 2491
  • Merit: 86
    • View Profile
    • sydby.com
Re: "Array Index Out of Bounds Exception" Alert
« Reply #1 on: December 17, 2014, 12:29:31 AM »
arrays are used in programming language. Could be you need to update Java (by Oracle media) or are you using a JavaScript yourself?

Arrays have an index and like the error says and could be anything but usually it's because the script is missing a semi-colon somewhere.
World record holder for a single game of Carcassonne using 10 007 tiles!

Offline Decar

  • Owner
  • Chatelain Grand Officier
  • *
  • *
  • Posts: 6731
  • Merit: 319
  • Shut up and take my money!
    • View Profile
    • tehill.net
Re: "Array Index Out of Bounds Exception" Alert
« Reply #2 on: December 17, 2014, 02:27:27 AM »
Hi Phisk,

a) Is this happening when the application starts up or when you're doing something in particular?

b) is there an error.log in the JCloisterZone directory?

c) Can you confirm what version of Java you are running?

d) Can you confirm JCloisterZone is the latest version 3.0.2?

Cheers :)

Offline Phisk

  • Vagabond
  • *
  • Posts: 3
  • Merit: 0
  • I haven't updated my profile yet!
    • View Profile
Re: "Array Index Out of Bounds Exception" Alert
« Reply #3 on: December 17, 2014, 04:06:22 AM »
Hi Decar,

a) I placed a tile and suddenly this showed up.

b) yes there is.

c) Unfortunately I'm not very experienced with computers so I don't know :-\

d) Yes, it's the latest version.

Thanks

Offline Decar

  • Owner
  • Chatelain Grand Officier
  • *
  • *
  • Posts: 6731
  • Merit: 319
  • Shut up and take my money!
    • View Profile
    • tehill.net
Re: "Array Index Out of Bounds Exception" Alert
« Reply #4 on: December 17, 2014, 07:28:25 AM »
That's useful,

Does it happen every time you place a tile or was it a one off?

Any chance you can paste the content of the error.log here - it might contain a clue.

I'm trying to find an easy way of checking your java version - it's probably 1.7 so I imagine that's not the cause.

Offline Decar

  • Owner
  • Chatelain Grand Officier
  • *
  • *
  • Posts: 6731
  • Merit: 319
  • Shut up and take my money!
    • View Profile
    • tehill.net
Re: "Array Index Out of Bounds Exception" Alert
« Reply #5 on: December 17, 2014, 07:30:06 AM »
You might be able to check you're up to date with this:

https://www.java.com/en/download/installed.jsp

Offline Paul

  • Marquis Chevalier
  • ***
  • Posts: 2491
  • Merit: 86
    • View Profile
    • sydby.com
Re: "Array Index Out of Bounds Exception" Alert
« Reply #6 on: December 17, 2014, 07:31:08 AM »
You might be able to check you're up to date with this:

https://www.java.com/en/download/installed.jsp

 :(y) Beat me to it!  ^-^

Offline farin

  • Duke
  • *
  • Posts: 241
  • Merit: 44
  • JCloisterZone maintainer
    • View Profile
Re: "Array Index Out of Bounds Exception" Alert
« Reply #7 on: December 17, 2014, 08:34:37 AM »
Hi
In help menu is choice to create bug report (which contains java version etc). So if it happens again plese try to create report.

Maybe you still have, error.log in game directory. If so please sent it to me. Thanks

Offline danisthirty

  • (not thirSty!)
  • Owner
  • Chatelain Grand-Croix
  • *
  • *
  • Posts: 6946
  • Merit: 293
  • "First to 4 points wins?"
    • View Profile
Re: "Array Index Out of Bounds Exception" Alert
« Reply #8 on: December 17, 2014, 08:51:20 AM »
Hi
In help menu is choice to create bug report (which contains java version etc). So if it happens again plese try to create report.

Maybe you still have, error.log in game directory. If so please sent it to me. Thanks

 :(y)

Thanks farin!  :)

Offline Phisk

  • Vagabond
  • *
  • Posts: 3
  • Merit: 0
  • I haven't updated my profile yet!
    • View Profile
Re: "Array Index Out of Bounds Exception" Alert
« Reply #9 on: December 17, 2014, 09:40:17 AM »
Ok, it says I have the recommended Java version installed.

It happened when I placed a single tile. I started a new game today and there were no problems at all.

the error.log says:

[Thread-21] ERROR com.jcloisterzone.ui.panel.GamePanel - null
java.lang.ArrayIndexOutOfBoundsException
   at com.jcloisterzone.board.DefaultTilePack.drawTile(DefaultTilePack.java:75)
   at com.jcloisterzone.board.DefaultTilePack.drawTiles(DefaultTilePack.java:86)
   at com.jcloisterzone.game.phase.BazaarPhase.handleRandSample(BazaarPhase.java:94)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:483)
   at com.jcloisterzone.wsio.MessageDispatcher.dispatchOn(MessageDispatcher.java:47)
   at com.jcloisterzone.wsio.MessageDispatcher.dispatch(MessageDispatcher.java:30)
   at com.jcloisterzone.rmi.ClientStub.onWebsocketMessage(ClientStub.java:117)
   at com.jcloisterzone.wsio.Connection$1.onMessage(Connection.java:72)
   at org.java_websocket.client.WebSocketClient.onWebsocketMessage(WebSocketClient.java:248)
   at org.java_websocket.WebSocketImpl.decodeFrames(WebSocketImpl.java:375)
   at org.java_websocket.WebSocketImpl.decode(WebSocketImpl.java:158)
   at org.java_websocket.client.WebSocketClient.run(WebSocketClient.java:185)
   at java.lang.Thread.run(Thread.java:745)
[Thread-21] ERROR com.jcloisterzone.EventBusExceptionHandler - game event bus > Could not dispatch event: com.jcloisterzone.ui.InvokeInSwingUiAdapter@7f6ff426 to public void com.jcloisterzone.ui.InvokeInSwingUiAdapter.handleAllEvents(com.jcloisterzone.event.Event)
java.lang.NullPointerException
   at com.jcloisterzone.action.TilePlacementAction.toString(TilePlacementAction.java:102)
   at java.lang.String.valueOf(String.java:2981)
   at java.lang.StringBuilder.append(StringBuilder.java:131)
   at java.util.AbstractCollection.toString(AbstractCollection.java:462)
   at java.lang.String.valueOf(String.java:2981)
   at java.lang.StringBuilder.append(StringBuilder.java:131)
   at com.jcloisterzone.event.SelectActionEvent.toString(SelectActionEvent.java:36)
   at java.lang.String.valueOf(String.java:2981)
   at java.lang.StringBuilder.append(StringBuilder.java:131)
   at com.jcloisterzone.ui.InvokeInSwingUiAdapter.handleAllEvents(InvokeInSwingUiAdapter.java:30)
   at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:483)
   at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
   at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
   at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
   at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
   at com.google.common.eventbus.EventBus.post(EventBus.java:275)
   at com.jcloisterzone.game.Game.flushEventQueue(Game.java:124)
   at com.jcloisterzone.rmi.ClientStub.phaseLoop(ClientStub.java:132)
   at com.jcloisterzone.rmi.ClientStub.onWebsocketMessage(ClientStub.java:118)
   at com.jcloisterzone.wsio.Connection$1.onMessage(Connection.java:72)
   at org.java_websocket.client.WebSocketClient.onWebsocketMessage(WebSocketClient.java:248)
   at org.java_websocket.WebSocketImpl.decodeFrames(WebSocketImpl.java:375)
   at org.java_websocket.WebSocketImpl.decode(WebSocketImpl.java:158)
   at org.java_websocket.client.WebSocketClient.run(WebSocketClient.java:185)
   at java.lang.Thread.run(Thread.java:745)

Offline Leven

  • Viscount
  • ****
  • Posts: 679
  • Merit: 50
    • View Profile
Re: "Array Index Out of Bounds Exception" Alert
« Reply #10 on: January 22, 2015, 01:47:24 PM »
FYI:
A few days ago I took part in a 3-player game where the Bridges, castles and bazaars expansion was included.
When there was only 2 tiles left in the stack, one of us drew the remaining Bazaar tile, and then it happened: the "ArrayIndexOutOfBoundsException" appeared.
So apparently the problem occurs when there is less tiles left than the number of players.

According to CAR, in such a situation the Bazaar has to be ignored so that would be the appropriate behaviour of JCZ.

Offline farin

  • Duke
  • *
  • Posts: 241
  • Merit: 44
  • JCloisterZone maintainer
    • View Profile
Re: "Array Index Out of Bounds Exception" Alert
« Reply #11 on: January 22, 2015, 03:01:07 PM »
hi,

in that case it is this bug https://github.com/farin/JCloisterZone/issues/98
will be fixed in 3.1-beta1 (i hope i will build it during weekend)

Offline Leven

  • Viscount
  • ****
  • Posts: 679
  • Merit: 50
    • View Profile
Re: "Array Index Out of Bounds Exception" Alert
« Reply #12 on: January 22, 2015, 04:38:29 PM »
That's it, exactly.
Fortunately the last two tiles of that game could not influence the final result yet, everything was already decided by that time.


Share via delicious Share via digg Share via facebook Share via furl Share via linkedin Share via myspace Share via reddit Share via stumble Share via technorati Share via twitter

  Subject / Started by Replies / Views Last post
xx
How to set up a phone alert

Started by mjwalker

1 Replies
1689 Views
Last post July 10, 2019, 03:25:44 PM
by Meepledrone
xx
Carcassonne Maps - Germany - Error or exception in rules?

Started by Meepledrone

6 Replies
4709 Views
Last post April 15, 2019, 04:18:10 AM
by Sinscerly
xx
Completionism Poll: Index

Started by quevy

1 Replies
31885 Views
Last post March 06, 2016, 05:32:09 AM
by jungleboy
xx
Element of the Week: Index

Started by danisthirty

0 Replies
32518 Views
Last post October 07, 2015, 04:29:04 AM
by danisthirty
lamp
Element Match-Ups: Index

Started by Whaleyland

0 Replies
18265 Views
Last post October 30, 2015, 04:52:23 PM
by Whaleyland