Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [Teneo] Teneo 2.1, Hibernate 4, Tomcat 8(Unable to load somes hibernate classes)
[Teneo] Teneo 2.1, Hibernate 4, Tomcat 8 [message #1759596] Thu, 13 April 2017 15:39 Go to next message
atos yopmail is currently offline atos yopmailFriend
Messages: 1
Registered: April 2017
Junior Member
I use Tomcat 8 to deploy my servlets.

My environnement uses :

- postgres 9.6 / jdbc driver 42
- hibernate 4.3.11
- emf 2.11
- teneo 2.1.0 (2017)
- spring 4.3
- cxf 3.1.11

I use spring to load my bean from XML, CXF to expose my servlets and my webservices. My modeling is built with EMF and i use teneo to have the session factory (and create the hibernate mapping from my emf model).

When the servlet is launched i've the following errors after the teneo initialize :
A) when I put teneo into the common tomcat classloader
Caused by: java.lang.NoClassDefFoundError: org/hibernate/collection/AbstractPersistentCollection
        at org.eclipse.emf.teneo.hibernate.EMFInterceptor.<clinit>(EMFInterceptor.java:91)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:348)
        at org.eclipse.emf.teneo.classloader.ClassLoaderResolver.classForName(ClassLoaderResolver.java:50)
        at org.eclipse.emf.teneo.extension.DefaultExtensionManager.getExtension(DefaultExtensionManager.java:127)
        at org.eclipse.emf.teneo.extension.DefaultExtensionManager.getExtension(DefaultExtensionManager.java:254)
        at org.eclipse.emf.teneo.hibernate.HbContext.createInterceptor(HbContext.java:87)
        at org.eclipse.emf.teneo.hibernate.HbSessionDataStore.setInterceptor(HbSessionDataStore.java:158)
        at org.eclipse.emf.teneo.hibernate.HbDataStore.initializeDataStore(HbDataStore.java:322) 


Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.eclipse.emf.teneo.hibernate.EMFInterceptor
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:348)
        at org.eclipse.emf.teneo.classloader.ClassLoaderResolver.classForName(ClassLoaderResolver.java:50)
        at org.eclipse.emf.teneo.extension.DefaultExtensionManager.getExtension(DefaultExtensionManager.java:127)
        at org.eclipse.emf.teneo.extension.DefaultExtensionManager.getExtension(DefaultExtensionManager.java:254)
        at org.eclipse.emf.teneo.hibernate.HbContext.createInterceptor(HbContext.java:87)
        at org.eclipse.emf.teneo.hibernate.HbSessionDataStore.setInterceptor(HbSessionDataStore.java:158)
        at org.eclipse.emf.teneo.hibernate.HbDataStore.initializeDataStore(HbDataStore.java:322)
        at org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initialize(HbSessionDataStore.java:106)


searching old class from hibernate 3.x, in hibernate 4.x its into internal package...how to change that ?

its a classloader problem...in the common classloader of tomcat I declared (with the common.loader property) all jar (including emf, teneo...). The default classloader of teneo.hibernate is the ContextClassLoaderStrategy (=> it uses Thread.currentThread().getContextClassLoader()). I tested to change it with the ClassClassLoaderStrategy...doesn't work too :'(
Any idea ?

B) when I put teneo into each Webapp tomcat classloader and in the common tomcat classloader
Caused by: org.eclipse.emf.teneo.extension.TeneoExtensionException: The requested extension org.eclipse.emf.teneo.PersistenceOptions does not implement the inte        rface org.eclipse.emf.teneo.extension.ExtensionPoint
  30659         at org.eclipse.emf.teneo.extension.DefaultExtensionManager.getExtension(DefaultExtensionManager.java:131)
  30660         at org.eclipse.emf.teneo.extension.DefaultExtensionManager.getExtension(DefaultExtensionManager.java:264)
  30661         at org.eclipse.emf.teneo.hibernate.HbDataStore.setDataStoreProperties(HbDataStore.java:453)


From teneo code :
Class clz1 = ClassLoaderResolver.classForName(extension.getClassName());
/*     */ 
/*     */ 
/* 132 */          if(!ExtensionPoint.class.isAssignableFrom(clz1)) {
/* 133 */             throw new TeneoExtensionException("The requested extension " + clz1.getName() + " does not implement the interface " + ExtensionPoint.class.getName());
/*     */ 


I'm lost ^^ any idea ?





[Updated on: Fri, 14 April 2017 13:29]

Report message to a moderator

Re: [Teneo] Teneo 2.1, Hibernate 4, Tomcat 8 [message #1759711 is a reply to message #1759596] Mon, 17 April 2017 07:36 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi,
The AbstractPersistentCollection class exists in 4.3.7. So not sure, which internal hibernate 3.* class is Teneo looking for?
You checked if you had everything listed here:
https://wiki.eclipse.org/Teneo/Hibernate/Download_and_Install#Usage_in_a_Web_Container_-_Maven

gr. Martin

Previous Topic:Edit: problems with copy and paste containment
Next Topic:Project Setup Help
Goto Forum:
  


Current Time: Thu Apr 25 16:35:38 GMT 2024

Powered by FUDForum. Page generated in 0.02653 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top