jython and java exceptions

Alan Kennedy alanmk at hotmail.com
Thu Aug 12 15:00:40 CEST 2004


[Jan Gregor]
> All tests passed ok, but problem is still there. I didn't mentioned that
> mysql works fine.
> 
> My system is debian, something between woody and testing version. At
> home I have similiar debian upgraded moved so far from  potato to woody
> to sarge - same behaviour.
> 
> Application runs from command line by 'jython TextConsole.py'. Jython is
> version 2.1, running on java 1.4.2_05 (at home 1.4.1). PostgreSQL
> (7.4.3) and jdbc driver (as jython) from debian testing distribution.

I have one more thing to suggest, and that only applies if you are
"embedding", i.e. calling jython created classes from java, as opposed
to calling java classes from jython.

If you are embedding, then you are initializing the jython runtime
yourself, as opposed to having jython do that for you. In these cases,
names of java packages are not always picked up from the jython package
cache (although the class definitions are picked up if the jar is
present on the classpath).

Try adding a line like this to the top of your jython module

import sys ; sys.add_package('com.sybase.jdbc2.jdbc')

This can also be done outside jython, in the java embedding environment,
through a PySystemState object, as described here

http://sourceforge.net/mailarchive/forum.php?thread_id=3747282&forum_id=5586

If that doesn't help, I'm afraid I'll be too busy for the next few days
to help out, though there are other people here who might be able to
contribute.

The day I've been waiting for for 7 years has finally arrived: proof
that the US retail milk supply is contaminated with a bacterium known as
Mycobacterium avium subspecies paratuberculosis. I expect to be very
busy with this, especially if the US media reacts to the story the same
way that the British and Irish media did. If you see an article on
paratuberculosis and Crohn's Disease in the media in the next few days,
you'll be happy to know that python is an essential part of the
management of two of the main related web sites: www.crohns.org and
www.paratuberculosis.org

More info on paratuberculosis in US retail food from

http://www.johnes.org/newsfiles/109216471862392.html

my-world-is-tumbling-ly y'rs

-- 
alan kennedy
------------------------------------------------------
email alan:              http://xhaus.com/contact/alan



More information about the Python-list mailing list