From: <sp...@is...> - 2001-11-23 10:24:57
|
> At first you did use the wrong list. jython-dev is for development of=20= > jython > itself, your question belongs into jython-user. Secondly, you should=20= > mention > which jython and java versions you are using more prominently. It is = an > important information in order to assess your problem. Thanks for answering :) I was quite desperate as nobody has answered my=20= previous posts on jython-users, and it is not the first time it=20 happens.. So I did not found any alternative to direct posting to=20 jython-dev... I mentioned (in PS) that I was using jython-2.1a3, my=20 current JDK is MacOS X JDK 1.3.1- I have now switched to jython 2.0 > Did you look in jython-user archives? Perhaps somebody has had the = same=20 > problem. Yes, but I have not found anything... It's hard to make a query on that. > Are the classes java or jython classes? Are the files in the classpath=20= > or in > python.path resp.? If they are used from jython classes, did you=20 > compile your > program with jythonc with correct classpath set? The files are Java compiled files put in a jar. The sys-package-manager=20= finds the jar so this should be ok. As I said I can make a dir() on the=20= package name and it lists me the actual content of the package, but it=20= tells me this attribute error telling there is no Application attribute=20= in the package. The class is public, this is not a protection problem. After some experiment, putting my jar in /Library/Java/Extensions which=20= is the jre/lib/ext equivalent and starting jython interpreter I was able=20= to do : Jython 2.0 on java1.3.1 (JIT: null) Type "copyright", "credits" or "license" for more information. >>> import net.sourceforge.spedit.app >>> net.sourceforge.spedit.app.Application() >>> ...everything went fine (note: I switched back to jython 2 to see if the problem was still = there) Afterwards I tried another way, removing my package from the Extensions=20= and starting the jython interpreter with -cp SPEdit.jar, which is the=20= package containing my classes. So I made the following: Jython 2.0 on java1.3.1 (JIT: null) Type "copyright", "credits" or "license" for more information. >>> import net.sourceforge.spedit.app >>> net.sourceforge.spedit.app.Application() Traceback (innermost last): File "<console>", line 1, in ? AttributeError: java package 'net.sourceforge.spedit.app' has no=20 attribute 'Application' This puzzles me really, because as I said: >>> dir(net.sourceforge.spedit.app) ['Application', 'AuthorDisplay', 'DBView', 'NavigationTree', '__name__'] So jython actually knows the package.. Any clues? Cheers, -- S=E9bastien. |