2005/03/18

java.util.MissingResourceException

Scenario:
I have a config.properties file. In this property file, it provides some information, such as jdbc driver url, user name, password, and so forth.
But as I wanna read this property file, it always throws this kind of exception message: java.util.MissingResourceException: Can't find bundle for base name config

How to resolve:
This root cause is not cannot find this property file. It does find this file, but the content in this file has something wrong.

This line is the snippet of the property file
ftp.type4.path=D:\batch\FTP_FILES\user_group
the problem is the slash direction, it should be
ftp.type4.path=D:/batch/FTP_FILES/user_group
or
ftp.type4.path=D:\\batch\\FTP_FILES\\user_group

No comments: