ladon wont install with jython 2.7b1

Bug #1162194 reported by Chai Ang on 2013-03-30
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ladon
Undecided
Unassigned

Bug Description

I am using the following.
ladon 0.7.5
jython 2.7b
linux mint 14

These files are problematic (and I would suppose the corresponding py3 versions)

src/chardet_py2/jpcntx.py
src/chardet_py2/big5freq.py
src/chardet_py2/euckrfreq.py
src/chardet_py2/jisfreq.py
src/chardet_py2/gb2312freq.py

Am getting the following when I try to install ladon
ie
$ jython setup.py install

java.lang.RuntimeException: java.lang.RuntimeException: Method code too large!

This is because java has a 64k limit to a class method.
http://docs.oracle.com/javase/specs/jvms/se5.0/html/ClassFile.doc.html#88659

Some possible solutions would be to either
- read the list from a file
- break the list up into smaller chunks.

I tried the latter and it seems to now build.

But the test server and client code in the examples does not work properly yet. Not sure if I broke up the list wrongly or what.

ie. using jython runserver and jython clienttest, it fails on the first test ie. Calculator
using a python runserver and jython clienttest, it passes all tests upto the TransferService test (ie, TransferService fails).
using jython runserver and python clienttest, it fails on the first test ie. Calculator

The error for Calculator looks like this.
Testing Calculator:

Traceback (most recent call last):
  File "clienttest.py", line 96, in <module>
    testCalculator()
  File "clienttest.py", line 29, in testCalculator
    calc_client = JSONWSPClient(base_url + '/Calculator/jsonwsp/description')
  File "/usr/local/lib/python2.7/dist-packages/ladon/clients/jsonwsp.py", line 141, in __init__
    self.parse_description()
  File "/usr/local/lib/python2.7/dist-packages/ladon/clients/jsonwsp.py", line 223, in parse_description
    self.jsonwsp_description = json.loads(PORTABLE_STRING(jsonwsp_response.response_body,response_charset))
  File "/usr/lib/python2.7/json/__init__.py", line 326, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

Was info only. :-)

Many many thanks for all your hard work. ladon is v impressive.

Chai Ang (3-launchpad) on 2013-04-16
description: updated
Jim Baker (jimbaker) wrote :

Ladon does compile on Jython 2.7 trunk now, so no more issues with these large literals (the compiler can break up the most common case into small methods). Also I can resolve all dependencies with pip.

I did try running with nosestests, but some test issues remain, beyond the scope of what I would be able to investigate. Please note that I have also recently fixed perhaps a related issue with socket/select/ssl, although this may or may not suffice.

(I came here because I was googling for "method size too large" errors with respect to Jython, just to see what's out there in the wild, so I can confirm against my solution for this specific problem.)

Good luck!

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers