首页 > 代码库 > Reader entry: ???? 乱码
Reader entry: ???? 乱码
mybatis3.3.*中DefaultVFS的logger乱码问题
博客分类:- java
mybatisResolverUtilDefaultVFS乱码
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的源码,应该是
中的InputStreamReader没有传第二个参数导致
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代码
- /*
- * Some servlet containers allow reading from directory resources like a
- * text file, listing the child resources one per line. However, there is no
- * way to differentiate between directory and file resources just by reading
- * them. To work around that, as each line is read, try to look it up via
- * the class loader as a child of the current resource. If any line fails
- * then we assume the current resource is not a directory.
- */
- is = url.openStream();
- BufferedReader reader = new BufferedReader(new InputStreamReader(is));
- List<String> lines = new ArrayList<String>();
- for (String line; (line = reader.readLine()) != null;) {
- if (log.isDebugEnabled()) {
- log.debug("Reader entry: " + line);
- }
- lines.add(line);
- if (getResources(path + "/" + line).isEmpty()) {
- lines.clear();
- break;
- }
- }
中的InputStreamReader没有传第二个参数导致
Reader entry: ???? 乱码
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。