SpringMVC MockMvc test Can & #39; t find bundle for base name javax. servlet. LocalStrings, locale zh_CN error, strings

Source: Internet
Author: User

SpringMVC MockMvc test Can't find bundle for base name javax. servlet. LocalStrings, locale zh_CN error, strings

Let's talk about my environment: jdk1.8, springMVC5.0, meclipse2014, junit4.12

When I use MockMVC, which comes with spring mvc, for unit testing, the following error occurs:

Can't find bundle for base name javax. servlet. LocalStrings, locale zh_CN

When viewing specific errors, you can see:

I found a lot of posts on the Internet and did not find a specific solution. I found an article on Google about the lack of java ee APIs similar to this error. I tried to import all the API packages related to java ee, but still did not solve the error. The other is about the lack of servlet-related APIs for Maven projects. If you fail to solve the problem based on my methods, refer to their ideas. However, they gave me a prompt, indicating that I had few things. When I presented my problem to my teacher, he tried a solution based on this clue, the reason is that I lack related packages for the WEB service runtime environment.

If you are using myeclipse, try the following operations:

1.

2.

3.

Test again

The problem is solved perfectly ..

Forward and indicate the source ....

 

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.