I have tried using ordinary Tomcat server with JSF 2.3 (I am using Eclipse). Unfortunately, I am having as much problems getting JSF to work on Eclipse with Tomcat. I have tried to get CDI working in Eclipse but to avall. I have tried the options set out in this link Installing CDI in Tomcat, but cannot get CDI working.
If I stick to using TomEE and openJPA I am getting the following exception:
javax.el.ELException: <openjpa-3.1.2-r66d2a72 fatal user error> org.apache.openjpa.persistence.ArgumentException: No metadata was found for type "class com.waycontech.jsf.add.persistence.Student$$OwbNormalScopeProxy0". The class does not appear in the list of persistent types: [com.waycontech.jsf.add.persistence.Student].
It seems there is an inner class added to my Entity class which openJPA tries to persist instead of the class itself???
If I try to use Tomcat, I am having a problem using JSF.
If I try to use TomEE, I am having a problem with openJPA.
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.
So there I was, trapped in the jungle. And at the last minute, I was saved by this tiny ad:
SKIP - a book about connecting industrious people with elderly land owners