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