469,609 Members | 1,657 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,609 developers. It's quick & easy.

Jython in a signed applet

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
0 1157

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by jennifer haynes | last post: by
reply views Thread by gcash | last post: by
1 post views Thread by Federico | last post: by
6 posts views Thread by Mike Wimpe | last post: by
2 posts views Thread by donkeyboy | last post: by
1 post views Thread by jindalily | last post: by
2 posts views Thread by Matt Bitten | last post: by
3 posts views Thread by Robert Larsen | last post: by
reply views Thread by Solution2021 | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.