出现错误:

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");

 

相关文章:

  • 2021-12-01
  • 2021-03-27
  • 2021-10-01
  • 2021-12-28
  • 2021-08-05
  • 2021-08-09
  • 2021-06-12
  • 2021-11-07
猜你喜欢
  • 2021-04-21
  • 2022-01-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-01
  • 2022-01-03
相关资源
相似解决方案