Steve Langer wrote a good article concerning this issue...you may want to take a look at it.

http://wiki.python.org/jython/JythonMonthly/Articles/January2007/3

Good luck, and take care!

--
Josh Juneau
juneau001@gmail.com
http://jj-blogger.blogspot.com

On Jan 28, 2008 8:16 PM, Mico Siahaan <mico@cbn.net.id> wrote:
Dear all,

I am new to jython. Before learn jython, I was and am
still python user :).
I read that jython can use java class.
My questions: is there any limitation of jython in
using java class? C
an jython use any java classes?

I tried to do this (sorry it would be long posting):
>>> from java.util import Iterator, List
>>> from javax.xml.transform import
TransformerException
>>> import sys
>>>
sys.path.append('D:\\project\\jsword-1.0.7\\jsword-1.0.7.jar')
>>>
sys.path.append('D:\\project\\jsword-1.0.7\\jsword-common-1.0.7.jar')
>>> from org.crosswire.common.util import NetUtil,
ResourceUtil
>>> from org.crosswire.common.xml import Converter,
SAXEventProvider, Transformi
ngSAXEventProvider, XMLUtil
>>> from org.crosswire.jsword.book import Book,
BookData, BookException, BookFil
ter, BookFilters, BookMetaData, Books, BooksEvent,
BooksListener, OSISUtil
>>> from org.crosswire.jsword.index.search import
DefaultSearchModifier, Default
SearchRequest
>>> from org.crosswire.jsword.passage import Key,
NoSuchKeyException, Passage, P
assageTally, RestrictionType, Verse
>>> from org.crosswire.jsword.util import
ConverterFactory
>>> from org.crosswire.jsword.versification import
BibleInfo
>>> from org.xml.sax import SAXException
>>> BIBLE_NAME = "ISV"
>>> bible = Books.installed().getBook(BIBLE_NAME)
Logging configuration class
"org.crosswire.common.util.LogConfig" failed
java.lang.ClassNotFoundException:
org.crosswire.common.util.LogConfig
Jan 26, 2008 9:54:28 AM
org.crosswire.common.util.MsgBase loadResources
INFO: Assuming key is the default message
org.crosswire.common.util.Msg: CallCon
text.Security
Jan 26, 2008 9:54:29 AM
org.crosswire.common.util.MsgBase loadResources
INFO: Assuming key is the default message
org.crosswire.common.util.Msg: EventLi
stenerList.WrongType
Jan 26, 2008 9:54:29 AM
org.crosswire.common.util.MsgBase loadResources
INFO: Assuming key is the default message
org.crosswire.common.util.Msg: LucidEx
ception.Reason
Jan 26, 2008 9:54:29 AM
org.crosswire.common.util.MsgBase loadResources
INFO: Assuming key is the default message
org.crosswire.common.util.Msg: NetUtil
.CantStrip
Jan 26, 2008 9:54:29 AM
org.crosswire.common.util.MsgBase loadResources
INFO: Assuming key is the default message
org.crosswire.common.util.Msg: NetUtil
.CreateDirFail
Jan 26, 2008 9:54:29 AM
org.crosswire.common.util.MsgBase loadResources
INFO: Assuming key is the default message
org.crosswire.common.util.Msg: NetUtil
.CreateFileFail
Jan 26, 2008 9:54:29 AM
org.crosswire.common.util.MsgBase loadResources
INFO: Assuming key is the default message
org.crosswire.common.util.Msg: NetUtil
.IsDir
Jan 26, 2008 9:54:29 AM
org.crosswire.common.util.MsgBase loadResources
INFO: Assuming key is the default message
org.crosswire.common.util.Msg: NetUtil
.IsFile
Jan 26, 2008 9:54:29 AM
org.crosswire.common.util.MsgBase loadResources
INFO: Assuming key is the default message
org.crosswire.common.util.Msg: NetUtil
.NotDir
Jan 26, 2008 9:54:29 AM
org.crosswire.common.util.MsgBase loadResources
INFO: Assuming key is the default message
org.crosswire.common.util.Msg: NetUtil
.NotFileURI
Jan 26, 2008 9:54:29 AM
org.crosswire.common.util.MsgBase loadResources
INFO: Assuming key is the default message
org.crosswire.common.util.Msg: Resourc
eUtil.NoResource
Jan 26, 2008 9:54:29 AM
org.crosswire.common.util.MsgBase loadResources
INFO: Assuming key is the default message
org.crosswire.common.util.Msg: Resourc
eUtil.NotAssignable
Jan 26, 2008 9:54:29 AM
org.crosswire.common.util.MsgBase loadResources
INFO: Assuming key is the default message
org.crosswire.common.util.Msg: WebReso
urce.MissingFile
Jan 26, 2008 9:54:29 AM
org.crosswire.common.util.MsgBase loadResources
INFO: Assuming key is the default message
org.crosswire.common.util.Msg: Reporte
r.Unexpected
Traceback (innermost last):
 File "<console>", line 1, in ?
       at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
       at
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown
Source)
       at
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)
       at java.lang.reflect.Method.invoke(Unknown
Source)

java.lang.ExceptionInInitializerError:
java.lang.ExceptionInInitializerError
>>> books = Books.installed()
Traceback (innermost last):
 File "<console>", line 1, in ?
       at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
       at
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown
Source)
       at
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)
       at java.lang.reflect.Method.invoke(Unknown
Source)

java.lang.NoClassDefFoundError:
java.lang.NoClassDefFoundError: Could not initia
lize class org.crosswire.jsword.book.Books
>>> dir()
['BIBLE_NAME', 'BibleInfo', 'Book', 'BookData',
'BookException', 'BookFilter', '
BookFilters', 'BookMetaData', 'Books', 'BooksEvent',
'BooksListener', 'Converter
', 'ConverterFactory', 'DefaultSearchModifier',
'DefaultSearchRequest', 'Iterato
r', 'Key', 'List', 'NetUtil', 'NoSuchKeyException',
'OSISUtil', 'Passage', 'Pass
ageTally', 'ResourceUtil', 'RestrictionType',
'SAXEventProvider', 'SAXException'
, 'TransformerException',
'TransformingSAXEventProvider', 'URL', 'Verse', 'XMLUt
il', '__doc__', '__name__', 'sys']
>>> dir(Books)
['addBook', 'bookAdded', 'bookRemoved',
'booksListener', 'drivers', 'getBook', '
getBooks', 'getDrivers', 'getDriversByClass',
'getWritableDrivers', 'installed',
 'registerDriver', 'removeBook', 'unregisterDriver',
'writableDrivers']
>>> books = Books()
Traceback (innermost last):
 File "<console>", line 1, in ?
TypeError: no public constructors for
org.crosswire.jsword.book.Books

So I was stuck. :( Please explain to me what went
wrong and what shall I do?


Mico Siahaan
-------------
My blog: http://www.tentangmico.info
My python blog: http://python.tentangmico.info


     ____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Jython-users mailing list
Jython-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users