Jython in a signed applet

Discussion in 'Python' started by Ike, Jun 6, 2004.

  1. Ike

    Ike Guest

    I have a signed JApplet which has a JTextArea wherein one can put Jython
    Script. Upon clicking a JButton, the script is executed. The script which
    executes to code is listed below.

    If I run the Applet in an AppletViewer, it runs fine. However, when run in a
    web browser, I am getting NullPointerException's (I copy-pasted from the
    Java Console these Exceptions). Please Note, I AM including jython.jar in
    the ARCHIVE parameter of the HTML containing the JApplet.

    Anyone have any idea why I cannot get this to run in a signed applet? Does
    anyone execute script in a signed applet - would you be willing to show me
    how to call this from Java, and what the Applet tag looks like that works
    for you? Thanks, Ike

    PythonInterpreter inter_py; //class-scope variable

    //the following occurs in the ActionListnener when the
    JButton is clicked

    if(inter_py==null){
    try{

    PythonInterpreter.initialize(System.getProperties(), System.getProperties(),
    new String[] {""});
    inter_py = new PythonInterpreter();
    }catch(PyException pyex){
    pyex.printStackTrace();
    }catch(Exception exc){
    exc.printStackTrace();
    }
    }
    try{
    inter_py.exec(bsTextArea.getText());
    }catch(PyException pyex){
    pyex.printStackTrace();
    }catch(Exception exc){
    exc.printStackTrace();
    }


    java.lang.NullPointerException
    at org.python.core.PyJavaClass.lookup()
    at org.python.core.PyObject.<init>()
    at org.python.core.PySingleton.<init>()
    at org.python.core.PyNone.<init>()
    at org.python.core.PySystemState.initStaticFields()
    at org.python.core.PySystemState.initialize()
    at org.python.core.PySystemState.initialize()
    at org.python.util.PythonInterpreter.initialize()
    at GG.GGUser$10.run()
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown
    Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
    java.lang.NullPointerException
    at GG.GGUser$10.run()
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown
    Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
    Ike, Jun 6, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David McNab
    Replies:
    0
    Views:
    485
    David McNab
    Apr 9, 2004
  2. Divya Prakash
    Replies:
    0
    Views:
    429
    Divya Prakash
    Dec 19, 2006
  3. kyrpa83
    Replies:
    1
    Views:
    616
    kyrpa83
    Oct 17, 2007
  4. Pinegar, Kent T

    FW: [Jython-users] Jython Licensing Question

    Pinegar, Kent T, Jul 24, 2008, in forum: Python
    Replies:
    0
    Views:
    346
    Pinegar, Kent T
    Jul 24, 2008
  5. Rob1bureau
    Replies:
    1
    Views:
    799
    joris
    Feb 27, 2010
Loading...

Share This Page