Hi,

We have a Java application that uses Jython and works fine with Jython 2.1.  I'm now porting it to use Jython 2.5.1.  However, I'm getting the following error using Jython 2.5.1:

   SystemError: Automatic proxy initialization should only occur on proxy classes

I see this error after calling copy.copy or copy.deepcopy() to copy a Java type variable (such as one of type java.util.ArrayList for example).  The copy completes without any errors but as soon as the copied variable is accessed in any fashion, this SystemError occurs.  Here's a simple example of this problem after copy.copy() is used to copy a java.util.ArrayList instance, and then the copied variable is accessed.  This example works fine using Jython 2.1.  

C:\jython2.5.1>jython
Jython 2.5.1 (Release_2_5_1:6813, Sep 26 2009, 13:47:54)
[Java HotSpot(TM) Client VM (Sun Microsystems Inc.)] on java1.6.0_13
Type "help", "copyright", "credits" or "license" for more information.
>>> from java.util import ArrayList
>>> gList = ArrayList()
>>> gList
[]
>>> import copy
>>> copyList = copy.copy(gList)
>>> copyList
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
SystemError: Automatic proxy initialization should only occur on proxy classes
>>> globals()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
SystemError: Automatic proxy initialization should only occur on proxy classes
>>>

Note this problem occurs with some other Java classes as well, including some custom  classes we use, not just a Java list.

Does anyone know why this problem occurs with Jython 2.5.1?  Is it a bug in Jython 2.5.1?  Or, if it's supposed to work this way in Jython 2.5.1, does anyone have suggestions for how I can avoid this problem?  It seems to me to be a very "bad" thing as globals() also then fails with this error.  Any suggestions are very appreciated.   Thanks.

--------------------------------------------------------------
Sharon Lucas
IBM Austin,   lucass@us.ibm.com
(512) 286-7313 or Tieline 363-7313