Can't find the source of an exception in Java

Posted by Invader Zim on Stack Overflow See other posts from Stack Overflow or by Invader Zim
Published on 2012-10-25T10:26:41Z Indexed on 2012/10/25 11:00 UTC
Read the original article Hit count: 385

Filed under:
|
|

Basically an exception is being thrown and I can't find the reason. Here is what I get on the console:

Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 0
    at org.apache.batik.gvt.renderer.StrokingTextPainter.computeTextRuns(Unknown Source)
    at org.apache.batik.gvt.renderer.StrokingTextPainter.getTextRuns(Unknown Source)
    at org.apache.batik.gvt.renderer.StrokingTextPainter.getOutline(Unknown Source)
    at org.apache.batik.gvt.renderer.BasicTextPainter.getGeometryBounds(Unknown Source)
    at org.apache.batik.gvt.TextNode.getGeometryBounds(Unknown Source)
    at org.apache.batik.gvt.TextNode.getSensitiveBounds(Unknown Source)
    at org.apache.batik.gvt.AbstractGraphicsNode.getTransformedSensitiveBounds(Unknown Source)
    at org.apache.batik.gvt.CompositeGraphicsNode.getSensitiveBounds(Unknown Source)
    at org.apache.batik.gvt.CompositeGraphicsNode.getTransformedSensitiveBounds(Unknown Source)
    at org.apache.batik.gvt.CompositeGraphicsNode.getSensitiveBounds(Unknown Source)
    at org.apache.batik.gvt.CompositeGraphicsNode.getTransformedSensitiveBounds(Unknown Source)
    at org.apache.batik.gvt.CompositeGraphicsNode.getSensitiveBounds(Unknown Source)
    at org.apache.batik.gvt.CompositeGraphicsNode.getTransformedSensitiveBounds(Unknown Source)
    at org.apache.batik.gvt.CompositeGraphicsNode.getSensitiveBounds(Unknown Source)
    at org.apache.batik.gvt.CompositeGraphicsNode.nodeHitAt(Unknown Source)
    at org.apache.batik.gvt.event.AbstractAWTEventDispatcher.dispatchMouseEvent(Unknown Source)
    at org.apache.batik.gvt.event.AbstractAWTEventDispatcher.dispatchEvent(Unknown Source)
    at org.apache.batik.gvt.event.AWTEventDispatcher.dispatchEvent(Unknown Source)
    at org.apache.batik.gvt.event.AbstractAWTEventDispatcher.mouseEntered(Unknown Source)
    at org.apache.batik.swing.gvt.AbstractJGVTComponent$Listener.dispatchMouseEntered(Unknown Source)
    at org.apache.batik.swing.svg.AbstractJSVGComponent$SVGListener.dispatchMouseEntered(Unknown Source)
    at org.apache.batik.swing.gvt.AbstractJGVTComponent$Listener.mouseEntered(Unknown Source)
    at java.awt.AWTEventMulticaster.mouseEntered(Unknown Source)
    at java.awt.AWTEventMulticaster.mouseEntered(Unknown Source)
    at java.awt.Component.processMouseEvent(Unknown Source)
    at javax.swing.JComponent.processMouseEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.trackMouseEnterExit(Unknown Source)
    at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$400(Unknown Source)
    at java.awt.EventQueue$2.run(Unknown Source)
    at java.awt.EventQueue$2.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)

It is obviously from a batik lib that I use to paint SVG files, but I made sure that nothing is painted until the document is loaded, ready and showing on screen. When thrown nothing is painted.

Another interesting thing is the timing of the throwing. I am unable to find any logical patern, as sometimes it is thrown as soon as I initiate the class and sometimes it needs more then five minutes. In addition to this, as far as I tested there is no single action that calls repaint() that triggers it or rather all do.

I am new to Java and all the other exceptions had the class and row number of where they were thrown so I don't know what to do here.

Any suggestions would be greatly appreciated.

The code is enormous so I'll put just the paint method and if anything additional is needed please say so.

@Override
    public void paint(Graphics g) {
        if(documentLoaded && showingOnScreen){
            try{
                rad = (int)(radInit+zoom*faktorRad); //max rad = 20
                super.paint(g);


                Graphics2D g2d = (Graphics2D) g;
                paintElements(g2d);

            }
            catch(NullPointerException nulle){

            }
        }
    } 

edit: There is no array in my class so i can't check any index. I think that this exception is thrown from a library I use, but it's a .jar file and I don't know how to open it.

© Stack Overflow or respective owner

Related posts about java

Related posts about exception