I've split this post away from its original
thread because it really wasn't related to that thread and deserves a thread of its own.
Perhaps the biggest problem here is the difference between vanilla Tomcat and TomEE.
Tomcat is a minimal-stack
JEE server, supporting only the most basic JEE features, including
servlets and JSPs. TomEE, on the other hand, bulks up to be a full-stack JEE server.
Critical differences are that WARs built for Tomcat must explicitly include implementation JARs for things like JSF and JPA. But JSF and JPA are defined as container-provided services for a full-stack JEE server and if you attempt to supply those JARs in a TomEE WAR, they will conflict with the JARs built into TomEE. In other words, you must either build a TomEE WAR
without the jars required in a vanilla Tomcat WAR or you must deploy the WAR with metatdata that tells TomEE to use your application's JSF and JPA jars instead of the TomEE jars.
CDI is an entirely different bucket of worms. When last I checked CDI and the Spring Framework didn't like each other and CDI didn't provide a lot of the services that I depended on from Spring. While I hope that things have resolved amicably since then, I've not been working in that area for a long time, so I'm afraid I cannot be of help there. I hope someone else can inform us.
Your inner proxy class error reminds me of something from long ago, but I don't recall details. However, if this is coming from the vanilla Tomcat, it
might be related to a limitation of using Spring JPA in vanilla Tomcat. As I said, JPA is not built into Tomcat, so you have to include a JPA implementation JAR for vanilla Tomcat WARs. However in the case of Spring Data JPA, there are also a pair of JARs that have to be installed into Tomcat itself (that is, into the TOMCAT_HOME/lib directory). Spring JPA uses AOP reweaving to put the JPA hooks into the POJO JPA Entity class code. If those reweaving functions are not available, something like the error you described may happen.
Some people, when well-known sources tell them that fire will burn them, don't put their hands in the fire.
Some people, being skeptical, will put their hands in the fire, get burned, and learn not to put their hands in the fire.
And some people, believing that they know better than well-known sources, will claim it's a lie, put their hands in the fire, and continue to scream it's a lie even as their hands burn down to charred stumps.