By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,313 Members | 1,113 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,313 IT Pros & Developers. It's quick & easy.

Jython in a signed applet

P: n/a
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.pumpOneEventForHierar chy(Unknown
Source)
at java.awt.EventDispatchThread.pumpEventsForHierarch y(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.pumpOneEventForHierar chy(Unknown
Source)
at java.awt.EventDispatchThread.pumpEventsForHierarch y(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

Jul 18 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.