使用ibatis要注意的问题!!

ibatis 配置文件中不要加中文字符 会导致xml读取出错


特别是在window下不报错,但在linux下会报错。这个问题很烦人,如果你不知道,排除这个问题,你会感觉很痛苦,到处找原因找不到,我发现了,与大家共享,希望大家碰上这个问题能省点时间


报如下错误:

java.lang.ExceptionInInitializerError    
  at   service.CustomerService.<init>(CustomerService.java:12)    
  at   service.CustomerService.<clinit>(CustomerService.java:11)    
  at   command.LoginCommand.execute(LoginCommand.java:24)    
  at   control.Control.UserDoAction(Control.java:20)    
  at   control.Control.doGet(Control.java:30)    
  at   control.Control.doPost(Control.java:37)    
  at   javax.servlet.http.HttpServlet.service(HttpServlet.java:760)    
  at   javax.servlet.http.HttpServlet.service(HttpServlet.java:853)    
  at   com.caucho.server.http.FilterChainServlet.doFilter(FilterChainServlet.java:96)    
  at   com.caucho.server.http.Invocation.service(Invocation.java:315)    
  at   com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:135)    
  at   com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:253)    
  at   com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:171)    
  at   com.caucho.server.TcpConnection.run(TcpConnection.java:139)    
  at   java.lang.Thread.run(Thread.java:534)    
  Caused   by:   java.lang.RuntimeException:   初始化ibatis(manager)异常:   com.ibatis.dao.client.DaoException:    
  Error   while   configuring   DaoManager.   Cause:   com.ibatis.common.exception.NestedRuntimeException:    
  Error   occurred.   Cause:   com.ibatis.common.xml.NodeletException:   Error   parsing    
  XML.   Cause:   com.ibatis.common.exception.NestedRuntimeException:   Error    
  parsing   XPath   '/sqlMapConfig/sqlMap'.   Cause:   com.ibatis.common.xml.NodeletException:    
  Error   parsing   XML.   Cause:   com.caucho.xml.XmlParseException:   stream:49:    
  bad   character   fffd    
  Caused   by:   com.caucho.xml.XmlParseException:   stream:49:   bad   character   fffd    
  Caused   by:   com.ibatis.common.xml.NodeletException:   Error   parsing   XML.    
  Cause:   com.caucho.xml.XmlParseException:   stream:49:   bad   character   fffd    
  Caused   by:   com.caucho.xml.XmlParseException:   stream:49:   bad   character   fffd    
  Caused   by:   com.ibatis.common.exception.NestedRuntimeException:   Error   parsing    
  XPath   '/sqlMapConfig/sqlMap'.   Cause:   com.ibatis.common.xml.NodeletException:    
  Error   parsing   XML.   Cause:   com.caucho.xml.XmlParseException:   stream:49:    
  bad   character   fffd    
  Caused   by:   com.caucho.xml.XmlParseException:   stream:49:   bad   character   fffd    
  Caused   by:   com.ibatis.common.xml.NodeletException:   Error   parsing   XML.    
  Cause:   com.caucho.xml.XmlParseException:   stream:49:   bad   character   fffd    
  Caused   by:   com.caucho.xml.XmlParseException:   stream:49:   bad   character   fffd    
  Caused   by:   com.ibatis.common.xml.NodeletException:   Error   parsing   XML.    
  Cause:   com.ibatis.common.exception.NestedRuntimeException:   Error   parsing    
  XPath   '/sqlMapConfig/sqlMap'.   Cause:   com.ibatis.common.xml.NodeletException:    
  Error   parsing   XML.   Cause:   com.caucho.xml.XmlParseException:   stream:49:    
  bad   character   fffd    
  Caused   by:   com.caucho.xml.XmlParseException:   stream:49:   bad   character   fffd    
  Caused   by:   com.ibatis.common.xml.NodeletException:   Error   parsing   XML.    
  Cause:   com.caucho.xml.XmlParseException:   stream:49:   bad   character   fffd    
  Caused   by:   com.caucho.xml.XmlParseException:   stream:49:   bad   character   fffd    
  Caused   by:   com.ibatis.common.exception.NestedRuntimeException:   Error   parsing    
  XPath   '/sqlMapConfig/sqlMap'.   Cause:   com.ibatis.common.xml.NodeletException:    
  Error   parsing   XML.   Cause:   com.caucho.xml.XmlParseException:   stream:49:    
  bad   character   fffd    
  Caused   by:   com.caucho.xml.XmlParseException:   stream:49:   bad   character   fffd    
  Caused   by:   com.ibatis.common.xml.NodeletException:   Error   parsing   XML.    
  Cause:   com.caucho.xml.XmlParseException:   stream:49:   bad   character   fffd    
  Caused   by:   com.caucho.xml.XmlParseException:   stream:49:   bad   character   fffd    
  Caused   by:   com.ibatis.common.exception.NestedRuntimeException:   Error   occurred.    
  Cause:   com.ibatis.common.xml.NodeletException:   Error   parsing   XML.   Cause:    
  com.ibatis.common.exception.NestedRuntimeException:   Error   parsing   XPath    
  '/sqlMapConfig/sqlMap'.   Cause:   com.ibatis.common.xml.NodeletException:    
  Error   parsing   XML.   Cause:   com.caucho.xml.XmlParseException:   stream:49:    
  bad   character   fffd    
  Caused   by:   com.caucho.xml.XmlParseException:   stream:49:   bad   character   fffd    
  Caused   by:   com.ibatis.common.xml.NodeletException:   Error   parsing   XML.    
  Cause:   com.caucho.xml.XmlParseException:   stream:49:   bad   character   fffd    
  Caused   by:   com.caucho.xml.XmlParseException:   stream:49:   bad   character   fffd    
  Caused   by:   com.ibatis.common.exception.NestedRuntimeException:   Error   parsing    
  XPath   '/sqlMapConfig/sqlMap'.   Cause:   com.ibatis.common.xml.NodeletException:    
  Error   parsing   XML.   Cause:   com.caucho.xml.XmlParseException:   stream:49:    
  bad   character   fffd    
  Caused   by:   com.caucho.xml.XmlParseException:   stream:49:   bad   character   fffd    
  Caused   by:   com.ibatis.common.xml.NodeletException:   Error   parsing   XML.    
  Cause:   com.caucho.xml.XmlParseException:   stream:49:   bad   character   fffd    
  Caused   by:   com.caucho.xml.XmlParseException:   stream:49:   bad   character   fffd    
  Caused   by:   com.ibatis.common.xml.NodeletException:   Error   parsing   XML.    
  Cause:   com.ibatis.common.exception.NestedRuntimeException:   Error   parsing    
  XPath   '/sqlMapConfig/sqlMap'.   Cause:   com.ibatis.common.xml.NodeletException:    
  Error   parsing   XML.   Cause:   com.caucho.xml.XmlParseException:   stream:49:    
  bad   character   fffd    
  Caused   by:   com.caucho.xml.XmlParseException:   stream:49:   bad   character   fffd    
  Caused   by:   com.ibatis.common.xml.NodeletException:   Error   parsing   XML.    
  Cause:   com.caucho.xml.XmlParseException:   stream:49:   bad   character   fffd    
  Caused   by:   com.caucho.xml.XmlParseException:   stream:49:   bad   character   fffd    
  Caused   by:   com.ibatis.common.exception.NestedRuntimeException:   Error   parsing    
  XPath   '/sqlMapConfig/sqlMap'.   Cause:   com.ibatis.common.xml.NodeletException:    
  Error   parsing   XML.   Cause:   com.caucho.xml.XmlParseException:   stream:49:    
  bad   character   fffd    
  Caused   by:   com.caucho.xml.XmlParseException:   stream:49:   bad   character   fffd    
  Caused   by:   com.ibatis.common.xml.NodeletException:   Error   parsing   XML.    
  Cause:   com.caucho.xml.XmlParseException:   stream:49:   bad   character   fffd    
  Caused   by:   com.caucho.xml.XmlParseException:   stream:49:   bad   character   fffd    
  at   persistence.ManagerDAOConfig.<clinit>(ManagerDAOConfig.java:17)    
  ...   15   more

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值