Reputation: 105
I am new to hibernate and I was trying to build a JSF application with Hibernate in the persistence layer. This is how I am getting the Session Factory.
Configuration config = new Configuration().configure("hibernate.cfg.xml");
StandardServiceRegistryBuilder ssrb = new StandardServiceRegistryBuilder().applySettings(config.getProperties());
factory = config.buildSessionFactory(ssrb.build());
But I am getting the following error while running the application.
Error Message:
Caused by: java.lang.NoSuchMethodError: org.hibernate.integrator.internal.IntegratorServiceImpl.<init>(Ljava/util/LinkedHashSet;Lorg/hibernate/boot/registry/classloading/spi/ClassLoaderService;)V
at org.hibernate.boot.registry.BootstrapServiceRegistryBuilder.build(BootstrapServiceRegistryBuilder.java:247)
at org.hibernate.boot.registry.StandardServiceRegistryBuilder.<init>(StandardServiceRegistryBuilder.java:73)
at com.sherwin.j29.jpa.factory.JPASessionFactory.createSessionFactory(JPASessionFactory.java:19)
at com.sherwin.j29.jpa.factory.JPASessionFactory.getSessionFactory(JPASessionFactory.java:13)
at com.sherwin.j29.dao.WorkItemDAO.<init>(WorkItemDAO.java:24)
at com.sherwin.j29.dao.WorkItemDAO$Proxy$_$$_WeldClientProxy.<init>(WorkItemDAO$Proxy$_$$_WeldClientProxy.java)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at org.jboss.weld.util.reflection.SecureReflections$16.work(SecureReflections.java:344)
at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52)
at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInstantiation(SecureReflectionAccess.java:173)
at org.jboss.weld.util.reflection.SecureReflections.newInstance(SecureReflections.java:341)
at org.jboss.weld.bean.proxy.ProxyFactory.create(ProxyFactory.java:237)
at org.jboss.weld.bean.proxy.ClientProxyFactory.create(ClientProxyFactory.java:105)
at org.jboss.weld.bean.proxy.ClientProxyProvider.createClientProxy(ClientProxyProvider.java:87)
at org.jboss.weld.bean.proxy.ClientProxyProvider.access$000(ClientProxyProvider.java:43)
at org.jboss.weld.bean.proxy.ClientProxyProvider$1.load(ClientProxyProvider.java:53)
at org.jboss.weld.bean.proxy.ClientProxyProvider$1.load(ClientProxyProvider.java:46)
at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3589)
at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2374)
at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2337)
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2252)
I am using hibernate 4.3.6.
Please let me know if I am missing something.
Upvotes: 2
Views: 11211
Reputation: 14253
Try to clean and build your project if you had any package upgrade recently.
Upvotes: 0
Reputation: 7388
Make sure that you have removed all of the previous version(s) of Hibernate from your classpath.
Looking at it on github, I do not see why that would be caused unless you were having class loader issues caused by version conflicts, as the IntegratorServiceImpl exists in both versions that you are/were using, which suggests a class loader issue to me
Upvotes: 1