Stuck on Jythonc --all w/ ZipException PyMethod

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mitch Amiano

    #1

    Stuck on Jythonc --all w/ ZipException PyMethod

    I'm getting started working with Jython (hope this is an ok group for
    the question), and ran into a stumbling block using the jythonc tool.

    It is a fairly simple Jython script which uses the Apache Batik SVG
    library, imports the SVG Canvas, and puts up a simple Swing interface to
    let the user load and display an SVG file. (I translated the script from
    a Batik Java example.) The script runs fine under jython, but so far
    I've been unable to get a working jar file using jythonc.

    After various problems involving CLASSPATH and the registry (protected
    members not showing up), it is persistently giving a ZipException:
    Duplicate entry error on the PyMethod class. Altering the CLASSPATH
    seems to have no effect on the problem.

    Is this a problem between jythonc and newer jvms? I've also tried with
    j2sdk 1.4.2_05, with the same results.

    I've exhausted other means, and at my wits end.
    Thanks in advance for any pointers.



    My command line is:

    C:\jython-2.1\jythonc.bat --compiler C:\jdk1.5.0_01\ bin\javac.exe --all
    -j usebatik.jar usebatik.py


    The output is:

    processing usebatik

    Required packages:
    javax.swing
    org.w3c.dom
    java.awt.event
    java.lang
    java.io
    org.apache

    Creating adapters:
    java.awt.event. ActionListener used in usebatik

    Creating .java files:
    usebatik module

    Compiling .java to .class...
    Compiling with args: ['C:\\jdk1.5.0_0 1\\bin\\javac.e xe', '-classpath',
    'C:\\jython-2.1\\jython.jar ;;.\\jpywork;;C :\\jython-2.1\\Tools\\jyt honc;C:\\Docume nts
    and Settings\\Value d
    Customer\\Deskt op\\Grazer\\use batik\\.;C:\\jy thon-2.1\\Lib;C:\\jy thon-2.1',
    '.\\jpywork\\us ebatik.java']
    0 Note: * uses or overrides a deprecated API.
    Note: Recompile with -Xlint:deprecati on for details.
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.

    Building archive: usebatik.jar
    Tracking java dependencies:

    Traceback (innermost last):
    File "C:\jython-2.1\Tools\jytho nc\jythonc.py", line 5, in ?
    File "C:\jython-2.1\Tools\jytho nc\main.py", line 301, in main
    File "C:\jython-2.1\Tools\jytho nc\main.py", line 294, in writeResults
    File "C:\jython-2.1\Tools\jytho nc\jar.py", line 98, in dump
    File "C:\jython-2.1\Tools\jytho nc\jar.py", line 92, in dumpFiles
    File "C:\jython-2.1\Tools\jytho nc\jar.py", line 111, in addPackage
    java.util.zip.Z ipException: duplicate entry: org/python/core/PyMethod.class
    at java.util.zip.Z ipOutputStream. putNextEntry(Un known Source)
    at sun.reflect.Gen eratedMethodAcc essor30.invoke( Unknown Source)
    at sun.reflect.Del egatingMethodAc cessorImpl.invo ke(Unknown Source)
    at java.lang.refle ct.Method.invok e(Unknown Source)
    at org.python.core .PyReflectedFun ction.__call__( PyReflectedFunc tion.java)
    at org.python.core .PyMethod.__cal l__(PyMethod.ja va)
    at org.python.core .PyObject.__cal l__(PyObject.ja va)
    at org.python.core .PyInstance.inv oke(PyInstance. java)
    at jar$py.addPacka ge$11(C:\jython-2.1\Tools\jytho nc\jar.py:111)
    at jar$py.call_fun ction(C:\jython-2.1\Tools\jytho nc\jar.py)
    at org.python.core .PyTableCode.ca ll(PyTableCode. java)
    at org.python.core .PyTableCode.ca ll(PyTableCode. java)
    at org.python.core .PyFunction.__c all__(PyFunctio n.java)
    at org.python.core .PyInstance.inv oke(PyInstance. java)
    at jar$py.dumpFile s$9(C:\jython-2.1\Tools\jytho nc\jar.py:92)
    at jar$py.call_fun ction(C:\jython-2.1\Tools\jytho nc\jar.py)
    at org.python.core .PyTableCode.ca ll(PyTableCode. java)
    at org.python.core .PyTableCode.ca ll(PyTableCode. java)
    at org.python.core .PyFunction.__c all__(PyFunctio n.java)
    at org.python.core .PyInstance.inv oke(PyInstance. java)
    at jar$py.dump$10( C:\jython-2.1\Tools\jytho nc\jar.py:98)
    at jar$py.call_fun ction(C:\jython-2.1\Tools\jytho nc\jar.py)
    at org.python.core .PyTableCode.ca ll(PyTableCode. java)
    at org.python.core .PyTableCode.ca ll(PyTableCode. java)
    at org.python.core .PyFunction.__c all__(PyFunctio n.java)
    at org.python.core .PyInstance.inv oke(PyInstance. java)
    at main$py.writeRe sults$8(C:\jyth on-2.1\Tools\jytho nc\main.py:294)
    at main$py.call_fu nction(C:\jytho n-2.1\Tools\jytho nc\main.py)
    at org.python.core .PyTableCode.ca ll(PyTableCode. java)
    at org.python.core .PyTableCode.ca ll(PyTableCode. java)
    at org.python.core .PyFunction.__c all__(PyFunctio n.java)
    at main$py.main$9( C:\jython-2.1\Tools\jytho nc\main.py:301)
    at main$py.call_fu nction(C:\jytho n-2.1\Tools\jytho nc\main.py)
    at org.python.core .PyTableCode.ca ll(PyTableCode. java)
    at org.python.core .PyTableCode.ca ll(PyTableCode. java)
    at org.python.core .PyFunction.__c all__(PyFunctio n.java)
    at org.python.core .PyObject.invok e(PyObject.java )
    at org.python.pyco de._pyx0.f$0(C: \jython-2.1\Tools\jytho nc\jythonc.py:5 )
    at
    org.python.pyco de._pyx0.call_f unction(C:\jyth on-2.1\Tools\jytho nc\jythonc.py)
    at org.python.core .PyTableCode.ca ll(PyTableCode. java)
    at org.python.core .PyCode.call(Py Code.java)
    at org.python.core .Py.runCode(Py. java)
    at org.python.core .__builtin__.ex ecfile_flags(__ builtin__.java)
    at org.python.util .PythonInterpre ter.execfile(Py thonInterpreter .java)
    at org.python.util .jython.main(jy thon.java)

    java.util.zip.Z ipException: java.util.zip.Z ipException: duplicate entry:
    org/python/core/PyMethod.class


    FYI, my CLASSPATH is:

    SET CLASSPATH=batik-1.5.1/batik.jar;batik-1.5.1/batik-squiggle.jar;
    batik-1.5.1/batik-rasterizer.jar; batik-1.5.1/batik-slideshow.jar;b atik-1.5.1/batik-svgpp.jar;
    batik-1.5.1/batik-ttf2svg.jar;bat ik-1.5.1/lib/batik-awt-util.jar;batik-1.5.1/lib/batik-bridge.jar;
    batik-1.5.1/lib/batik-css.jar;batik-1.5.1/lib/batik-dom.jar;batik-1.5.1/lib/batik-ext.jar;
    batik-1.5.1/lib/batik-extension.jar;b atik-1.5.1/lib/batik-gui-util.jar;batik-1.5.1/lib/batik-gvt.jar;
    batik-1.5.1/lib/batik-parser.jar;bati k-1.5.1/lib/batik-script.jar;bati k-1.5.1/lib/batik-svg-dom.jar;
    batik-1.5.1/lib/batik-svggen.jar;bati k-1.5.1/lib/batik-swing.jar;batik-1.5.1/lib/batik-transcoder.jar;
    batik-1.5.1/lib/batik-util.jar;batik-1.5.1/lib/batik-xml.jar;batik-1.5.1/lib/js.jar;
    batik-1.5.1/lib/pdf-transcoder.jar; batik-1.5.1/lib/xerces_2_5_0.ja r;batik-1.5.1/lib/xml-apis.jar;
    batik-1.5.1/lib/jython.jar;






  • Simon Brunning

    #2
    Re: Stuck on Jythonc --all w/ ZipException PyMethod

    On Wed, 02 Mar 2005 14:13:48 GMT, Mitch Amiano <mamiano@nc.rr. com> wrote:[color=blue]
    > I'm getting started working with Jython (hope this is an ok group for
    > the question), and ran into a stumbling block using the jythonc tool.[/color]

    Well, I'm sure that no one is going to object to Jython questions
    here, but you might get more response on the Jython users list:

    Jython is a Java implementation of the Python language. It allows users to compile Python source code to Java byte codes, and run the resulting…


    --
    Cheers,
    Simon B,
    simon@brunningo nline.net,

    Comment

    Working...