Closed GoogleCodeExporter closed 9 years ago
Hi,sorry for the late answer, will have a look at some point but I think the
issue is a classloading mixup and a quick workaround would be to put the lib
into WEB-INF/lib
Original comment by kostas.k...@googlemail.com
on 12 Nov 2013 at 11:02
Thanks for answer.
We just downgrade to version 1.8.1 as we cannot put it to web-inf folder
due to architecture restrictions.
Original comment by alex...@aspentechlabs.com
on 13 Nov 2013 at 2:17
Hi Alexey,
I believe it is a classloading issue. Cloner is loaded via the parent class
loader of tomcat and it probably mixes the class of webapp B with the one from
A. But can't see why 1.8.1. The only difference is that on 1.8.2 they use the
same Objenessis instance. So it might be that Objenessis mixes the classes of A
and B. But that can be easily overridden in newer versions:
The Cloner has a constructor:
public Cloner(final IInstantiationStrategy instantiationStrategy)
Instead of calling the default constructor, just call this one as :
new Cloner(new ObjenesisInstantiationStrategy())
1 instance of ObjenesisInstantiationStrategy per web app is required.
Original comment by kostas.k...@googlemail.com
on 23 Nov 2013 at 4:51
Are you going to change the default constructor to avoid this type of error?
Original comment by alex...@aspentechlabs.com
on 24 Nov 2013 at 12:34
No as it occurs in very specific conditions and the default constructors
provide sensible defaults for most cases at the moment. Maybe some static
factory methods would help in situations like this. I.e.
Cloning.default() // default behaviour
Cloning.shared() // shared behaviour, i.e. used under tomcat/lib
Original comment by kostas.k...@googlemail.com
on 30 Nov 2013 at 7:16
Yes, that would be good to have some note in FAQ or somewhere in doc for
other people. Thanks.
Original comment by alex...@aspentechlabs.com
on 30 Nov 2013 at 7:53
fixed in 1.9.1-SNAPSHOT
Original comment by kostas.k...@googlemail.com
on 19 Sep 2014 at 10:38
Original issue reported on code.google.com by
alex...@aspentechlabs.com
on 6 Nov 2013 at 1:40