Jython in a signed applet

I

Ike

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)
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top