| Sorry for not responding sooner. Your code seems to be refactored version of mine so I give it a try a.s.a.p. but I don't see any reason why it wouldn't work. The reason why classloading didn't work for me is explained more thoroughly later on but I have to state here and now that the real reason for my problems is Apache Aries https://issues.apache.org/jira/browse/ARIES-1447. EnhancingClassTransformerImpl propagates the given classloader to Javassist classPool and it's used hence forth for classloading of hibernate internals during transformation process. In my case this classloader didn't have access to the hibernate internals, only to the entities themselves, and therefore failed during transformation process when there classes were no prefilled to the classPool by hibernate. |