473,385 Members | 1,742 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 1301

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: jennifer haynes | last post by:
I can't Date() to print out in an applet this is what I have from java.util import Date from java import awt, applet from java.lang import String class Enhanced(applet.Applet): def...
0
by: gcash | last post by:
I've written an applet using Java3D for rendering, which works fine if you have Java3D installed, of course. What I want to do is try to import the Java3D libraries and bail with an error...
1
by: Federico | last post by:
Hi everybody, Someone knows where can I find an applet jython guide? I usually use python for my programming and now I'd like to make applets for web pages but I don't know java ... Thanks
6
by: Mike Wimpe | last post by:
Other than being used to wrap Java classes, what other real use is there for Jython being that Python has many other GUI toolkits available? Also, these toolkits like Tkinter are so much better for...
2
by: donkeyboy | last post by:
All, I've tried the jythonc compiler to try and create an applet to see how it works, but I get a number of Java compile errors that are way above my knowledge. Does anyone know what any of the...
1
by: jindalily | last post by:
Hey guys, I wasn't completely sure if this would be a Java or JS topic, but I thought it had more to do with Ajax and whatnot. Anyway, I have an embedded and signed Java applet on my page like so:...
2
by: Matt Bitten | last post by:
Hi, all. I'm in a situation where I need to be writing a bunch of quick-y (hopefully) self-contained programs that anyone can run from a web page. Java applets are the obvious way to do this....
3
by: Robert Larsen | last post by:
Hi all I have a small problem with a signed applet. The applet works fine but some users wont click 'yes' to give the applet further privileges (that is ok too). If the user dont give the applet...
2
by: JohnLorac | last post by:
Hello, I'm trying to load and write file on local disc drive using signed javascript file. But I have experienced problem running this url: ...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.