From: Rune H. <ro...@vi...> - 2001-07-26 11:33:30
|
I'm trying to create a (very) simple jython applet and theres obviously something I'm doing wrong. --applet code-- import urllib import re from java.applet import Applet from java import awt class simpleHttp(Applet): def __init__(self): self.setBackground(awt.Color.white) self.setLayout(awt.FlowLayout()) self.t1 = awt.TextField("",20) self.b1 = awt.Button("Get IP") self.add(self.t1) self.add(self.b1) def pageHandler(self,event): pagehandler = urllib.urlopen("http://someserver/cgi-bin/getIp.py") data = pagehandler.read(512) ipaddr = re.findall("\d+\.\d+\.\d+\.\d+",data) pagehandler.close() self.t1.setText(ipaddr[0]) --applet-- I proceed to compile with "jythonc -c -d -j simpleHttp.jar simpleHttp.py" and it compiles fine using both 2.0 and 2.1a2. When executed it however exits with:"java.lang.ExceptionInInitializerError: java.lang.ExceptionInInitializerError" when compiled with 2.0 and "java.lang.NoClassDefFoundError: java.lang.NoClassDefFoundError: org/python/util/PyMetaClass" when compiled with 2.1.a2. Rewritten without import urllib and re the applet compiles and runs with out errors. What am I not getting here? regards Rune Hansen run...@vi... Viventus AS Liaveien 11, 1411 Kolbotn +4766812280/86 "It's a damn poor mind that can only think of one way to spell a word." --Andrew Jackson |