473,666 Members | 2,010 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 NullPointerExce ption'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

PythonInterpret er inter_py; //class-scope variable

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

if(inter_py==nu ll){
try{

PythonInterpret er.initialize(S ystem.getProper ties(), System.getPrope rties(),
new String[] {""});
inter_py = new PythonInterpret er();
}catch(PyExcept ion pyex){
pyex.printStack Trace();
}catch(Exceptio n exc){
exc.printStackT race();
}
}
try{
inter_py.exec(b sTextArea.getTe xt());
}catch(PyExcept ion pyex){
pyex.printStack Trace();
}catch(Exceptio n exc){
exc.printStackT race();
}
java.lang.NullP ointerException
at org.python.core .PyJavaClass.lo okup()
at org.python.core .PyObject.<init >()
at org.python.core .PySingleton.<i nit>()
at org.python.core .PyNone.<init>( )
at org.python.core .PySystemState. initStaticField s()
at org.python.core .PySystemState. initialize()
at org.python.core .PySystemState. initialize()
at org.python.util .PythonInterpre ter.initialize( )
at GG.GGUser$10.ru n()
at java.awt.event. InvocationEvent .dispatch(Unkno wn Source)
at java.awt.EventQ ueue.dispatchEv ent(Unknown Source)
at java.awt.EventD ispatchThread.p umpOneEventForH ierarchy(Unknow n
Source)
at java.awt.EventD ispatchThread.p umpEventsForHie rarchy(Unknown Source)
at java.awt.EventD ispatchThread.p umpEvents(Unkno wn Source)
at java.awt.EventD ispatchThread.p umpEvents(Unkno wn Source)
at java.awt.EventD ispatchThread.r un(Unknown Source)
java.lang.NullP ointerException
at GG.GGUser$10.ru n()
at java.awt.event. InvocationEvent .dispatch(Unkno wn Source)
at java.awt.EventQ ueue.dispatchEv ent(Unknown Source)
at java.awt.EventD ispatchThread.p umpOneEventForH ierarchy(Unknow n
Source)
at java.awt.EventD ispatchThread.p umpEventsForHie rarchy(Unknown Source)
at java.awt.EventD ispatchThread.p umpEvents(Unkno wn Source)
at java.awt.EventD ispatchThread.p umpEvents(Unkno wn Source)
at java.awt.EventD ispatchThread.r un(Unknown Source)

Jul 18 '05 #1
0 1315

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

Similar topics

2
2252
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 paint(self, g): today = Date()
0
1422
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 message to the user if they're not there. You can't do "raise SystemExit" or "sys.exit(0)" because both of those try to kill the browser's Java VM, which a) raises a security exception and b) isn't what I want anyway.
1
1653
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
2821
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 client usage (and faster) than Swing, so what would be the advantage for using Jython? or Is Jython really just so that Java developers can write Java code faster? Mike Wimpe
2
2468
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 following means? I'm using JDK 1.5.0_09, under Win XP SP2. Runnnig the file " jython FILENAME" works, so I don't know what's happening. Any thoughts?
1
1500
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: <applet style="position:absolute;left:-1px" code="fileSaver.class" archive="SignedFileSaver.jar" width="1" height="1"></applet> this applet's jar is signed, and it requests to get file access privilages. the actual function is called from an...
2
1327
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. However, I don't know much Java, and, frankly, right now I don't feel much like learning it. I *am* pretty good at Python, however. It looks like Jython is for me. That said, I have two questions: (1) Am I thinking straight here? Or is there some...
3
2370
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 privileges I show a page telling them that the applet wont work unless they grant the applet privileges and give them a link back to the original page so that they can try again if they want to. But if they follow that link, nothing...
2
3874
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: jar:http://www.domain.com/secure-scripts/secure.jar!/thepage.html (sample) in browser (Firefox) which simply won't work. I can't access to html file embedded in jar file. My sample applet IO.java together
0
8445
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8356
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8871
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8781
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8640
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6198
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4369
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2011
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1776
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.