-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 
Author Message
 Post subject: NoSuchMethodError - org.hibernate.cfg.Environment
PostPosted: Sat Nov 26, 2016 3:24 am 
Newbie

Joined: Sat Nov 26, 2016 3:20 am
Posts: 10
I have a problem: Error creating bean with name 'emf' defined in ServletContext resource [/WEB-INF/spring/appServlet/servlet-context.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.hibernate.cfg.Environment.verifyProperties(Ljava/util/Map;)V

Full stack issue: http://pastebin.com/vjWUNZEb

It's a project: https://github.com/MrChebik/Notes/tree/issue

I try to remove local libraries from maven, and reinstall it, but it's not resolve this problem. Searching the Internet gave no results.

Thanks.


Top
 Profile  
 
 Post subject: Re: NoSuchMethodError - org.hibernate.cfg.Environment
PostPosted: Sat Nov 26, 2016 7:12 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1630
Location: Romania
You need to run:

Code:
mvn dependency:tree


And find multiple occurrences of hibernate-core.jar, or even older versions of Hibernate like hibernate3.jar.

Once you exclude those transitive dependencies, everything should be fine.


Top
 Profile  
 
 Post subject: Re: NoSuchMethodError - org.hibernate.cfg.Environment
PostPosted: Sat Nov 26, 2016 7:48 am 
Newbie

Joined: Sat Nov 26, 2016 3:20 am
Posts: 10
Thank you, for reply.

It's output from
Code:
mvn dependency:tree

http://pastebin.com/Mu2TaMEu

I don't see any recurring packages.


Top
 Profile  
 
 Post subject: Re: NoSuchMethodError - org.hibernate.cfg.Environment
PostPosted: Sat Nov 26, 2016 7:53 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1630
Location: Romania
One clue might be related to this:

Code:
+- org.springframework:spring-orm:jar:4.2.6.RELEASE:compile
+- org.springframework:spring-tx:jar:4.3.4.RELEASE:compile


Why do you use different versions of Spring? Maybe that's where the Hibernate transitive dependency comes from.


Top
 Profile  
 
 Post subject: Re: NoSuchMethodError - org.hibernate.cfg.Environment
PostPosted: Sat Nov 26, 2016 8:46 am 
Newbie

Joined: Sat Nov 26, 2016 3:20 am
Posts: 10
Thank you, it's most likely solved my problem.

I downgraded the version of spring-xx to 4.2.8.RELEASE
And spring-data-jpa to 1.10.5.RELEASE

UPD: when I added the packages in the classpath, the error returned

UPD: I update logs from tomcat: http://pastebin.com/vjWUNZEb
And you can see:
Code:
[RMI TCP Connection(2)-127.0.0.1] INFO org.hibernate.cfg.Environment - Hibernate 3.6.10.Final

Where did hibernate 3.6.10 unclear.


Top
 Profile  
 
 Post subject: Re: NoSuchMethodError - org.hibernate.cfg.Environment
PostPosted: Sun Nov 27, 2016 6:28 am 
Newbie

Joined: Sat Nov 26, 2016 3:20 am
Posts: 10
Woow!
I fixed this problem.

When I decided to try to put the version 3.6.10.Final, I got a more informative log of error. And I saw that the error was in the build query @Query. Added to the end of the query 'nativeQuery = true' and the error is gone. Later, I went back to 5.2.4.Final, and the app also started!

Thank you for help!

P.S. If anyone has a similar problem, try to change the setting log in the Tomcat (conf/logging.properties -> org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = INFO) for 'FINE'. And look carefully at the log.


Top
 Profile  
 
 Post subject: Re: NoSuchMethodError - org.hibernate.cfg.Environment
PostPosted: Thu Dec 08, 2016 9:12 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
I'm glad you stopped using Hibernate 3.6... it's extremely old! Lots of people have been working for years to improve it a lot since then.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.