NetLogo / Python-Extension

Python extension for NetLogo
26 stars 15 forks source link

py extension crashes upon inititalisation on Netlogo 6.0.2 or 6.0.4 #13

Closed igornikolic closed 5 years ago

igornikolic commented 5 years ago

Latest version of py extension throws the following exception upon loading.

Greetings igor

java.lang.NoClassDefFoundError: org/json4s/jackson/JsonMethods$
 at org.nlogo.py.PythonExtension.runOnce(PythonExtension.scala:516)
 at org.nlogo.workspace.ExtensionManager.initializedClassManager(ExtensionManager.scala:202)
 at 
org.nlogo.workspace.ExtensionManager.$anonfun$importExtension$8(ExtensionManager.scala:165)
 at scala.Option.getOrElse(Option.scala:121)
 at org.nlogo.workspace.ExtensionManager.importExtension(ExtensionManager.scala:163)
 at org.nlogo.parse.StructureParser$.$anonfun$parsingWithExtensions$1(StructureParser.scala:71)
 at org.nlogo.parse.StructureParser$.$anonfun$parsingWithExtensions$1$adapted(StructureParser.scala:69)
 at scala.collection.immutable.List.foreach(List.scala:389)
 at org.nlogo.parse.StructureParser$.parsingWithExtensions(StructureParser.scala:69)
 at org.nlogo.parse.StructureParser$.parseSources(StructureParser.scala:35)
 at org.nlogo.parse.NetLogoParser.basicParse(NetLogoParser.scala:17)
 at org.nlogo.parse.NetLogoParser.basicParse$(NetLogoParser.scala:15)
 at org.nlogo.parse.FrontEnd$.basicParse(FrontEnd.scala:10)
 at org.nlogo.parse.FrontEndMain.frontEnd(FrontEnd.scala:26)
 at org.nlogo.parse.FrontEndMain.frontEnd$(FrontEnd.scala:25)
 at org.nlogo.parse.FrontEnd$.frontEnd(FrontEnd.scala:10)
 at org.nlogo.compile.CompilerMain$.compile(CompilerMain.scala:42)
 at org.nlogo.compile.Compiler.compileProgram(Compiler.scala:50)
 at org.nlogo.window.CompilerManager.compileProcedures(CompilerManager.scala:202)
 at org.nlogo.window.CompilerManager.compileAll(CompilerManager.scala:173)
 at org.nlogo.window.CompilerManager.handle(CompilerManager.scala:137)
 at org.nlogo.window.Events$CompileAllEvent.beHandledBy(Events.java:185)
 at org.nlogo.window.Event.doRaise(Event.java:198)
 at org.nlogo.window.Event.raise(Event.java:122)
 at org.nlogo.app.codetab.CodeTab.compile(CodeTab.scala:151)
 at org.nlogo.app.codetab.CodeTab$CompileAction$.actionPerformed(CodeTab.scala:186)
 at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
 at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
 at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
 at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
 at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
 at java.awt.Component.processMouseEvent(Component.java:6533)
 at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
 at java.awt.Component.processEvent(Component.java:6298)
 at java.awt.Container.processEvent(Container.java:2236)
 at java.awt.Component.dispatchEventImpl(Component.java:4889)
 at java.awt.Container.dispatchEventImpl(Container.java:2294)
 at java.awt.Component.dispatchEvent(Component.java:4711)
 at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
 at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
 at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
 at java.awt.Container.dispatchEventImpl(Container.java:2280)
 at java.awt.Window.dispatchEventImpl(Window.java:2746)
 at java.awt.Component.dispatchEvent(Component.java:4711)
 at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
 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:80)
 at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
 at java.awt.EventQueue$4.run(EventQueue.java:731)
 at java.awt.EventQueue$4.run(EventQueue.java:729)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
 at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
 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)
Caused by: java.lang.ClassNotFoundException: org.json4s.jackson.JsonMethods$
 at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
 at java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:814)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
 ... 62 more

NetLogo 6.0.2
main: org.nlogo.app.AppFrame
thread: AWT-EventQueue-0
Java HotSpot(TM) 64-Bit Server VM 1.8.0_141 (Oracle Corporation; 1.8.0_141-b15)
operating system: Linux 4.19.15-300.fc29.x86_64 (amd64 processor)
Scala version 2.12.2
JOGL: (3D View not initialized)
OpenGL Graphics: (3D View not initialized)
model: pytest

04:36:02.434 RemoveAllJobsEvent (org.nlogo.window.CompilerManager) AWT-EventQueue-0
04:36:02.434 CompileAllEvent (org.nlogo.app.codetab.MainCodeTab) AWT-EventQueue-0
04:35:50.639 RemoveAllJobsEvent (org.nlogo.window.CompilerManager) AWT-EventQueue-0
04:35:50.639 CompileAllEvent (org.nlogo.app.codetab.MainCodeTab) AWT-EventQueue-0
04:35:48.991 SwitchedTabsEvent (org.nlogo.app.Tabs) AWT-EventQueue-0
04:33:14.209 RemoveAllJobsEvent (org.nlogo.window.CompilerManager) AWT-EventQueue-0
04:33:14.185 LoadEndEvent (org.nlogo.window.ReconfigureWorkspaceUI$Loader (java.lang.Object)) AWT-EventQueue-0
04:33:14.184 ResizeViewEvent (org.nlogo.window.ViewWidget) AWT-EventQueue-0
04:33:14.183 ResizeViewEvent (org.nlogo.window.ViewWidget) AWT-EventQueue-0
04:33:14.183 LoadWidgetsEvent (org.nlogo.window.ReconfigureWorkspaceUI$Loader (java.lang.Object)) AWT-EventQueue-0
igornikolic commented 5 years ago

The installation instructions incorrect. The entire py directory from the compilation output should be copied into the netlogo extension directory, and not just the two files mentioned "If compilation succeeds, py.jar will be created. This file and pyext.py should then be placed in a folder named py in your NetLogo extensions directory."