On Jun 21, 2011, at 3:51 AM, Marco Laponder wrote: > Hi All: > > My apologies, my previous post was a reply on another subject mixing up the > thread. > So once more my post but now really as a new thread… > > I have an ear which contains a war file. The jar files required by my > application are in the lib directory of the ear. The WEB-INF/lib > directory is empty. I am using hibernate version 3.6.0.Final and I want > my application to use the jpa 2.0 of hibernate (hibernate-jpa-2.0-api), > so I have added a hidden-classes element with a filter on > javax.persistence. > > However when I have this construction, hibernate doesn't recognize my > annotated classes anymore (it gives an mapping exception Unknown > Entity). But when I move the libraries from the ear lib directory to the > WEB-INF/lib directory I no longer have this exception.
Hmm. It sounds like your war's are inheriting the hidden-classes configuration. To be honest, I can't remember the specifics of how that will/should work. In general, each of your WAR's will have a ClassLoader. Their parent will be the EAR ClassLoader. You want the EAR ClassLoader to have the hidden classes, but not the WAR ClassLoaders. From your description, it sounds like this isn't the case. You could try defining each of your wars in the deployment plan. Perhaps explicitly defining their <environment> will override this behavior? Beyond that, unless somebody remembers more, somebody will need to dig through the code... --kevan