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

2017/2/9

Greenfoot 3.1 error loading project

MrBradley MrBradley

2017/2/9

#
Just started using Greenfoot 3.1 and updating a current project worked ok for a bit, then: (I know its new, not a panic, but any help would be appreciated) === debug log === Greenfoot run started: Wed Feb 08 17:04:14 MST 2017 Greenfoot version: 3.1.0 Java version 1.8.0_111 Virtual machine: Java HotSpot(TM) 64-Bit Server VM 25.111-b14 (Oracle Corporation) Running on: Windows 10 10.0 (amd64) Java Home: D:\Program Files\Java\jdk1.8.0_111\jre ---- Opening project: D:\Users\Richard\Documents\Java\Greenfoot\greenfoot31\scenarios\java\RickyTheRobot Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: bluej.parser.nodes.ContainerNode cannot be cast to bluej.parser.nodes.MethodNode at bluej.parser.EditorParser.endMethodDecl(EditorParser.java:1018) at bluej.parser.JavaParser.parseMethodParamsBody(JavaParser.java:1310) at bluej.parser.JavaParser.parseClassElement(JavaParser.java:1226) at bluej.parser.JavaParser.parseClassBody(JavaParser.java:1100) at bluej.parser.JavaParser.parseTypeBody(JavaParser.java:833) at bluej.parser.JavaParser.parseTypeDef(JavaParser.java:814) at bluej.parser.JavaParser.parseCUpart(JavaParser.java:648) at bluej.parser.JavaParser.parseCU(JavaParser.java:624) at bluej.parser.JavaParser.parseCU(JavaParser.java:154) at bluej.parser.EditorParser.parseCU(EditorParser.java:179) at bluej.parser.InfoParser.parse(InfoParser.java:194) at bluej.parser.InfoParser.parseWithPkg(InfoParser.java:176) at bluej.pkgmgr.SourceInfo.getInfo(SourceInfo.java:58) at bluej.pkgmgr.target.ClassTarget.analyseSource(ClassTarget.java:1572) at bluej.pkgmgr.Package.refreshPackage(Package.java:839) at bluej.pkgmgr.Project.<init>(Project.java:300) at bluej.pkgmgr.Project.openProject(Project.java:504) at bluej.Main.processArgs(Main.java:183) at bluej.Main.lambda$null$0(Main.java:127) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756) at java.awt.EventQueue.access$500(EventQueue.java:97) at java.awt.EventQueue$3.run(EventQueue.java:709) at java.awt.EventQueue$3.run(EventQueue.java:703) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76) at java.awt.EventQueue.dispatchEvent(EventQueue.java:726) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
davmac davmac

2017/2/10

#
Do you still have the scenario in the state where this problem triggered? It would be very helpful if I could get a copy of it (send it to support@greenfoot.org). (By the way, it is generally better to send reports of technical problems via email - they may get missed if posted here on the forum).
MrBradley MrBradley

2017/2/25

#
I do, I have tried it on a clean computer and I still get the error. I was hoping to move all of our school classes over to the new Greenfoot version, but since we make extensive use of a few scenarios I have decided to postpone the transition. I have an approach that will isolate the issue, but I will need the time to walk through the steps. I probably won't get around to it until summer break, and will try to use GF 3.1 at the start of the new school year. It might be fixed by then. If not I will get a copy of the latest version & source and trace the Exception stack. I will keep support posted. In the meantime I have a few related questions: 1) how can I track the issues that are coming up with GF 3.1? 2) is there documentation on the project.greenfoot file? 3) how can you restore a lost or corrupted project file? (Can GF rebuild the project file from inspecting the source files?) Thanks.
davmac davmac

2017/2/25

#
1) how can I track the issues that are coming up with GF 3.1?
Check the issue tracker (Jira). If you want to see all issues, including those that have already been fixed for the next release, filter by "all issues" rather than "open issues" and add a filter (first click "view all versions and filters") for "fix version" which includes both "no version" and "unreleased versions". (This link should do that for you, I hope).
2) is there documentation on the project.greenfoot file?
No, but it's a simple key-value store in a textual format.
3) how can you restore a lost or corrupted project file? (Can GF rebuild the project file from inspecting the source files?)
It should be able to, if you create an empty file first (so that it recognizes the folder as being a Greenfoot project). This hasn't necessarily been tested by us recently.
MrBradley MrBradley

2017/3/13

#
Dave, it looks like the error originates from an error in java source files. The BlueJ editor seems to have problems loading a java source file if it contains an error. What seemed to happen was that a source file I was editing was saved but not compiled. Then when I retied to reopen the project ... the exception. I hope this helps. Please let me know if you can confirm this. Mr Bradley
davmac davmac

2017/3/24

#
Sorry for the delay, this issue slipped my mind. I cannot reproduce the problem. BlueJ source files seem to be loaded fine if they contain an error. I think that the source is in some state that the BlueJ parser is not handling correctly, which is causing both problems. Again - it would be great if I could get a copy of that source code! Thanks.
MrBradley MrBradley

2017/3/25

#
Dave, I know the source would be a great help and when I get a block of time to package it up and sent it I will. I tested the compiler errors in source files again, and can confirm it is an issue - maybe not the same one, but still. What I see now is the following: Open a scenario with a source file with a few errors and dependencies on other classes. Try to open a source file for editing, and the JRE hangs. If you use Task Manager to end the Java VM, the following occurs: The JVM is terminated and with it the Greenfoot scenario window. New JVMs are launched with the same Greenfoot scenario window as well as the BlueJ editor. This behaviour only occurs when you open a scenario with syntax or package/import errors. Regards, Richard P.S. I am now at least using GF 3.1
You need to login to post a reply.