This site requires JavaScript, please enable it in your browser!
Greenfoot back
GrimCreeper312
GrimCreeper312 wrote ...

2013/5/7

Help Please

GrimCreeper312 GrimCreeper312

2013/5/7

#
When i open my scenario it gives me this error and i can run it but i can't edit any of the classes. the error:
java.lang.ArrayIndexOutOfBoundsException: -1
	at java.util.ArrayList.elementData(ArrayList.java:371)
	at java.util.ArrayList.get(ArrayList.java:384)
	at com.sun.imageio.plugins.jpeg.JPEGImageReader.checkTablesOnly(JPEGImageReader.java:326)
	at com.sun.imageio.plugins.jpeg.JPEGImageReader.gotoImage(JPEGImageReader.java:427)
	at com.sun.imageio.plugins.jpeg.JPEGImageReader.readHeader(JPEGImageReader.java:543)
	at com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(JPEGImageReader.java:986)
	at com.sun.imageio.plugins.jpeg.JPEGImageReader.read(JPEGImageReader.java:966)
	at javax.imageio.ImageIO.read(ImageIO.java:1448)
	at javax.imageio.ImageIO.read(ImageIO.java:1400)
	at greenfoot.util.GraphicsUtilities.loadCompatibleTranslucentImage(GraphicsUtilities.java:224)
	at greenfoot.GreenfootImage.loadURL(GreenfootImage.java:268)
	at greenfoot.GreenfootImage.loadFile(GreenfootImage.java:295)
	at greenfoot.GreenfootImage.<init>(GreenfootImage.java:109)
	at greenfoot.util.GreenfootUtil.getGreenfootImage(GreenfootUtil.java:797)
	at greenfoot.core.ProjectProperties.getImage(ProjectProperties.java:269)
	at greenfoot.gui.classbrowser.role.ImageClassRole.getClassThatHasImage(ImageClassRole.java:98)
	at greenfoot.gui.classbrowser.role.ImageClassRole.getGreenfootImage(ImageClassRole.java:109)
	at greenfoot.gui.classbrowser.role.ImageClassRole.getImage(ImageClassRole.java:80)
	at greenfoot.gui.classbrowser.role.ImageClassRole.changeImage(ImageClassRole.java:156)
	at greenfoot.gui.classbrowser.role.ImageClassRole.buildUI(ImageClassRole.java:63)
	at greenfoot.gui.classbrowser.ClassView.update(ClassView.java:188)
	at greenfoot.gui.classbrowser.ClassView.init(ClassView.java:143)
	at greenfoot.gui.classbrowser.ClassView.<init>(ClassView.java:73)
	at greenfoot.gui.GreenfootFrame.populateClassBrowser(GreenfootFrame.java:608)
	at greenfoot.gui.GreenfootFrame.openProject(GreenfootFrame.java:326)
	at greenfoot.core.GreenfootMain$2.run(GreenfootMain.java:211)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:721)
	at java.awt.EventQueue.access$200(EventQueue.java:103)
	at java.awt.EventQueue$3.run(EventQueue.java:682)
	at java.awt.EventQueue$3.run(EventQueue.java:680)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:691)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
Kartoffelbrot Kartoffelbrot

2013/5/7

#
This can be from a few things, but it looks like, that you want to save or load something in an array on a place that doesn't exist in it.
Gevater_Tod4711 Gevater_Tod4711

2013/5/7

#
The error says that you are trying to acces a field with the number -1 of a java.util.ArrayList. But this seems to occour because of a GreenfootImage that can't be initialised because of an error in this class com.sun.imageio.plugins.jpeg.JPEGImageReader.checkTablesOnly. Hmm this realy seams strange to me because the class is designed by sun so you can't have changed it. And this error doesn't occour always although everyone has to use this class while starting Greenfoot. Maybe the Greenfoot Team knows about this error.
Kartoffelbrot Kartoffelbrot

2013/5/7

#
Or you triy to reinstall it, but I don't know, if that will help.
danpost danpost

2013/5/7

#
Have you updated to the latest version of Greenfoot?
davmac davmac

2013/5/7

#
It looks like you have a (possibly corrupted) JPeg image file in your scenario, which the Java runtime can't handle. If you haven't already tried, perhaps upgrading to the latest Java JDK will help (don't forget to either uninstall the old JDK, or run the "select VM" utility that comes with Greenfoot). Otherwise, try just removing the .jpg files from your scenario one by one, until the problem goes away. That way you can figure out which image is problematic.
GrimCreeper312 GrimCreeper312

2013/5/10

#
it was a corrupt png file
You need to login to post a reply.