aspose file tools*
The moose likes Object Relational Mapping and the fly likes Hibernate Connectivity Issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate Connectivity Issue" Watch "Hibernate Connectivity Issue" New topic
Author

Hibernate Connectivity Issue

Tan Mit
Greenhorn

Joined: Aug 06, 2012
Posts: 14
I am new to Hibernate and learning it with my current job

I am getting the below error when trying to connect to DB via hibernate-

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/collections/map/LRUMap
at org.hibernate.util.SimpleMRUCache.init(SimpleMRUCache.java:71)
at org.hibernate.util.SimpleMRUCache.<init>(SimpleMRUCache.java:55)
at org.hibernate.util.SimpleMRUCache.<init>(SimpleMRUCache.java:50)
at org.hibernate.engine.query.QueryPlanCache.<init>(QueryPlanCache.java:69)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:181)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1341)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)


I looked at the other topics and tired to see if i did not have common collections but i do have common collection in my class path. Could someone please suggest what more am i missing? Please advice.
Tan Mit
Greenhorn

Joined: Aug 06, 2012
Posts: 14
I replaced common-collection 3.2.1 in my class paht instead of 2.1.1. And now I see the following issue

[12.09.25 09:46:24:776 PDT] ERROR - IN HibernateUtil: Initial SessionFactory creation failed.org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]
Caused by: org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]
at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTuplizer(EntityTuplizerFactory.java:109)
at org.hibernate.tuple.entity.EntityTuplizerFactory.constructDefaultTuplizer(EntityTuplizerFactory.java:134)
at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.<init>(EntityEntityModeToTuplizerMapping.java:80)
at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:323)
at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:457)
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:131)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:84)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:266)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1341)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
at com.xxxxxxxxxx.util.HibernateUtil.init(HibernateUtil.java:36)
... 5 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTuplizer(EntityTuplizerFactory.java:106)
... 15 more
Caused by: java.lang.NoClassDefFoundError: javassist/util/proxy/MethodFilter
at org.hibernate.bytecode.javassist.BytecodeProviderImpl.getProxyFactoryFactory(BytecodeProviderImpl.java:49)
at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactoryInternal(PojoEntityTuplizer.java:208)
at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:186)
at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:151)
at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:78)
... 20 more
Caused by: java.lang.ClassNotFoundException: javassist.util.proxy.MethodFilter
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 25 more
Tan Mit
Greenhorn

Joined: Aug 06, 2012
Posts: 14
I also added javaassist3.4.GA and I still see the same error. Any help/suggestion is greatly appreciated.
Tan Mit
Greenhorn

Joined: Aug 06, 2012
Posts: 14
Never mins.. it work I had spell javassist wrong.. Thanks for the other topics posted here in the forum that helped me reoslve this.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hibernate Connectivity Issue