Java.util.MissingResourceException:Can ' t find bundle for Base name init, locale zh_cn problem handling

Source: Internet
Author: User
Tags locale

First, the problem description

Project development using the SSM framework, the project that normal operation, the development of a new feature, the addition of some configuration files, and then rerun the project throws an exception, can not find the name of the init bean.

Second, the exception information detailed
June 30, 2018 8:49:56 PM org.apache.catalina.core.StandardWrapperValve invoke severity: Servlet.service () for Servlet [ Springservlet] In the context with the path [/cyd_online] threw exception [Handler processing failed; nested exception is Java.lan G.exceptionininitializererror] with root causejava.util.MissingResourceException:Can ' t find bundle for Base name Init, l Ocale zh_cn at Java.util.ResourceBundle.throwMissingResourceException (resourcebundle.java:1564) at Java.util.Resour    Cebundle.getbundleimpl (resourcebundle.java:1387) at Java.util.ResourceBundle.getBundle (resourcebundle.java:773) At com.cyd.modules.cyd.fuiou.utils.configreader.<clinit>(configreader.java:11) at com.cyd.modules.cyd.fuiou.base.constants.<clinit>(constants.java:55) at Com.cyd.modules.cyd.fuiou.service.NewProOrderService.order (newproorderservice.java:79) at Com.cyd.modules.cyd.service.AccountRechargeService.getNewProOrder (accountrechargeservice.java:86) at com.cyd.modules.cyd.service.accountrechargeservice$ $FastClassBySpringCGLIB $ $ce 1e5ee.invoke (<generated>) at Org.springframework.cglib.proxy.MethodProxy.invoke (methodproxy.java:204) ... at Org.apache.tomcat.util.threads.taskthread$wrappingrunnable.run (taskthread.java:61) at Java.lang.Thread.run ( thread.java:748) caused By:java.util.MissingResourceException:Can ' t find bundle for Base name init, Locale zh_cn at JA Va.util.ResourceBundle.throwMissingResourceException (resourcebundle.java:1564) at Java.util.ResourceBundle.getBundleImpl (resourcebundle.java:1387) at Java.util.ResourceBundle.getBundle ( resourcebundle.java:773) at Com.cyd.modules.cyd.fuiou.utils.configreader.<clinit>(ConfigReader.java:11 ) ...  More
Third, problem-handling

The problem here is that the configuration file init.properties is placed under the development module Fuiou, and the bean's Path resource path is classpath:/init.properties, causing the project to run without loading to the configuration file and unable to initialize the bean.

The configuration file init.properties is placed in the resource directory.

Java.util.MissingResourceException:Can ' t find bundle for Base name init, locale zh_cn problem handling

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.