2016-04-23 0:00 GMT+04:00 Sergey Beryozkin <sberyoz...@gmail.com>: > > Thanks, well, I was not planning to spend any more time on LTW, but I > decided to give it a go again, and after spending a lot of time debugging > through TomcatInstrumentableClassLoader and OpenJPA it proved > TomcatInstrumentableClassLoader was actually interfering with LTW. > Or more specifically, @Entity were loaded by this CL while the entity > classes - by Tomcat WebAppLoader. Perhaps having an orm.xml would work, but > as it happens Tomcat 7/64 WebAppLoader is capable of keeping the > transformers itself now. > Removing TomcatInstrumentableClassLoader made it work for me, though > earlier on it was not but during the last try I refactored the application > context a bit to import the entity related beans. I also updated the module > to ship a static model based on Romain's tip. >
I think orm.xml JPA configuration is more "clean" than annotations and gives more flexibility, becouse different mapping files could be plugged in persistance unit configuration. And LTW I am also see as more "clean" than static weaving, since it is implementation-free. That's just my opinion, suitable for my use cases. > This is all truly off-topic :-) but I'm detailing it all to highlight that > the element of the 'black-magic' is still there, but I do have more > confidence now in LTW... > > Well, if we talking about JPA in terms of JAX-RS backend, I think this is not-so-offtopic here