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