When spring creates a proxy, it uses cglib with default naming policy. Is there any way to change the naming policy? Generated class names clash with another framework I use.
Asked
Active
Viewed 569 times
8
-
How is that possible? You have other framework which is using CGLib to enhance the same classes? Sounds like very strange setup. – Pavel Horal Nov 02 '13 at 12:34
-
it's not strange. i do integration tests when spring creates proxy for my session scoped bean. and also i have unit tests where i check business functionality of the same object – piotrek Nov 02 '13 at 12:56
-
And what kind of errors are you getting? Seems that CGLib should be able to handle that. http://cglib.cvs.sourceforge.net/viewvc/cglib/cglib/src/proxy/net/sf/cglib/core/DefaultNamingPolicy.java?view=markup – Pavel Horal Nov 02 '13 at 13:21
-
1it's described here: http://blog.piotrturski.net/2013/06/codegenerationexception-and-proxies.html – piotrek Nov 02 '13 at 13:23
1 Answers
2
It seems cglib claims it can detect name clashes but for some reason it does not in this case.
Because of that problem (and your report?) the other framework you are using (catch-exception) patched their code to avoid it.

aalku
- 2,860
- 2
- 23
- 44
-
1It can detect name clashes as long as *one* cglib is used. Since Spring 3.2+ repackages cglib, there easily can be *two* cglibs, each taking care of its own name collisions. – Piotr Findeisen Feb 06 '14 at 13:21