Classloader order in ProxyUtils incorrect

Description

The order of classloder set on the cglib enhancer is incorrect. The class loader of the proxy class takes precedence over the class loader from the rest plugin and thus if the host application or another bundle ships with cglib it will use this version of cglib rather than the cglib version provided by the rest plugin.

In line 58 of the ProxyUtils we should swap the class loader to use first the rest plugins class loader, than the class loader of the proxy class.
enhancer.setClassLoader(new ChainingClassLoader(clazz.getClassLoader(), ProxyUtils.class.getClassLoader()));

Environment

None

Testing Notes

None

Assignee

Don Brown

Reporter

FelixF

Labels

None

Add-on Type

None

Team

None

CC

None

Risk factor

None

QA Kickoff Status

None

QA Demo Status

None

Fix versions

Affects versions

Priority

Major
Configure