jython problem

Mark Tompkins safetyfactorman at hotmail.com
Wed May 22 17:31:41 EDT 2002


I am having a problem using java jars.

The example is for jakarta-poi-1.5.0-FINAL-20020506.jar

1.  I renamed jakarta-poi-1.5.0-FINAL-20020506.jar to poi.jar.

2.  I modified registry, python path:

python.path = .;g:\\poi\\build\\poi.jar\\org\\apache\\poi

as per warning during installation.

3.  Run Jython, and see what happens:

C:\>jython
Jython 2.1 on java1.3.1 (JIT: null)
Type "copyright", "credits" or "license" for more information.
 >>> import org.apache.poi as poi
 >>> dir(poi)
['__name__', 'dev', 'hpsf', 'hssf', 'poifs', 'util']
 >>> dir(poi.hssf)
['__name__', 'dev', 'eventmodel', 'model', 'record', 'usermodel', 'util']
 >>> dir(poi.hssf.usermodel)
['HSSFCell', 'HSSFCellStyle', 'HSSFColorConstants', 'HSSFDataFormat', 
'HSSFDateUtil', 'HSSFErrorConstants', 'HSSFFont', 'HSSFRow', 
'HSSFSheet', 'HSSFWorkbook',
'__name__']
 >>> x=poi.hssf.usermodel.HSSFWorkbook()
Traceback (innermost last):
   File "<console>", line 1, in ?
AttributeError: java package 'org.apache.poi.hssf.usermodel' has no 
attribute 'HSSFWorkbook'
 >>>


Why is this failing?  Is there any way to fix it?  I have encountered 
the same problem with other jars.

If I import jdk standard libs, everything works fine.

??

thx

Mark




More information about the Python-list mailing list