SpringMvc + Spring4 + hibernate4 Integration Common Errors, springmvcspring4

Source: Internet
Author: User

SpringMvc + Spring4 + hibernate4 Integration Common Errors, springmvcspring4

SpringMvc + Spring4 + hibernate4 has been integrated recently and many errors have occurred. This is our valuable experience. The biggest problem during the integration process is the version upgrade, the previous example of jdk1.6 was successful, but after the upgrade to jdk1.8, many errors suddenly occurred. Later, when debugging, I found that spring3 and jdk1.8 were incompatible versions, you can either downgrade jdk to 1.7 or lower, or upgrade the spring version. When upgrading and maintaining stability, I chose to upgrade the spring version. If so, let's take a look!

Running result:

Source code download: springMvcTest click to download

Source code structure:

Common Errors:

1. Macro: (1) spring3 and jdk1, 8

Performance: The class cannot be compiled correctly.

Solution: downgrade jdk to 1.7 or earlier, or upgrade spring to 4.0 or later,

(2) tomcat6.0 and jdk1.8

Performance: unable to run the website

Solution: Upgrade tomcat server to 8.0 or above


1. When upgrading a technology version, we must conduct current technical research. Otherwise, we will be overwhelmed by the relentless army of errors and will not know how to solve them.

2. When an error points to a method under the jar package, we prefer to think of conflicts between the missing jar package and the jar package. This problem often leads us to a passive situation and jumps out of the circle, test other problems after determining the compatibility of the entire version!

2. Microscopic: (1), classpath * And classpath

Performance: xml files cannot be scanned.

Solution: classpath * scans all files that meet the conditions, while classpath only scans the first file that meets the conditions. Configure as needed

(2), dataSource

Performance: database connection failed, but the service has been started

Solution: <property name = "url" value = "jdbc: mysql: // localhost: 8444/springmvc"/> the port may be written incorrectly. On the Internet, most of the examples are default ports, however, after inquiry, we can see that the modification has been made. We need to make an inspection in advance!


In the specific implementation, we may understand that this is probably the configuration, but the specific configuration is used to downloading a ready-made copy from the Internet, and I often do this, it doesn't matter. We can't tell him to stop studying him if there is no problem. Many times, when the environment changes, the speed at which we solve the problem lies in how many problems we have encountered and how many problems we have solved, if I configured it myself, I would be more specific to every detail. We would be a great guy!


The Details determine the success or failure. The basis of this sentence is our understanding of the macro level. We already have steps to understand the details. The macro level is often the basis of the micro level. In terms of version control, in terms of technology integration, the macro view is a guiding opinion, but in the compilation of a configuration file and the meaning of a symbol, we need to continue to deepen in specific demands, in addition, we always believe that everything has rules, and symbols are even more so. For the sake of universality, there must be rules to follow! Believe in yourself, grasp the macro level, and follow up with the micro level. This is the basic factor for stable architecture!

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.