Completely solve ORG/hibernate/CFG/hbmbinder $ secondpass

Source: Internet
Author: User

When I started tomcat in the project today, the following error was reported in the window:
Java. Lang. noclassdeffounderror: ORG/hibernate/CFG/hbmbinder $ secondpass

This problem has plagued me for the whole afternoon and I have not found it out ~~

Finally, I checked it online and found that there were quite a few people with this problem. Some people who did not encounter this problem said they could not find this class, but they did not explain the solution, this is a problem with the official hibernate + spring. There are no classes. What should we do ~

And then found that some of the solution is the latest hibernate-annotations.jar package ~, This can solve the problem, but it is not the most fundamental solution. This problem is actually very strange. The key lies in the test in JUnit, that is, when it is released to the project, this problem may occur ~ That is, when myeclipse releases the project file ~

So to myeclipse installation directory to search for the hibernate-annotations.jar package, found in which there are four hibernate-annotations.jar package (myeclipse6.0 version, 5. X does not know, there may be only three). Their directories are as follows:
1. myeclipse/Eclipse/plugins/com.genuitec.org. hibernate. Eclipse _ ....../lib/Annotations -- [352 k]
2. myeclipse/Eclipse/plugins/COM. genuitec. Eclipse. springframework _.../data/2.0/lib/hibernate -- [257 k]
3. myeclipse/Eclipse/plugins/com.genuitec.org. hibernate. Eclipse _ ....../myeclipse-data/3.2/lib/entitymanager -- [257 k]
4. myeclipse/Eclipse/plugins/COM. genuitec. Eclipse. springframework _.../data/1.2/lib/dependencies/hibernate -- [128 K]

The error is the fourth directory under the hibernate-annotations.jar package, a total of K size
After observing the file size of the four packages, it is obvious that the cause of this problem lies in the spring version. Because spring2.0 is newer, the updated hinbernate package is also newer, in spirng1.2, although the version of hibernate3.x is included, this exception bug occurs because the hibernate package is not updated in time, I don't know because myeclipse didn't promptly update the spring patch version, or because spring engineers ignored this problem ~, I have made such a small mistake. Haha, but it is also true that no one is perfect ~~

After analyzing the cause of the problem, the last thing left is the complete solution to the problem, which is very simple.
Copy the hibernate-annotations.jar package from the second or third folder to the lib directory of the project and overwrite it, of course, if you don't want to happen again in the future, then the file will directly overwrite the hibernate-annotations.jar in the fourth directory, so that myeclipse will no longer have the same problem ~

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.