Reader entry: ���� 乱码

mybatis3.3.0和mybatis3.3.1中的org.apache.ibatis.io.DefaultVFS中的logger的参数错误
private static final Log log = LogFactory.getLog(ResolverUtil.class);
应该是
private static final Log log = LogFactory.getLog(DefaultVFS.class);

这个bug在3.4.2中已经修复
=============================
出现这个问题的原因是logback记日志的时候乱码
ResolverUtil - Not a JAR: file:。。。。。。
ResolverUtil - Reader entry: ����

结果在ResolverUtil中根本找不到logger,后来用search and replace搜索jar包才找到这个bug,晕死

乱码的问题还是没解决,看了DefaultVFS的源码,应该是
Java代码   收藏代码
  1. /* 
  2.              * Some servlet containers allow reading from directory resources like a 
  3.              * text file, listing the child resources one per line. However, there is no 
  4.              * way to differentiate between directory and file resources just by reading 
  5.              * them. To work around that, as each line is read, try to look it up via 
  6.              * the class loader as a child of the current resource. If any line fails 
  7.              * then we assume the current resource is not a directory. 
  8.              */  
  9.             is = url.openStream();  
  10.             BufferedReader reader = new BufferedReader(new InputStreamReader(is));  
  11.             List<String> lines = new ArrayList<String>();  
  12.             for (String line; (line = reader.readLine()) != null;) {  
  13.               if (log.isDebugEnabled()) {  
  14.                 log.debug("Reader entry: " + line);  
  15.               }  
  16.               lines.add(line);  
  17.               if (getResources(path + "/" + line).isEmpty()) {  
  18.                 lines.clear();  
  19.                 break;  
  20.               }  
  21.             }  

中的InputStreamReader没有传第二个参数导致

转载于:https://www.cnblogs.com/pangting/p/7327152.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值