aucd29 / cloning

Automatically exported from code.google.com/p/cloning
Other
0 stars 0 forks source link

Caused by: java.lang.IllegalArgumentException: Can not set #22

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
When object is deepcloned.

What is the expected output?
A successful cloned object.

What do you see instead?
Caused by: java.lang.IllegalArgumentException: Can not set <package.AAA> field 
A.a to A
        at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:146)
        at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:150)
        at sun.reflect.UnsafeFieldAccessorImpl.ensureObj(UnsafeFieldAccessorImpl.java:37)
        at sun.reflect.UnsafeQualifiedObjectFieldAccessorImpl.set(UnsafeQualifiedObjectFieldAccessorImpl.java:59)
        at java.lang.reflect.Field.set(Field.java:657)
        at com.rits.cloning.Cloner.cloneInternal(Cloner.java:515)
        at com.rits.cloning.Cloner.cloneInternal(Cloner.java:514)
        at com.rits.cloning.Cloner.cloneInternal(Cloner.java:514)
        at com.rits.cloning.Cloner.cloneInternal(Cloner.java:514)
        at com.rits.cloning.Cloner.cloneInternal(Cloner.java:514)
        at com.rits.cloning.FastClonerArrayList.clone(FastClonerArrayList.java:20)
        at com.rits.cloning.Cloner.fastClone(Cloner.java:108)
        at com.rits.cloning.Cloner.cloneInternal(Cloner.java:460)
        at com.rits.cloning.Cloner.cloneInternal(Cloner.java:514)
        at com.rits.cloning.Cloner.deepClone(Cloner.java:323)

What version of the product are you using? On what operating system?
1.9.0
Linux RHEL 6

Please provide any additional information below.
I'm using Jetty has embebbed aplication server.

Original issue reported on code.google.com by agentilr...@gmail.com on 16 Sep 2013 at 10:33

GoogleCodeExporter commented 9 years ago
Can you paste class A?

Original comment by kostas.k...@googlemail.com on 16 Sep 2013 at 11:08

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Specifying the error:
Caused by: java.lang.IllegalArgumentException: Can not set 
sessions.RFBServiceSession field 
GeneratedRuleSet_RFBServiceSession.startingPoint to 
GeneratedRuleSet_RFBServiceSession

public class GeneratedRuleSet_RFBServiceSession implements 
runtime.CompiledRuleSet {
    private static final long serialVersionUID = 1L;
    private volatile sessions.RFBServiceSession startingPoint;
    private static volatile Object undefined = null;
    private volatile java.lang.StringBuilder debugSB;   

    public GeneratedRuleSet_RFBServiceSession() {
        super(); 
    }

    @Override
    public runtime.CompiledRuleSet clone() {
        return new GeneratedRuleSet_RFBServiceSession();
    }
}

Thanks fo the help! 

Original comment by agentilr...@gmail.com on 16 Sep 2013 at 1:26

GoogleCodeExporter commented 9 years ago
With Java DeepCloner it works without any error.

Original comment by agentilr...@gmail.com on 16 Sep 2013 at 2:44

GoogleCodeExporter commented 9 years ago
hard to tell what might be causing this. Any chance you provide a test that 
fails with a similar error?

Original comment by kostas.k...@googlemail.com on 16 Sep 2013 at 4:06

GoogleCodeExporter commented 9 years ago
It's not that simple because it's a integration test that uses more than one 
system.
Any ideas who the problem can be?

Original comment by agentilr...@gmail.com on 16 Sep 2013 at 4:48

GoogleCodeExporter commented 9 years ago
Sorry, can't tell. So sessions.RFBServiceSession is RFBServiceSession in 
package sessions right? And GeneratedRuleSet_RFBServiceSession seems to be an 
other class. 

Original comment by kostas.k...@googlemail.com on 17 Sep 2013 at 5:55

GoogleCodeExporter commented 9 years ago
RFBServiceSession is a class in package named "sessions".
GeneratedRuleSet_RFBServiceSession is other class in other package 
(utils.GeneratedRuleSet_RFBServiceSession).

We made more tests and the behaviour is strange. The test always pass with 
success once. If we execute again fails!

The class GeneratedRuleSet_RFBServiceSession is generated and instanciated in 
runtime, by a rule compiler system.

We keep data in a in-memory data grid (Oracle Coherence).

Original comment by agentilr...@gmail.com on 18 Sep 2013 at 3:10

GoogleCodeExporter commented 9 years ago
can you please (if possible) create a simple test case and reopen this? I can't 
figure out what might be wrong

Original comment by kostas.k...@googlemail.com on 19 Sep 2014 at 10:31