From: Johannes E. <joh...@eb...> - 2003-02-25 16:54:47
|
Hello all, I would like to use the Java Grasshopper agents platform (www.grasshopper.de) together with Jython. If you start Grasshopper then you can launch/create/start agents from a separate application. I would like to rewrite this application in JPython (it is in Java at the moment). In order to control the agency from the separate application you must create an agency proxy. For this you need the address of the agency which is a GrasshopperAddress object. So the first thing I have to do is to create this GrasshopperAddress object. This is strait forward: agencyAddress = GrasshopperAddress("socket://localhost:7000/Eble/EvaluationArea") After I try this line in the Jython console I get a null pointer exception: Traceback (innermost last): File "<stdin>", line 1, in ? java.lang.NullPointerException at org.python.core.PyJavaClass.setConstructors(PyJavaClass.java) at org.python.core.PyJavaClass.initConstructors(PyJavaClass.java) at org.python.core.PyJavaClass.__call__(PyJavaClass.java) at org.python.core.PyObject.__call__(PyObject.java) at org.python.pycode._pyx134.f$0(<stdin>:1) at org.python.pycode._pyx134.call_function(<stdin>) at org.python.core.PyTableCode.call(PyTableCode.java) at org.python.core.PyCode.call(PyCode.java) at org.python.core.Py.runCode(Py.java) at org.python.core.Py.exec(Py.java) at org.python.util.PythonInterpreter.exec(PythonInterpreter.java) at org.python.util.InteractiveInterpreter.runcode(InteractiveInterpreter.java) at org.python.util.InteractiveInterpreter.runsource(InteractiveInterpreter.java ) at org.python.util.InteractiveInterpreter.runsource(InteractiveInterpreter.java ) at jbjython.ConsolePanel$FrameConsoleInterpreter.process(Unknown Source) at jbjython.ConsolePanel.textField_actionPerformed(Unknown Source) at jbjython.ConsolePanel.access$000(Unknown Source) at jbjython.ConsolePanel$1.actionPerformed(Unknown Source) at javax.swing.JTextField.fireActionPerformed(JTextField.java:421) at javax.swing.JTextField.postActionEvent(JTextField.java:586) at javax.swing.JTextField$NotifyAction.actionPerformed(JTextField.java:696) at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1702) at javax.swing.JComponent.processKeyBinding(JComponent.java:2156) at javax.swing.JComponent.processKeyBindings(JComponent.java:2182) at javax.swing.JComponent.processKeyEvent(JComponent.java:2119) at java.awt.Component.processEvent(Component.java:3555) at java.awt.Container.processEvent(Container.java:1167) at java.awt.Component.dispatchEventImpl(Component.java:2595) at java.awt.Container.dispatchEventImpl(Container.java:1216) at java.awt.Component.dispatchEvent(Component.java:2499) at java.awt.LightweightDispatcher.processKeyEvent(Container.java:2162) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2142) at java.awt.Container.dispatchEventImpl(Container.java:1203) at java.awt.Window.dispatchEventImpl(Window.java:918) at java.awt.Component.dispatchEvent(Component.java:2499) at java.awt.EventQueue.dispatchEvent(EventQueue.java:336) at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.ja va:134) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java :101) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:96) at java.awt.EventDispatchThread.run(EventDispatchThread.java:88) Could this have to do with Jython? As you may realize from the exceptions, I use Jython with JBJython from JBuilder, but it seems to me that the exception occurs earlier, in Jython. I have tested JBJython with a small Java test package and it seems to work fine. Any help would be great. |