Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (498)
Games in Android Showcase (117)
games submitted by our members
Games in WIP (564)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  ArrayIndexOutOfBoundsException on getControllers()  (Read 1839 times)
0 Members and 1 Guest are viewing this topic.
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 800
Projects: 4
Exp: 16 years


Hand over your head.


« Posted 2004-08-19 11:30:50 »

ArrayIndexOutOfBoundsException *inside* CtrlEnv.getControllers()

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
      try
      {
         Controller[] con = ControllerEnvironment.getDefaultEnvironment().getControllers();

         for (int i = 0; i < con.length; i++)
         {
            System.out.println(con[i].getType().toString());
         }
      }
      catch (Exception exc)
      {
         exc.printStackTrace();
      }




I have the feeling it's caught somewhere, because the Controller[] is filled with controllers after I press 'continue' (green arrow) in Eclipse.

The catch-block is never run. (no stacktrace printed)

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
Scanning jar: dxinput.jar

<snip>

Examining file : net/java/games/input/DirectInputEnvironmentPlugin.class
Found candidate class: net/java/games/input/DirectInputEnvironmentPlugin.class
Adding class to plugins:net.java.games.input.DirectInputEnvironmentPlugin

<snip>

Scanning jar: jutils.jar

<snip>

Examining file : net/java/games/util/plugins/Plugin.class
Found candidate class: net/java/games/util/plugins/Plugin.class

<note: nothing about 'adding' mentioned>

<snip>

<con[] printed after 'continue'>

mouse
buttons

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline endolf

JGO Coder


Medals: 7


Current project release date: sometime in 3003


« Reply #1 - Posted 2004-08-19 11:55:47 »

Hi
 So are you saying that no stacktrace appears on the console? the top of the debug window seems to be missing, and I'm guessing that shoes some more lines from the stack?. The console should contain some useful debug info, the bits you snipped, can you paste those too?

Cheers

Endolf

Offline Riven
« League of Dukes »

JGO Overlord


Medals: 800
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #2 - Posted 2004-08-19 12:04:25 »

Quote
Hi
 So are you saying that no stacktrace appears on the console?


Yes.

Quote
the top of the debug window seems to be missing, and I'm guessing that shoes some more lines from the stack?.


Ofcourse I would not do that, the line above it states:
"ArrayIndexOutOfBoundsException"

I updated the image to show it (check first post / refresh)

Quote
The console should contain some useful debug info, the bits you snipped, can you paste those too?


Sure, but AFAIK I did not snip any lines other than "Examining file: ..." but I understand you cannot rely on that Smiley

Here it is:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
Scanning jar: dxinput.jar
Examining file : META-INF/
Examining file : META-INF/MANIFEST.MF
Examining file : net/
Examining file : net/java/
Examining file : net/java/games/
Examining file : net/java/games/input/
Examining file : net/java/games/input/DirectInputAxis.class
Examining file : net/java/games/input/DirectInputDevice.class
Examining file : net/java/games/input/DirectInputEnvironmentPlugin.class
Found candidate class: net/java/games/input/DirectInputEnvironmentPlugin.class
Adding class to plugins:net.java.games.input.DirectInputEnvironmentPlugin
Examining file : net/java/games/input/DirectInputKeyboard.class
Examining file : net/java/games/input/DirectInputMouse$BallAxis.class
Examining file : net/java/games/input/DirectInputMouse$BallImpl.class
Examining file : net/java/games/input/DirectInputMouse$ButtonImpl.class
Examining file : net/java/games/input/DirectInputMouse$ButtonsImpl.class
Examining file : net/java/games/input/DirectInputMouse.class
Examining file : net/java/games/input/DirectInputRumbler.class
Scanning jar: jinput.jar
Examining file : META-INF/
Examining file : META-INF/MANIFEST.MF
Examining file : net/
Examining file : net/java/
Examining file : net/java/games/
Examining file : net/java/games/input/
Examining file : net/java/games/input/test/
Examining file : net/java/games/input/AbstractAxis.class
Examining file : net/java/games/input/AbstractController.class
Examining file : net/java/games/input/Axis$Identifier.class
Examining file : net/java/games/input/Axis$POV.class
Examining file : net/java/games/input/Axis.class
Examining file : net/java/games/input/Controller$PortType.class
Examining file : net/java/games/input/Controller$Type.class
Examining file : net/java/games/input/Controller.class
Examining file : net/java/games/input/ControllerEnvironment.class
Examining file : net/java/games/input/ControllerEvent.class
Examining file : net/java/games/input/ControllerListener.class
Examining file : net/java/games/input/DefaultControllerEnvironment$1.class
Examining file : net/java/games/input/DefaultControllerEnvironment.class
Examining file : net/java/games/input/Keyboard$Key.class
Examining file : net/java/games/input/Keyboard$KeyID.class
Examining file : net/java/games/input/Keyboard.class
Examining file : net/java/games/input/Mouse$Ball.class
Examining file : net/java/games/input/Mouse$Button.class
Examining file : net/java/games/input/Mouse$ButtonID.class
Examining file : net/java/games/input/Mouse$Buttons.class
Examining file : net/java/games/input/Mouse.class
Examining file : net/java/games/input/PluginClassLoader$1.class
Examining file : net/java/games/input/PluginClassLoader$JarFileFilter.class
Examining file : net/java/games/input/PluginClassLoader.class
Examining file : net/java/games/input/Rumbler.class
Examining file : net/java/games/input/StandardKeyboard$KeyID.class
Examining file : net/java/games/input/StandardKeyboard.class
Examining file : net/java/games/input/test/AnalogAxisPanel.class
Examining file : net/java/games/input/test/AxisPanel.class
Examining file : net/java/games/input/test/ControllerReadTest$1.class
Examining file : net/java/games/input/test/ControllerReadTest.class
Examining file : net/java/games/input/test/ControllerTextTest.class
Examining file : net/java/games/input/test/ControllerWindow.class
Examining file : net/java/games/input/test/DigitalAxisPanel.class
Examining file : net/java/games/input/test/DigitalHatPanel.class
Examining file : net/java/games/input/test/RumbleTest.class
Examining file : net/java/games/input/Version.class
Scanning jar: jutils.jar
Examining file : META-INF/
Examining file : META-INF/MANIFEST.MF
Examining file : net/
Examining file : net/java/
Examining file : net/java/games/
Examining file : net/java/games/util/
Examining file : net/java/games/util/plugins/
Examining file : net/java/games/util/plugins/test/
Examining file : net/java/games/util/plugins/Plugin.class
Found candidate class: net/java/games/util/plugins/Plugin.class
Examining file : net/java/games/util/plugins/PluginLoader.class
Examining file : net/java/games/util/plugins/Plugins.class
Examining file : net/java/games/util/plugins/test/ClassRenderer.class
Examining file : net/java/games/util/plugins/test/ListUpdater.class
Examining file : net/java/games/util/plugins/test/PluginTest.class
Examining file : net/java/games/util/Version.class


after 'continue':

1  
2  
mouse
buttons


the last two lines are from my for-loop printing the types.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 800
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #3 - Posted 2004-08-19 12:21:32 »

Running from the commandline gives the same output, not mentioning nor throwing an ArrayIndexOutOfBoundsException.

eclipse -> works, but requires to 'continue' after exception
commandline -> works.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline cfmdobbie

Senior Member


Medals: 1


Who, me?


« Reply #4 - Posted 2004-08-21 05:39:41 »

Eclipse is tripping into debug mode the moment it sees a problem developing.  There's an option in the preferences to change this - "Pause execution on Exception" or something.

That doesn't fix your problem, but it should explain the Eclipse/command line differences! Grin

Hellomynameis Charlie Dobbie.
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 800
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #5 - Posted 2004-08-22 10:33:45 »

Thanks, that 'fixed' it Smiley

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Grunnt (23 views)
2014-09-23 14:38:19

radar3301 (14 views)
2014-09-21 23:33:17

BurntPizza (31 views)
2014-09-21 02:42:18

BurntPizza (22 views)
2014-09-21 01:30:30

moogie (20 views)
2014-09-21 00:26:15

UprightPath (30 views)
2014-09-20 20:14:06

BurntPizza (34 views)
2014-09-19 03:14:18

Dwinin (48 views)
2014-09-12 09:08:26

Norakomi (75 views)
2014-09-10 13:57:51

TehJavaDev (108 views)
2014-09-10 06:39:09
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!