SpringSource/spring-framework — pull request #290 by Fuud (2013-05-24 09:50:35+00:00)
Title: Ability to create proxy around classes that has no default constructor.

There is some limitations in current proxy instantiation model:
1) class should have default constructor (but sprint supports autowiring constructor arguments for object itself)
2) calling the constructor can cause side-effects
3) if constructor throws an exception proxy will not be created.

Also in current implementation there is serialization problem: if target class implements java.io.Externalizable then no proxy fields will be stored and restored object will be invalid.

Note that proxy does not need to have any valid state at all.

Solution is to use Objenesis library ( http://objenesis.googlecode.com/svn/docs/index.html ). It can instantiate objects without calling any constructor.

For serialization issue proxy should implement java.io.Externalizable and save/restore properties in writeExternal/readExternal methods.