Search code examples
repast-simphony

java - NSException error when running repast simphony from Eclipse


I am experiencing an error that prevents repast simphony from running when prompted from Eclipse. Instead of running a model when prompted, the window disappears and an error message appears within Eclipse.

The steps I've followed to this point on my Mac (for repast simphony setup) are:

1) Download a Java 8 JDK from Adopt Open JDK (since I need Java 8 to use repast 3D later). Copy the package to /Library/Java/JavaVirtualMachines.

2) Download Eclipse IDE for Eclipse Committers 2019-06 and put in Applications folder.

3) Install Groovy Eclipse 3.4.0 from the update site (https://dist.springsource.org/release/GRECLIPSE/3.4.0/e4.12), and install the Eclipse Groovy development tools and the Groovy compiler 2.4 from this link in Eclipse.

4) Install repast simphony 2.7.0 from https://repocafe.cels.anl.gov/repos/repast in Eclipse.

5) Set Groovy compiler to 2.4.17 in Eclipse.

6) Import repast examples

7) Select a demonstration model (e.g., GeoZombies) and try to run.

Once I complete step 7 above, I get several console warning messages:

WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by com.thoughtworks.xstream.core.util.Fields (file:/Applications/Eclipse.app/Contents/Eclipse/plugins/repast.simphony.runtime_2.7.0/lib/xstream-1.4.7.jar) to field java.util.TreeMap.comparator WARNING: Please consider reporting this to the maintainers of com.thoughtworks.xstream.core.util.Fields WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release

The Java window for repast simphony opens even though this error has appeared in the Eclipse console. However, when I click the button to "Start Run" in the Java window for GeoZombies, the Java window shuts with no warning, and the Eclipse console produces the following error:

2019-12-03 11:03:46.637 java[63571:533520] * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'NSWindow drag regions should only be invalidated on the Main Thread!' * First throw call stack: ( 0 CoreFoundation 0x00007fff3bab6acd __exceptionPreprocess + 256 1 libobjc.A.dylib 0x00007fff66193a17 objc_exception_throw + 48 2 CoreFoundation 0x00007fff3bad0629 -[NSException raise] + 9 3 AppKit 0x00007fff390765ca -[NSWindow(NSWindow_Theme) _postWindowNeedsToResetDragMarginsUnlessPostingDisabled] + 317 4 AppKit 0x00007fff390739f7 -[NSWindow _initContent:styleMask:backing:defer:contentView:] + 1479 5 AppKit 0x00007fff3907342a -[NSWindow initWithContentRect:styleMask:backing:defer:] + 45 6 libnativewindow_macosx.jnilib 0x0000000136bfdf9e Java_jogamp_nativewindow_macosx_OSXUtil_CreateNSWindow0 + 398 7 ??? 0x000000011e0f5c90 0x0 + 4799290512 ) libc++abi.dylib: terminating with uncaught exception of type NSException

I would appreciate any assistance someone can provide about how to resolve this error and get repast simphony working. Thank you.


Solution

  • This appeared to be an issue with letting Eclipse know which JRE to use. Navigating to Preferences -> Java -> Installed JREs, should show which JRE Eclipse is using and you can adjust to the appropriate version there. Currently Java 8 and Java 11 can be used. For more information on software requirements for Repast Simphony, see this page: https://repast.github.io/requirements.html