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.
- How is that possible? You have other framework which is using CGLib to enhance the same classes? Sounds like very strange setup.Pavel Horal– Pavel Horal2013-11-02 12:34:54 +00:00Commented Nov 2, 2013 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 objectpiotrek– piotrek2013-11-02 12:56:48 +00:00Commented Nov 2, 2013 at 12:56
- And what kind of errors are you getting? Seems that CGLib should be able to handle that. cglib.cvs.sourceforge.net/viewvc/cglib/cglib/src/proxy/net/sf/…Pavel Horal– Pavel Horal2013-11-02 13:21:45 +00:00Commented Nov 2, 2013 at 13:21
- 1it's described here: blog.piotrturski.net/2013/06/…piotrek– piotrek2013-11-02 13:23:34 +00:00Commented Nov 2, 2013 at 13:23
Add a comment |
1 Answer
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.
1 Comment
Piotr Findeisen
It 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.