Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (405)
games submitted by our members
Games in WIP (289)
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 1514 times)
0 Members and 1 Guest are viewing this topic.
Online Riven
« League of Dukes »

JGO Overlord


Medals: 437
Projects: 4


Hand over your head.


« Posted 2004-08-19 13: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
Projects: Revenge of the Titans, Titan Attacks, Droid Assault, and Ultratron
Offline endolf
« League of Dukes »

JGO Coder


Medals: 4
Projects: 1


Current project release date: sometime in 3003


« Reply #1 - Posted 2004-08-19 13: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

Online Riven
« League of Dukes »

JGO Overlord


Medals: 437
Projects: 4


Hand over your head.


« Reply #2 - Posted 2004-08-19 14: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
Projects: Revenge of the Titans, Titan Attacks, Droid Assault, and Ultratron
Games published by our own members! Check 'em out!
Try the Free Demo of Droid Assault
Online Riven
« League of Dukes »

JGO Overlord


Medals: 437
Projects: 4


Hand over your head.


« Reply #3 - Posted 2004-08-19 14: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
Projects: Revenge of the Titans, Titan Attacks, Droid Assault, and Ultratron
Offline cfmdobbie

Senior Member




Who, me?


« Reply #4 - Posted 2004-08-21 07: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.
Online Riven
« League of Dukes »

JGO Overlord


Medals: 437
Projects: 4


Hand over your head.


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

Thanks, that 'fixed' it Smiley

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

Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars and Titan!

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

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (60 views)
2013-05-17 21:29:12

alaslipknot (69 views)
2013-05-16 21:24:48

gouessej (99 views)
2013-05-16 00:53:38

gouessej (96 views)
2013-05-16 00:17:58

theagentd (107 views)
2013-05-15 15:01:13

theagentd (98 views)
2013-05-15 15:00:54

StreetDoggy (144 views)
2013-05-14 15:56:26

kutucuk (166 views)
2013-05-12 17:10:36

kutucuk (165 views)
2013-05-12 15:36:09

UnluckyDevil (175 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
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!
Page created in 0.447 seconds with 22 queries.