错误 java.lang.ClassCastException: com.xx cannot be cast to ResourceBundle

出现错误:

java.lang.ClassCastException: com.xxx cannot be cast to ResourceBundle

百度搜索错误,没有结果。谷歌搜索:http://stackoverflow.com/questions/5694017/specify-java-localization-file

 

解决方法,修改了一行代码

prop = ResourceBundle.getBundle(this.getClass().getName());//这里需要读取一个配置文件
改成:
prop = ResourceBundle.getBundle("xxx.properties");

 

posted @ 2016-06-20 22:57  逃离沙漠  阅读(910)  评论(0编辑  收藏  举报