ibats 怎么把 ' 转换成 '

我准备往ibats XML文件里面的SQL的一个列传入一个字符串:'75','150','300' 此字符串是75,150,300经过,拆分成LIST集合之后再拼接'而成的,在JAVA的逻辑层完成的操作,然后再传入XML文件里面,通过log打出来没什么问题,但是插入到SQL之后,LOG打出来的字符串就变成了:&-a-p-o-s;75&-a-p-o-s-;,&-a-p-o-s;150&-a-p-o-s;,&-a-p-o-s;300&-a-p-o-s; ,然后报错 中间的 - 号是我自己加上去的,不然会直接变成 ' 。
请问我应该怎样拼接字符串才能使此字符串在SQL语句中正确的显示为:'75','150','300' 。
求大神们不吝指教,非常非常感谢。

2个回答

你可以先用HtmlDecode对输入的字符串解码,再存入数据库,这个不适合在iBatis中处理,因为它属于业务逻辑。

因为你是传输一个List到配置文件,所以我建议你用标签进行迭代输入,用##符号接。。。
具体代码,例:

#[]#

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
ibatis异常
Exception in thread "Main Thread" java.lang.ExceptionInInitializerError Caused by: com.ibatis.sqlmap.client.SqlMapException: There was an error while building the SqlMap instance. --- The error occurred in the SQL Map Configuration file. --- The error occurred while configuring the data source. --- Check the data source type or class. --- Cause: com.ibatis.sqlmap.client.SqlMapException: Error initializing DataSource. Could not instantiate DataSourceFactory. Cause: java.lang.ClassNotFoundException: C3P0 Caused by: java.lang.ClassNotFoundException: C3P0 Caused by: com.ibatis.sqlmap.client.SqlMapException: Error initializing DataSource. Could not instantiate DataSourceFactory. Cause: java.lang.ClassNotFoundException: C3P0 Caused by: java.lang.ClassNotFoundException: C3P0 at com.ibatis.sqlmap.engine.builder.xml.XmlSqlMapClientBuilder.buildSqlMap(XmlSqlMapClientBuilder.java:203) at com.ibatis.sqlmap.client.SqlMapClientBuilder.buildSqlMapClient(SqlMapClientBuilder.java:49) at com.onlineoa.model.dao.CommonDao$1.initialValue(CommonDao.java:20) at com.onlineoa.model.dao.CommonDao$1.initialValue(CommonDao.java:1) at java.lang.ThreadLocal.setInitialValue(ThreadLocal.java:141) at java.lang.ThreadLocal.get(ThreadLocal.java:131) at com.onlineoa.model.dao.CommonDao.newInstance(CommonDao.java:33) at com.onlineoa.model.biz.UserActiveBiz.<clinit>(UserActiveBiz.java:11) Caused by: com.ibatis.sqlmap.client.SqlMapException: Error initializing DataSource. Could not instantiate DataSourceFactory. Cause: java.lang.ClassNotFoundException: C3P0 Caused by: java.lang.ClassNotFoundException: C3P0 at com.ibatis.sqlmap.engine.builder.xml.XmlSqlMapClientBuilder.parseDataSource(XmlSqlMapClientBuilder.java:386) at com.ibatis.sqlmap.engine.builder.xml.XmlSqlMapClientBuilder.parseTransactionManager(XmlSqlMapClientBuilder.java:328) at com.ibatis.sqlmap.engine.builder.xml.XmlSqlMapClientBuilder.parseSqlMapConfig(XmlSqlMapClientBuilder.java:225) at com.ibatis.sqlmap.engine.builder.xml.XmlSqlMapClientBuilder.buildSqlMap(XmlSqlMapClientBuilder.java:199) ... 7 more Caused by: java.lang.ClassNotFoundException: C3P0 at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:303) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:169) at com.ibatis.common.resources.Resources.classForName(Resources.java:244) at com.ibatis.common.resources.Resources.instantiate(Resources.java:260) at com.ibatis.sqlmap.engine.builder.xml.XmlSqlMapClientBuilder.parseDataSource(XmlSqlMapClientBuilder.java:377) ... 10 more
ibatis 分组列表 dao层怎么去写 ibatis 分组列表 dao层怎么去写
ibatis 分组列表 dao层怎么去写??自动生成的,怎么改啊
ibatis如何形成 in ('1','2','3')这样的形式
ibatis 如何显示成 in ('1','2','3')?
ibatis配置问题
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> <sqlMap> <!-- 为Person类设置一个别名 --> <typeAlias alias="user" type="com.lt.ibatis.pojo.user"/> <!-- 配置表和类之间的映射关系 --> <resultMap class="com.lt.ibatis.pojo.user" id="userMap"> <result property="userid" column="userid"/> <result property="username" column="username"/> <result property="password" column="password"/> <result property="phone" column="phone"/> <result property="fax" column="fax"/> </resultMap> <!-- 验证帐号密码 --> <select id="queryAccount" parameterClass="java.lang.String" resultClass="com.lt.ibatis.pojo.User"> <![CDATA[ SELECT * FROM USERTAB WHERE USERID=#USERID# AND PASSWORD=#PASSWORD# ]]> </select> </sqlMap> 这是我的 User.xml 表映射文件  报的错误是: Exception in thread "main" java.lang.NoClassDefFoundError: com/lt/ibatis/pojo/user (wrong name: com/lt/ibatis/pojo/User) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.access$100(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at com.ibatis.common.resources.Resources.classForName(Resources.java:260) at com.ibatis.sqlmap.engine.builder.xml.SqlMapParser$14.process(SqlMapParser.java:374) at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:121) at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:84) at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:102) at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:72) at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:51) at com.ibatis.sqlmap.engine.builder.xml.SqlMapParser.parse(SqlMapParser.java:51) at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser$11.process(SqlMapConfigParser.java:410) at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:121) at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:84) at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:102) at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:72) at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:51) at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigParser.java:86) at com.ibatis.sqlmap.client.SqlMapClientBuilder.buildSqlMapClient(SqlMapClientBuilder.java:63) at com.lt.dao.QuoteDao.queryAccount(QuoteDao.java:19) at com.lt.dao.TestDao.main(TestDao.java:15) 好象是路径问题,本人刚学习ibatis,之前学的一个DEMO都成功了,这次自己写的就出问题了?有人能回答下吗?
ibatis如何设置编码?
现在遇到这样的情况: select name from table 这里的name中文正常显示,但如果我使用mysql的AES_ENCRYPT函数对name加密后,然后再解密读起来,name就会乱码 select AES_DECRYPT(UNHEX(name),'123456') as name from table 这样会乱码 如果我使用jdbc,用 rs.getString("name")也乱码,但是用 new String(rs.getBytes("name"),"gbk") 这样就不会乱码 同时使用AES_ENCRYPT来insert也会乱码 所以我怀疑是ibatis在使用该函数的时候可能编码与数据库不对,查了很多资料,都无法正常显示,包括添加Listener的方法: com.ibatis.common.resources.Resources.setCharset(Charset.forName("gbk"));
如何只显示ibatis的日志
项目里使用了struts2、spring、ibatis,我想查看ibatis的sql语句,如下配置可以显示: ### set log levels - ALL,DEBUG,INFO,WARN,ERROR,FATAL,OFF ### log4j.rootLogger=DEBUG,CONSOLE_DEBUG log4j.addivity.org.apache=true # SqlMap logging configuration... log4j.logger.com.ibatis=DEBUG log4j.logger.com.ibatis.common.jdbc.SimpleDataSource=DEBUG log4j.logger.com.ibatis.common.jdbc.ScriptRunner=DEBUG log4j.logger.com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate=DEBUG log4j.logger.java.sql.Connection=DEBUG log4j.logger.java.sql.Statement=DEBUG log4j.logger.java.sql.PreparedStatement=DEBUG log4j.logger.java.sql.ResultSet=DEBUG # ConsoleAppender log4j.appender.CONSOLE_DEBUG=org.apache.log4j.ConsoleAppender log4j.appender.CONSOLE_DEBUG.Threshold=DEBUG log4j.appender.CONSOLE_DEBUG.Target=System.out log4j.appender.CONSOLE_DEBUG.layout=org.apache.log4j.PatternLayout log4j.appender.CONSOLE_DEBUG.layout.ConversionPattern= [%-5p][%F]%n%m%n 但是同时会输出struts、spring的日志,很多啊,我只想看ibatis的日志,请问怎么样把struts和spring的日志过滤掉呢?
ibatis如何维护多对多关系?
<p>最近使用ibatis遇到一些困惑,请教大家一下。<br>举个例子:现在有学生,课程,选课关系三张表。<br>在实现学生选课功能中,用ibatis维护选课关系这张表比较好?<br>有两个想法:1、单独建ralation Entity维护选课关系表<br>                  2、放到 sutdent 和 course 中维护<br>个人倾向第一种,大家一般是怎么做的,详细说一下。</p>
spring ibatis weblogic 出错
信息: JDBC 3.0 Savepoint class is available AbandonedObjectPool is used (org.apache.commons.dbcp.AbandonedObjectPool@183fc68) LogAbandoned: true RemoveAbandoned: true RemoveAbandonedTimeout: 180 2008-7-26 21:22:48 org.apache.struts.action.RequestProcessor processException 警告: Unhandled Exception thrown: class com.ibatis.sqlmap.client.SqlMapException <2008-7-26 下午09时22分48秒 CST> <Error> <HTTP> <BEA-101017> <[weblogic.servlet.internal.WebAppServletContext@f353e5 - appName: '_appsdir_ibatis_dir', name: 'ibatis', context-path: ''] Root cause of ServletException. com.ibatis.sqlmap.client.SqlMapException: There is no statement named creatUser in this SqlMap. at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.getMappedStatement(SqlMapExecutorDelegate.java:288) at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.insert(SqlMapExecutorDelegate.java:424) at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.insert(SqlMapSessionImpl.java:81) at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.insert(SqlMapClientImpl.java:58) at com.ibatis.dao.UserDAOImpl.save(UserDAOImpl.java:14) Truncated. see log file for complete stacktrace
ibatis转换的一个问题
2016-10-15 17:18:39,162 ERROR (com.test.framework.progress.utils.ProgressUtils:126) - poolTaskExecutor 线程池:SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [null]; error code [0]; --- The error occurred in com/test/framework/dao/ibatis2/ibatis.xml. --- The error occurred while applying a result map. --- Check the com.test.lol.code.sql.selectCodeInfoByCond-AutoResultMap. --- The error happened while setting a property on the result object. --- Cause: net.sf.cglib.beans.BulkBeanException: java.lang.String cannot be cast to java.lang.Long; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred in com/test/framework/dao/ibatis2/ibatis.xml. --- The error occurred while applying a result map. --- Check the com.test.lol.code.sql.selectCodeInfoByCond-AutoResultMap. --- The error happened while setting a property on the result object. --- Cause: net.sf.cglib.beans.BulkBeanException: java.lang.String cannot be cast to java.lang.Long org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [null]; error code [0]; --- The error occurred in com/test/framework/dao/ibatis2/ibatis.xml. --- The error occurred while applying a result map. --- Check the com.test.lol.code.sql.selectCodeInfoByCond-AutoResultMap. --- The error happened while setting a property on the result object. --- Cause: net.sf.cglib.beans.BulkBeanException: java.lang.String cannot be cast to java.lang.Long; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred in com/test/framework/dao/ibatis2/ibatis.xml. --- The error occurred while applying a result map. --- Check the com.test.lol.code.sql.selectCodeInfoByCond-AutoResultMap. --- The error happened while setting a property on the result object. --- Cause: net.sf.cglib.beans.BulkBeanException: java.lang.String cannot be cast to java.lang.Long at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:203) at org.springframework.orm.ibatis.SqlMapClientTemplate.executeWithListResult(SqlMapClientTemplate.java:243) at com.test.framework.dao.ibatis2.Ibatis2SqlMapClientTemplate.query4VCommList(Ibatis2SqlMapClientTemplate.java:129) at com.test.framework.dao.ibatis2.Ibatis2SqlMapClientTemplate.queryForVCommList(Ibatis2SqlMapClientTemplate.java:225) at com.test.lol.code.service.CodeServiceImpl.selectCodeInfoByCond(CodeServiceImpl.java:2508) at com.test.lol.code.service.CodeServiceImpl$$FastClassByCGLIB$$740dee32.invoke(<generated>) at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149) at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:689) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.aop.aspectj.AspectJAfterAdvice.invoke(AspectJAfterAdvice.java:42) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:55) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622) at com.test.lol.code.service.CodeServiceImpl$$EnhancerByCGLIB$$ab958bb2.selectCodeInfoByCond(<generated>) at com.test.lol.code.action.CodeAction.selectCodeInfoByCond(CodeAction.java:243) at com.test.lol.code.action.ExportallAction.category(ExportallAction.java:306) at com.test.lol.code.action.ExportallAction.exportyAll(ExportallAction.java:274) at com.test.lol.code.action.ExportallAction$1.execute(ExportallAction.java:221) at com.test.framework.progress.utils.ProgressUtils$2.run(ProgressUtils.java:124) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred in com/test/framework/dao/ibatis2/ibatis.xml. --- The error occurred while applying a result map. --- Check the com.test.lol.code.sql.selectCodeInfoByCond-AutoResultMap. --- The error happened while setting a property on the result object. --- Cause: net.sf.cglib.beans.BulkBeanException: java.lang.String cannot be cast to java.lang.Long at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryWithCallback(MappedStatement.java:204) at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryForList(MappedStatement.java:139) at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:567) at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:541) at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:118) at com.test.framework.dao.ibatis2.Ibatis2SqlMapClientTemplate$1.doInSqlMapClient(Ibatis2SqlMapClientTemplate.java:131) at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:200) ... 26 more Caused by: net.sf.cglib.beans.BulkBeanException: java.lang.String cannot be cast to java.lang.Long at com.test.lol.code.valueobject.CodeInfo$$BulkBeanByCGLIB$$80c55f8f.setPropertyValues(<generated>) at com.ibatis.sqlmap.engine.accessplan.EnhancedPropertyAccessPlan.setProperties(EnhancedPropertyAccessPlan.java:33) at com.ibatis.sqlmap.engine.exchange.JavaBeanDataExchange.setData(JavaBeanDataExchange.java:112) at com.ibatis.sqlmap.engine.mapping.result.ResultMap.setResultObjectValues(ResultMap.java:371) at com.ibatis.sqlmap.engine.mapping.result.AutoResultMap.setResultObjectValues(AutoResultMap.java:54) at com.ibatis.sqlmap.engine.mapping.statement.RowHandlerCallback.handleResultObject(RowHandlerCallback.java:64) at com.ibatis.sqlmap.engine.execution.SqlExecutor.handleResults(SqlExecutor.java:385) at com.ibatis.sqlmap.engine.execution.SqlExecutor.handleMultipleResults(SqlExecutor.java:300) at com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQuery(SqlExecutor.java:189) at com.test.framework.dao.ibatis2.LimitSqlExecutor.executeQuery(LimitSqlExecutor.java:82) at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.sqlExecuteQuery(MappedStatement.java:221) at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryWithCallback(MappedStatement.java:189) ... 32 more Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Long ... 44 more
一个关于ibatis的问题
向sql文里传一个字段id,当id为空或等于1时,才执行某段sql文。问题:当id为空或等于1,用ibatis怎么写
Ibatis插入问题
才学Ibatis,DAO什么的都已经生成好了。如何才能插入数据或查询数据? 是在pulibc static void main(String args[])里实现吗 怎么我报Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory 需要配置服务器吗?
Ibatis自我关联的立即加载
一个Chapter表自我一对多关联。对象属性如下:[code="java"] private int cid; private Chapter parent; private List<Chapter> children; [/code] 现在需要到数据库查询一个Root对象和对应的子Chapter以及子Chapter的子Chapter。。。 也就是得到一个树形结构的对象,现在使用延迟加载没有问题,SQL代码如下: [code="java"] <resultMap id="Result" class="Chapter"> <result property="name" column="name" /> <result property="cid" column="cid" /> <result property="lcode" column="lcode" /> <result property="level" column="level" /> <result property="dorder" column="dorder" /> <result property="parent" column="pid" select="Chapter.getParent"/> <result property="children" column="cid" select="Chapter.getChildren"/> </resultMap> <select id="selectAll" resultClass="Chapter" resultMap="Result"> SELECT <include refid="main_columns" /> FROM <include refid="main_table" /> WHERE cid =1 </select> <select id="getParent" resultClass="Chapter" parameterClass="int" resultMap="Result" > SELECT <include refid="main_columns" /> FROM <include refid="main_table" /> WHERE cid =#cid# </select> <select id="getChildren" resultClass="Chapter" parameterClass="int" resultMap="Result" > SELECT <include refid="main_columns" /> FROM <include refid="main_table" /> WHERE pid =#cid# </select>[/code] 现在我想实现立即加载有什么办法呢,我试过lazyLoadingEnabled="false" enhancementEnabled="false",但是还是不行。 [b]问题补充:[/b] 谢谢一楼的回复,我在Setting里面设置的,当设计为False时掏出一下异常: org.springframework.dao.DataAccessResourceFailureException: SqlMapClient operation; SQL []; --- The error occurred in com/sixclk/clickmath/dao/Chapter-Pgsql.xml. --- The error occurred while applying a result map. --- Check the Chapter.Result. --- Check the result mapping for the 'children' property. --- Cause: com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred in com/sixclk/clickmath/dao/Chapter-Pgsql.xml. --- The error occurred while applying a result map. --- Check the Chapter.Result. --- Check the result mapping for the 'parent' property. --- Cause: com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred in com/sixclk/clickmath/dao/Chapter-Pgsql.xml. --- The error occurred while applying a result map. --- Check the Chapter.Result. --- Check the result mapping for the 'children' property. --- Cause: org.postgresql.util.PSQLException: 这个 ResultSet 已经被关闭。; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred in com/sixclk/clickmath/dao/Chapter-Pgsql.xml. --- The error occurred while applying a result map. --- Check the Chapter.Result. --- Check the result mapping for the 'children' property. --- Cause: com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred in com/sixclk/clickmath/dao/Chapter-Pgsql.xml. --- The error occurred while applying a result map. --- Check the Chapter.Result. --- Check the result mapping for the 'parent' property. --- Cause: com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred in com/sixclk/clickmath/dao/Chapter-Pgsql.xml. --- The error occurred while applying a result map. --- Check the Chapter.Result. --- Check the result mapping for the 'children' property. --- Cause: org.postgresql.util.PSQLException: 这个 ResultSet 已经被关闭。 at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:103) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:212) at org.springframework.orm.ibatis.SqlMapClientTemplate.executeWithListResult(SqlMapClientTemplate.java:249) at org.springframework.orm.ibatis.SqlMapClientTemplate.queryForList(SqlMapClientTemplate.java:296) at org.springframework.orm.ibatis.SqlMapClientTemplate.queryForList(SqlMapClientTemplate.java:290) at com.sixclk.clickmath.dao.ChapterDAOImpl.getAllChapter(ChapterDAOImpl.java:14) at sixclk.clickmath.persistance.ChapterDAOTest.testGetAllChapter(ChapterDAOTest.java:12) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.test.context.junit4.SpringTestMethod.invoke(SpringTestMethod.java:163) at org.springframework.test.context.junit4.SpringMethodRoadie.runTestMethod(SpringMethodRoadie.java:233) at org.springframework.test.context.junit4.SpringMethodRoadie$RunBeforesThenTestThenAfters.run(SpringMethodRoadie.java:333) at org.springframework.test.context.junit4.SpringMethodRoadie.runWithRepetitions(SpringMethodRoadie.java:217) at org.springframework.test.context.junit4.SpringMethodRoadie.runTest(SpringMethodRoadie.java:197) at org.springframework.test.context.junit4.SpringMethodRoadie.run(SpringMethodRoadie.java:143) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.invokeTestMethod(SpringJUnit4ClassRunner.java:142) at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51) at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44) at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27) at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37) at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) Caused by: com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred in com/sixclk/clickmath/dao/Chapter-Pgsql.xml. --- The error occurred while applying a result map. --- Check the Chapter.Result. --- Check the result mapping for the 'children' property. --- Cause: com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred in com/sixclk/clickmath/dao/Chapter-Pgsql.xml. --- The error occurred while applying a result map. --- Check the Chapter.Result. --- Check the result mapping for the 'parent' property. --- Cause: com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred in com/sixclk/clickmath/dao/Chapter-Pgsql.xml. --- The error occurred while applying a result map. --- Check the Chapter.Result. --- Check the result mapping for the 'children' property. --- Cause: org.postgresql.util.PSQLException: 这个 ResultSet 已经被关闭。 at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryWithCallback(MappedStatement.java:201) at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryForList(MappedStatement.java:139) at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:567) at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:541) at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:118) at org.springframework.orm.ibatis.SqlMapClientTemplate$3.doInSqlMapClient(SqlMapClientTemplate.java:298) at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:209) ... 27 more Caused by: com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred in com/sixclk/clickmath/dao/Chapter-Pgsql.xml. --- The error occurred while applying a result map. --- Check the Chapter.Result. --- Check the result mapping for the 'parent' property. --- Cause: com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred in com/sixclk/clickmath/dao/Chapter-Pgsql.xml. --- The error occurred while applying a result map. --- Check the Chapter.Result. --- Check the result mapping for the 'children' property. --- Cause: org.postgresql.util.PSQLException: 这个 ResultSet 已经被关闭。 at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryWithCallback(MappedStatement.java:201) at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryForList(MappedStatement.java:139) at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:567) at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:541) at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:118) at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForList(SqlMapClientImpl.java:94) at com.ibatis.sqlmap.engine.mapping.result.loader.ResultLoader.getResult(ResultLoader.java:70) at com.ibatis.sqlmap.engine.mapping.result.loader.ResultLoader.loadResult(ResultLoader.java:57) at com.ibatis.sqlmap.engine.mapping.result.ResultMap.getNestedSelectMappingValue(ResultMap.java:510) at com.ibatis.sqlmap.engine.mapping.result.ResultMap.getResults(ResultMap.java:341) at com.ibatis.sqlmap.engine.execution.SqlExecutor.handleResults(SqlExecutor.java:384) at com.ibatis.sqlmap.engine.execution.SqlExecutor.handleMultipleResults(SqlExecutor.java:300) at com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQuery(SqlExecutor.java:189) at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.sqlExecuteQuery(MappedStatement.java:221) at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryWithCallback(MappedStatement.java:189) ... 33 more Caused by: com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred in com/sixclk/clickmath/dao/Chapter-Pgsql.xml. --- The error occurred while applying a result map. --- Check the Chapter.Result. --- Check the result mapping for the 'children' property. --- Cause: org.postgresql.util.PSQLException: 这个 ResultSet 已经被关闭。 at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryWithCallback(MappedStatement.java:201) at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryForObject(MappedStatement.java:120) at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:518) at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:493) at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObject(SqlMapSessionImpl.java:106) at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForObject(SqlMapClientImpl.java:82) at com.ibatis.sqlmap.engine.mapping.result.loader.ResultLoader.getResult(ResultLoader.java:75) at com.ibatis.sqlmap.engine.mapping.result.loader.ResultLoader.loadResult(ResultLoader.java:57) at com.ibatis.sqlmap.engine.mapping.result.ResultMap.getNestedSelectMappingValue(ResultMap.java:510) at com.ibatis.sqlmap.engine.mapping.result.ResultMap.getResults(ResultMap.java:341) at com.ibatis.sqlmap.engine.execution.SqlExecutor.handleResults(SqlExecutor.java:384) at com.ibatis.sqlmap.engine.execution.SqlExecutor.handleMultipleResults(SqlExecutor.java:300) at com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQuery(SqlExecutor.java:189) at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.sqlExecuteQuery(MappedStatement.java:221) at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryWithCallback(MappedStatement.java:189) ... 47 more Caused by: org.postgresql.util.PSQLException: 这个 ResultSet 已经被关闭。 at org.postgresql.jdbc2.AbstractJdbc2ResultSet.checkClosed(AbstractJdbc2ResultSet.java:2674) at org.postgresql.jdbc2.AbstractJdbc2ResultSet.findColumn(AbstractJdbc2ResultSet.java:2558) at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getInt(AbstractJdbc2ResultSet.java:2426) at com.mchange.v2.c3p0.impl.NewProxyResultSet.getInt(NewProxyResultSet.java:2573) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.ibatis.common.jdbc.logging.ResultSetLogProxy.invoke(ResultSetLogProxy.java:47) at $Proxy14.getInt(Unknown Source) at com.ibatis.sqlmap.engine.type.IntegerTypeHandler.getResult(IntegerTypeHandler.java:35) at com.ibatis.sqlmap.engine.mapping.result.ResultMap.preparePrimitiveParameterObject(ResultMap.java:533) at com.ibatis.sqlmap.engine.mapping.result.ResultMap.getNestedSelectMappingValue(ResultMap.java:487) at com.ibatis.sqlmap.engine.mapping.result.ResultMap.getResults(ResultMap.java:341) at com.ibatis.sqlmap.engine.execution.SqlExecutor.handleResults(SqlExecutor.java:384) at com.ibatis.sqlmap.engine.execution.SqlExecutor.handleMultipleResults(SqlExecutor.java:300) at com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQuery(SqlExecutor.java:189) at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.sqlExecuteQuery(MappedStatement.java:221) at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryWithCallback(MappedStatement.java:189) ... 61 more
tomcat启动ibatis报错
[b]jdk1.5启动没有问题,改换1.6往上就报异常了;有没有解决办法,用合适正则找出不符合规范或者从哪里做些调整,项目比较大一个一个看不太现实[/b] Caused by: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: org.xml.sax.SAXParseException; lineNumber: 406; columnNumber: 6; 注释中不允许出现字符串 "--"。 Caused by: org.xml.sax.SAXParseException; lineNumber: 406; columnNumber: 6; 注释中不允许出现字符串 "--"。 Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: org.xml.sax.SAXParseException; lineNumber: 406; columnNumber: 6; 注释中不允许出现字符串 "--"。 Caused by: org.xml.sax.SAXParseException; lineNumber: 406; columnNumber: 6; 注释中不允许出现字符串 "--"。 at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:114) at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:75) at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:93) at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:63) at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:51) at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigParser.java:78) at com.ibatis.sqlmap.client.SqlMapClientBuilder.buildSqlMapClient(SqlMapClientBuilder.java:62) at com.zhuansoo.ibatis.SqlMapConn.<clinit>(SqlMapConn.java:29) at com.zhuansoo.dao.P_userDao.<init>(P_userDao.java:19) at com.zhuansoo.util.UserToPath.<init>(UserToPath.java:22) at com.zhuansoo.util.UserToPath.createUserToPath(UserToPath.java:41) at com.zhuansoo.util.UserToPath.getUserToPath(UserToPath.java:34) at com.zhuansoo.util.UpdateMemoForStartListener.contextInitialized(UpdateMemoForStartListener.java:15) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4791) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:618) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1100) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1618) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722) Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: org.xml.sax.SAXParseException; lineNumber: 406; columnNumber: 6; 注释中不允许出现字符串 "--"。 Caused by: org.xml.sax.SAXParseException; lineNumber: 406; columnNumber: 6; 注释中不允许出现字符串 "--"。 at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:53) at com.ibatis.sqlmap.engine.builder.xml.SqlMapParser.parse(SqlMapParser.java:45) at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser$11.process(SqlMapConfigParser.java:347) at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:112) ... 26 more Caused by: org.xml.sax.SAXParseException; lineNumber: 406; columnNumber: 6; 注释中不允许出现字符串 "--"。 at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:441) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368) at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1388) at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanComment(XMLScanner.java:748) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanComment(XMLDocumentFragmentScannerImpl.java:999) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2913) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:607) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:488) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:835) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123) at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:237) at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:300) at com.ibatis.common.xml.NodeletParser.createDocument(NodeletParser.java:150) at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:50) ... 29 more Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: org.xml.sax.SAXParseException; lineNumber: 406; columnNumber: 6; 注释中不允许出现字符串 "--"。 Caused by: org.xml.sax.SAXParseException; lineNumber: 406; columnNumber: 6; 注释中不允许出现字符串 "--"。 at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:53) at com.ibatis.sqlmap.engine.builder.xml.SqlMapParser.parse(SqlMapParser.java:45) at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser$11.process(SqlMapConfigParser.java:347) at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:112) at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:75) at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:93) at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:63) at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:51) at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigParser.java:78) at com.ibatis.sqlmap.client.SqlMapClientBuilder.buildSqlMapClient(SqlMapClientBuilder.java:62) at com.zhuansoo.ibatis.SqlMapConn.<clinit>(SqlMapConn.java:29) at com.zhuansoo.dao.P_userDao.<init>(P_userDao.java:19) at com.zhuansoo.util.UserToPath.<init>(UserToPath.java:22) at com.zhuansoo.util.UserToPath.createUserToPath(UserToPath.java:41) at com.zhuansoo.util.UserToPath.getUserToPath(UserToPath.java:34) at com.zhuansoo.util.UpdateMemoForStartListener.contextInitialized(UpdateMemoForStartListener.java:15) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4791) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:618) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1100) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1618) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722) Caused by: org.xml.sax.SAXParseException; lineNumber: 406; columnNumber: 6; 注释中不允许出现字符串 "--"。 at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:441) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368) at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1388) at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanComment(XMLScanner.java:748) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanComment(XMLDocumentFragmentScannerImpl.java:999) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2913) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:607) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:488) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:835) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123) at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:237) at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:300) at com.ibatis.common.xml.NodeletParser.createDocument(NodeletParser.java:150) at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:50) ... 29 more Caused by: org.xml.sax.SAXParseException; lineNumber: 406; columnNumber: 6; 注释中不允许出现字符串 "--"。 at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:441) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368) at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1388) at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanComment(XMLScanner.java:748) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanComment(XMLDocumentFragmentScannerImpl.java:999) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2913) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:607) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:488) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:835) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123) at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:237) at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:300) at com.ibatis.common.xml.NodeletParser.createDocument(NodeletParser.java:150) at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:50) at com.ibatis.sqlmap.engine.builder.xml.SqlMapParser.parse(SqlMapParser.java:45) at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser$11.process(SqlMapConfigParser.java:347) at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:112) at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:75) at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:93) at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:63) at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:51) at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigParser.java:78) at com.ibatis.sqlmap.client.SqlMapClientBuilder.buildSqlMapClient(SqlMapClientBuilder.java:62) at com.zhuansoo.ibatis.SqlMapConn.<clinit>(SqlMapConn.java:29) at com.zhuansoo.dao.P_userDao.<init>(P_userDao.java:19) at com.zhuansoo.util.UserToPath.<init>(UserToPath.java:22) at com.zhuansoo.util.UserToPath.createUserToPath(UserToPath.java:41) at com.zhuansoo.util.UserToPath.getUserToPath(UserToPath.java:34) at com.zhuansoo.util.UpdateMemoForStartListener.contextInitialized(UpdateMemoForStartListener.java:15) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4791) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:618) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1100) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1618) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722) Caused by: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: org.xml.sax.SAXParseException; lineNumber: 406; columnNumber: 6; 注释中不允许出现字符串 "--"。 Caused by: org.xml.sax.SAXParseException; lineNumber: 406; columnNumber: 6; 注释中不允许出现字符串 "--"。 Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: org.xml.sax.SAXParseException; lineNumber: 406; columnNumber: 6; 注释中不允许出现字符串 "--"。 Caused by: org.xml.sax.SAXParseException; lineNumber: 406; columnNumber: 6; 注释中不允许出现字符串 "--"。 at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:114) at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:75) at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:93) at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:63) at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:51) at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigParser.java:78) at com.ibatis.sqlmap.client.SqlMapClientBuilder.buildSqlMapClient(SqlMapClientBuilder.java:62) at com.zhuansoo.ibatis.SqlMapConn.<clinit>(SqlMapConn.java:29) at com.zhuansoo.dao.P_userDao.<init>(P_userDao.java:19) at com.zhuansoo.util.UserToPath.<init>(UserToPath.java:22) at com.zhuansoo.util.UserToPath.createUserToPath(UserToPath.java:41) at com.zhuansoo.util.UserToPath.getUserToPath(UserToPath.java:34) at com.zhuansoo.util.UpdateMemoForStartListener.contextInitialized(UpdateMemoForStartListener.java:15) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4791) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:618) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1100) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1618) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722) Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: org.xml.sax.SAXParseException; lineNumber: 406; columnNumber: 6; 注释中不允许出现字符串 "--"。 Caused by: org.xml.sax.SAXParseException; lineNumber: 406; columnNumber: 6; 注释中不允许出现字符串 "--"。 at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:53) at com.ibatis.sqlmap.engine.builder.xml.SqlMapParser.parse(SqlMapParser.java:45) at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser$11.process(SqlMapConfigParser.java:347) at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:112) ... 26 more Caused by: org.xml.sax.SAXParseException; lineNumber: 406; columnNumber: 6; 注释中不允许出现字符串 "--"。 at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:441) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368) at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1388) at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanComment(XMLScanner.java:748) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanComment(XMLDocumentFragmentScannerImpl.java:999) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2913) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:607) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:488) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:835) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123) at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:237) at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:300) at com.ibatis.common.xml.NodeletParser.createDocument(NodeletParser.java:150) at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:50) ... 29 more Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: org.xml.sax.SAXParseException; lineNumber: 406; columnNumber: 6; 注释中不允许出现字符串 "--"。 Caused by: org.xml.sax.SAXParseException; lineNumber: 406; columnNumber: 6; 注释中不允许出现字符串 "--"。 at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:53) at com.ibatis.sqlmap.engine.builder.xml.SqlMapParser.parse(SqlMapParser.java:45) at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser$11.process(SqlMapConfigParser.java:347) at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:112) at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:75) at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:93) at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:63) at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:51) at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigParser.java:78) at com.ibatis.sqlmap.client.SqlMapClientBuilder.buildSqlMapClient(SqlMapClientBuilder.java:62) at com.zhuansoo.ibatis.SqlMapConn.<clinit>(SqlMapConn.java:29) at com.zhuansoo.dao.P_userDao.<init>(P_userDao.java:19) at com.zhuansoo.util.UserToPath.<init>(UserToPath.java:22) at com.zhuansoo.util.UserToPath.createUserToPath(UserToPath.java:41) at com.zhuansoo.util.UserToPath.getUserToPath(UserToPath.java:34) at com.zhuansoo.util.UpdateMemoForStartListener.contextInitialized(UpdateMemoForStartListener.java:15) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4791) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:618) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1100) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1618) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722) Caused by: org.xml.sax.SAXParseException; lineNumber: 406; columnNumber: 6; 注释中不允许出现字符串 "--"。 at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:441) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368) at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1388) at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanComment(XMLScanner.java:748) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanComment(XMLDocumentFragmentScannerImpl.java:999) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2913) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:607) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:488) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:835) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123) at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:237) at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:300) at com.ibatis.common.xml.NodeletParser.createDocument(NodeletParser.java:150) at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:50) ... 29 more Caused by: org.xml.sax.SAXParseException; lineNumber: 406; columnNumber: 6; 注释中不允许出现字符串 "--"。 at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:441) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368) at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1388) at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanComment(XMLScanner.java:748) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanComment(XMLDocumentFragmentScannerImpl.java:999) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2913) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:607) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:488) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:835) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123) at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:237) at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:300) at com.ibatis.common.xml.NodeletParser.createDocument(NodeletParser.java:150) at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:50) at com.ibatis.sqlmap.engine.builder.xml.SqlMapParser.parse(SqlMapParser.java:45) at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser$11.process(SqlMapConfigParser.java:347) at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:112) at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:75) at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:93) at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:63) at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:51) at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigParser.java:78) at com.ibatis.sqlmap.client.SqlMapClientBuilder.buildSqlMapClient(SqlMapClientBuilder.java:62) at com.zhuansoo.ibatis.SqlMapConn.<clinit>(SqlMapConn.java:29) at com.zhuansoo.dao.P_userDao.<init>(P_userDao.java:19) at com.zhuansoo.util.UserToPath.<init>(UserToPath.java:22) at com.zhuansoo.util.UserToPath.createUserToPath(UserToPath.java:41) at com.zhuansoo.util.UserToPath.getUserToPath(UserToPath.java:34) at com.zhuansoo.util.UpdateMemoForStartListener.contextInitialized(UpdateMemoForStartListener.java:15) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4791) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:618) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1100) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1618) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722) Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: org.xml.sax.SAXParseException; lineNumber: 406; columnNumber: 6; 注释中不允许出现字符串 "--"。 Caused by: org.xml.sax.SAXParseException; lineNumber: 406; columnNumber: 6; 注释中不允许出现字符串 "--"。 at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:53) at com.ibatis.sqlmap.engine.builder.xml.SqlMapParser.parse(SqlMapParser.java:45) at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser$11.process(SqlMapConfigParser.java:347) at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:112) at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:75) at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:93) at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:63) at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:51) at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigParser.java:78) at com.ibatis.sqlmap.client.SqlMapClientBuilder.buildSqlMapClient(SqlMapClientBuilder.java:62) at com.zhuansoo.ibatis.SqlMapConn.<clinit>(SqlMapConn.java:29) at com.zhuansoo.dao.P_userDao.<init>(P_userDao.java:19) at com.zhuansoo.util.UserToPath.<init>(UserToPath.java:22) at com.zhuansoo.util.UserToPath.createUserToPath(UserToPath.java:41) at com.zhuansoo.util.UserToPath.getUserToPath(UserToPath.java:34) at com.zhuansoo.util.UpdateMemoForStartListener.contextInitialized(UpdateMemoForStartListener.java:15) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4791) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:618) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1100) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1618) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722) Caused by: org.xml.sax.SAXParseException; lineNumber: 406; columnNumber: 6; 注释中不允许出现字符串 "--"。 at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:441) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368) at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1388) at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanComment(XMLScanner.java:748) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanComment(XMLDocumentFragmentScannerImpl.java:999) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2913) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:607) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:488) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:835) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123) at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:237) at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:300) at com.ibatis.common.xml.NodeletParser.createDocument(NodeletParser.java:150) at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:50) ... 29 more Caused by: org.xml.sax.SAXParseException; lineNumber: 406; columnNumber: 6; 注释中不允许出现字符串 "--"。 at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:441) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368) at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1388) at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanComment(XMLScanner.java:748) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanComment(XMLDocumentFragmentScannerImpl.java:999) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2913) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:607) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:488) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:835) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123) at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:237) at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:300) at com.ibatis.common.xml.NodeletParser.createDocument(NodeletParser.java:150) at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:50) at com.ibatis.sqlmap.engine.builder.xml.SqlMapParser.parse(SqlMapParser.java:45) at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser$11.process(SqlMapConfigParser.java:347) at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:112) at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:75) at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:93) at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:63) at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:51) at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigParser.java:78) at com.ibatis.sqlmap.client.SqlMapClientBuilder.buildSqlMapClient(SqlMapClientBuilder.java:62) at com.zhuansoo.ibatis.SqlMapConn.<clinit>(SqlMapConn.java:29) at com.zhuansoo.dao.P_userDao.<init>(P_userDao.java:19) at com.zhuansoo.util.UserToPath.<init>(UserToPath.java:22) at com.zhuansoo.util.UserToPath.createUserToPath(UserToPath.java:41) at com.zhuansoo.util.UserToPath.getUserToPath(UserToPath.java:34) at com.zhuansoo.util.UpdateMemoForStartListener.contextInitialized(UpdateMemoForStartListener.java:15) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4791) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:618) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1100) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1618) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722) Caused by: org.xml.sax.SAXParseException; lineNumber: 406; columnNumber: 6; 注释中不允许出现字符串 "--"。 at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:441) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368) at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1388) at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanComment(XMLScanner.java:748) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanComment(XMLDocumentFragmentScannerImpl.java:999) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2913) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:607) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:488) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:835) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123) at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:237) at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:300) at com.ibatis.common.xml.NodeletParser.createDocument(NodeletParser.java:150) at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:50) at com.ibatis.sqlmap.engine.builder.xml.SqlMapParser.parse(SqlMapParser.java:45) at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser$11.process(SqlMapConfigParser.java:347) at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:112) at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:75) at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:93) at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:63) at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:51) at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigParser.java:78) at com.ibatis.sqlmap.client.SqlMapClientBuilder.buildSqlMapClient(SqlMapClientBuilder.java:62) at com.zhuansoo.ibatis.SqlMapConn.<clinit>(SqlMapConn.java:29) at com.zhuansoo.dao.P_userDao.<init>(P_userDao.java:19) at com.zhuansoo.util.UserToPath.<init>(UserToPath.java:22) at com.zhuansoo.util.UserToPath.createUserToPath(UserToPath.java:41) at com.zhuansoo.util.UserToPath.getUserToPath(UserToPath.java:34) at com.zhuansoo.util.UpdateMemoForStartListener.contextInitialized(UpdateMemoForStartListener.java:15) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4791) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:618) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1100) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1618) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722) 九月 22, 2012 9:25:51 上午 org.apache.catalina.core.StandardContext listenerStart 严重: Exception sending context initialized event to listener instance of class com.zhuansoo.util.UpdateMemoForStartListener java.lang.ExceptionInInitializerError at com.zhuansoo.dao.P_userDao.<init>(P_userDao.java:19) at com.zhuansoo.util.UserToPath.<init>(UserToPath.java:22) at com.zhuansoo.util.UserToPath.createUserToPath(UserToPath.java:41) at com.zhuansoo.util.UserToPath.getUserToPath(UserToPath.java:34) at com.zhuansoo.util.UpdateMemoForStartListener.contextInitialized(UpdateMemoForStartListener.java:15) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4791) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:618) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1100) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1618) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722) Caused by: java.lang.RuntimeException: Error initializing MyAppSqlConfig class. 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: org.xml.sax.SAXParseException; lineNumber: 406; columnNumber: 6; 注释中不允许出现字符串 "--"。 Caused by: org.xml.sax.SAXParseException; lineNumber: 406; columnNumber: 6; 注释中不允许出现字符串 "--"。 Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: org.xml.sax.SAXParseException; lineNumber: 406; columnNumber: 6; 注释中不允许出现字符串 "--"。 Caused by: org.xml.sax.SAXParseException; lineNumber: 406; columnNumber: 6; 注释中不允许出现字符串 "--"。 Caused by: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: org.xml.sax.SAXParseException; lineNumber: 406; columnNumber: 6; 注释中不允许出现字符串 "--"。 Caused by: org.xml.sax.SAXParseException; lineNumber: 406; columnNumber: 6; 注释中不允许出现字符串 "--"。 Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: org.xml.sax.SAXParseException; lineNumber: 406; columnNumber: 6; 注释中不允许出现字符串 "--"。 Caused by: org.xml.sax.SAXParseException; lineNumber: 406; columnNumber: 6; 注释中不允许出现字符串 "--"。 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: org.xml.sax.SAXParseException; lineNumber: 406; columnNumber: 6; 注释中不允许出现字符串 "--"。 Caused by: org.xml.sax.SAXParseException; lineNumber: 406; columnNumber: 6; 注释中不允许出现字符串 "--"。 Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: org.xml.sax.SAXParseException; lineNumber: 406; columnNumber: 6; 注释中不允许出现字符串 "--"。 Caused by: org.xml.sax.SAXParseException; lineNumber: 406; columnNumber: 6; 注释中不允许出现字符串 "--"。 Caused by: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: org.xml.sax.SAXParseException; lineNumber: 406; columnNumber: 6; 注释中不允许出现字符串 "--"。 Caused by: org.xml.sax.SAXParseException; lineNumber: 406; columnNumber: 6; 注释中不允许出现字符串 "--"。 Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: org.xml.sax.SAXParseException; lineNumber: 406; columnNumber: 6; 注释中不允许出现字符串 "--"。 Caused by: org.xml.sax.SAXParseException; lineNumber: 406; columnNumber: 6; 注释中不允许出现字符串 "--"。 at com.zhuansoo.ibatis.SqlMapConn.<clinit>(SqlMapConn.java:32) ... 19 more
ibatis 嵌套查询
我现在有一个表 X 里面有 三个属性 a b c 我想通过 查询表里的c属性得到 b ,再用得到的 b 属性去查 a。 一般的SQL不是这样写吗? select a from x where b=(select b from X where a=?) 请问用ibatis 在配置文件里 如何配置
请教关于ibatis的问题
ibatis里面要使用一对多关系映射时要在xml文件里面要怎么写啊?
something about configuring ibatis.
Hi, Actually my iBatis xml config files are under the classpath so, to include an xml file in the main configuration file (that is under WEB-INF/iBatis folder) I usually write: <sqlMap resource="it/mypakage/Example.xml" /> (and it works) I need to move all my files under WEB-INF/iBatis directory of my web application. I read iBatis manual and tried with the "url" attribute, like this: <sqlMap url="file:///c:/myProject/www/WEB-INF/iBatis/Example.xml" /> and it works! Now I want to make the path relative to the project (and not absolute to my hard drive c: like in the above example). I tried with ; <sqlMap url="file:///WEB-INF/iBatis/Example.xml" /> and <sqlMap url="file:///Example.xml" /> and <sqlMap url="file:Example.xml" /> and and a million of other ways, but it doesn't work What is the correct way to use a relative path with the url attribute?
ibatis连接mysql时读取配置文件出错如何解决?
错误日志如下: 2010-1-6 22:02:03 com.ibatis.common.logging.jdk14.Jdk14LoggingImpl error 严重: SimpleDataSource: Error while loading properties. Cause: java.lang.ClassNotFoundException: jdbc.driverClass java.lang.ClassNotFoundException: jdbc.driverClass at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at com.ibatis.common.resources.Resources.classForName(Resources.java:265) at com.ibatis.common.resources.Resources.instantiate(Resources.java:281) at com.ibatis.common.jdbc.SimpleDataSource.initialize(SimpleDataSource.java:199) at com.ibatis.common.jdbc.SimpleDataSource.<init>(SimpleDataSource.java:116) at com.ibatis.sqlmap.engine.datasource.SimpleDataSourceFactory.initialize(SimpleDataSourceFactory.java:31) at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser$9.process(SqlMapConfigParser.java:347) at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:121) at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:105) at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:102) at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:102) at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:72) at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:51) at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigParser.java:86) at com.ibatis.sqlmap.client.SqlMapClientBuilder.buildSqlMapClient(SqlMapClientBuilder.java:63) at com.itcast.IStudentDAOImpl.<clinit>(IStudentDAOImpl.java:17) java.lang.ExceptionInInitializerError Caused by: java.lang.RuntimeException: Error occurred. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/transactionManager/dataSource/end()'. Cause: com.ibatis.sqlmap.client.SqlMapException: Error initializing DataSource. Could not instantiate DataSourceFactory. Cause: java.lang.RuntimeException: SimpleDataSource: Error while loading properties. Cause: java.lang.ClassNotFoundException: jdbc.driverClass at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigParser.java:89) at com.ibatis.sqlmap.client.SqlMapClientBuilder.buildSqlMapClient(SqlMapClientBuilder.java:63) at com.itcast.IStudentDAOImpl.<clinit>(IStudentDAOImpl.java:17) Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/transactionManager/dataSource/end()'. Cause: com.ibatis.sqlmap.client.SqlMapException: Error initializing DataSource. Could not instantiate DataSourceFactory. Cause: java.lang.RuntimeException: SimpleDataSource: Error while loading properties. Cause: java.lang.ClassNotFoundException: jdbc.driverClass at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:53) at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigParser.java:86) ... 2 more Caused by: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/transactionManager/dataSource/end()'. Cause: com.ibatis.sqlmap.client.SqlMapException: Error initializing DataSource. Could not instantiate DataSourceFactory. Cause: java.lang.RuntimeException: SimpleDataSource: Error while loading properties. Cause: java.lang.ClassNotFoundException: jdbc.driverClass at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:123) at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:105) at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:102) at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:102) at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:72) at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:51) ... 3 more Caused by: com.ibatis.sqlmap.client.SqlMapException: Error initializing DataSource. Could not instantiate DataSourceFactory. Cause: java.lang.RuntimeException: SimpleDataSource: Error while loading properties. Cause: java.lang.ClassNotFoundException: jdbc.driverClass at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser$9.process(SqlMapConfigParser.java:354) at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:121) ... 8 more Caused by: java.lang.RuntimeException: SimpleDataSource: Error while loading properties. Cause: java.lang.ClassNotFoundException: jdbc.driverClass at com.ibatis.common.jdbc.SimpleDataSource.initialize(SimpleDataSource.java:210) at com.ibatis.common.jdbc.SimpleDataSource.<init>(SimpleDataSource.java:116) at com.ibatis.sqlmap.engine.datasource.SimpleDataSourceFactory.initialize(SimpleDataSourceFactory.java:31) at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser$9.process(SqlMapConfigParser.java:347) ... 9 more Caused by: java.lang.ClassNotFoundException: jdbc.driverClass at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at com.ibatis.common.resources.Resources.classForName(Resources.java:265) at com.ibatis.common.resources.Resources.instantiate(Resources.java:281) at com.ibatis.common.jdbc.SimpleDataSource.initialize(SimpleDataSource.java:199) ... 12 more Exception in thread "main" ---------------------------------------------------------------------------------------- SqlMapConfig.xml文件内容如下: <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE sqlMapConfig PUBLIC "-//ibatis.apache.org//DTD SQL Map Config 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-config-2.dtd"> <sqlMapConfig> <properties resource="com/itcast/SqlMap.properties" /> <transactionManager type="JDBC"> <dataSource type="SIMPLE"> <property name="JDBC.Driver" value="${jdbc.driverClass}" /> <property name="JDBC.ConnectionURL" value="${jdbc.url}" /> <property name="JDBC.Username" value="${jdbc.user}" /> <property name="JDBC.Password" value="${jdbc.password}" /> </dataSource> </transactionManager> <sqlMap resource="com/itcast/Student.xml"/> </sqlMapConfig> ---------------------------------------------------------------------------------------- SqlMap.properties文件内容如下: driver=com.mysql.jdbc.Driver url=jdbc:mysql://localhost:3306/test username=root password=123456 ------------------------------------------------------ 如果不使用SqlMap.properties文件,而将driver、url、username、password的值直接写入SqlMapConfig.xml文件中,则程序可以正常通过。 请大家帮忙解决如何读取这个SqlMap.properties配置文件问题。
这Ibatis更新语句,该怎么写?
比方我的java bean 名字叫user 定义三个属性 ID name pwd add 对应数据库的表为 table 列名 ID NAME PWD ADD 当我更新时 我只要根据ID更新 pwd 和add 正常在sql中 写成 update table set pwd=? set add=? where ID=? 我在Ibatis中这样写 <update id="updateUser" parameterClass="user"> update table set ID=#ID#, NAME=#name#,PWD=#pwd#,ADD=#add# where ID=#ID# </update> 我只能先在数据库中根据ID查出user 然后根据前台输入获取pwd 和add 并且set到user中,ID和name的值仍是数据库中的值没变,最后通过 这个ibatis语句 把user 给update,我刚学对ibatis机制还是不太了解,不知道这样对不对。?? 其实我想问 能不能只设置需要更新的 2个字段,它能不能自动找到java bean中的属性 进行匹配。就像下面: <update id="updateUser" parameterClass="user"> update table set PWD=#pwd#,ADD=#add# where ID=#ID# </update> 这样能不能更新成功呢,谢谢指点~~~!!!
ibatis查询结果映射的问题
问题描述: 我使用的ibatis框架,现在有两个类,一个User一个Template,多对一的关系,即一个用户只能选择一个模板,一个模板可以被多个用户选择。 User.class [code="java"] public class User { private Long userId; private String email; private String username; private String password; private Template template; //getters and setters... } [/code] Template.class [code="java"] public class Template { private Long templateId; private String name; //getters and setters... } [/code] resultMap [code="xml"] <sqlMap namespace="Template"> <resultMap id="base" class="Template"> <result column="template_id" property="templateId" /> <result column="name" property="name" /> <result column="path" property="path" /> </resultMap> </sqlMap> <sqlMap namespace="User"> <resultMap id="base" class="User"> <result column="user_id" property="userId" /> <result column="email" property="email" /> <result column="username" property="username" /> <result column="password" property="password" /> <result property="template" resultMap="Template.base" /> </resultMap> <select id="loginByUsername" parameterClass="User" resultMap="base"> <![CDATA[ select user_id, template_id, email, username, password from user as u where u.password = #password# and u.username = #username# ]]> </select> </sqlMap> [/code] 如果是这样设置,运行loginByUsername会有以下异常: [code="java"] Exception in thread "main" com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred in net/ing100/microblog/po/mapping/Template.xml. --- The error occurred while applying a result map. --- Check the Template.base. --- Check the result mapping for the 'name' property. --- Cause: com.ibatis.sqlmap.client.SqlMapException: Error getting nested result map values for 'template'. Cause: java.sql.SQLException: Column 'name' not found. at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryWithCallback(MappedStatement.java:204) at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryForObject(MappedStatement.java:120) at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:518) at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:493) at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObject(SqlMapSessionImpl.java:106) at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForObject(SqlMapClientImpl.java:82) at net.ing100.microblog.dao.impl.UserDAOImpl.loginByEmail(UserDAOImpl.java:12) at net.ing100.microblog.test.dao.TestUserDAO.main(TestUserDAO.java:32) Caused by: com.ibatis.sqlmap.client.SqlMapException: Error getting nested result map values for 'template'. Cause: java.sql.SQLException: Column 'name' not found. at com.ibatis.sqlmap.engine.mapping.result.ResultMap.setNestedResultMappingValue(ResultMap.java:467) at com.ibatis.sqlmap.engine.mapping.result.ResultMap.applyNestedResultMap(ResultMap.java:395) at com.ibatis.sqlmap.engine.mapping.result.ResultMap.setResultObjectValues(ResultMap.java:380) at com.ibatis.sqlmap.engine.mapping.statement.RowHandlerCallback.handleResultObject(RowHandlerCallback.java:64) at com.ibatis.sqlmap.engine.execution.SqlExecutor.handleResults(SqlExecutor.java:385) at com.ibatis.sqlmap.engine.execution.SqlExecutor.handleMultipleResults(SqlExecutor.java:300) at com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQuery(SqlExecutor.java:189) at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.sqlExecuteQuery(MappedStatement.java:221) at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryWithCallback(MappedStatement.java:189) ... 7 more Caused by: java.sql.SQLException: Column 'name' not found. at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926) at com.mysql.jdbc.ResultSetImpl.findColumn(ResultSetImpl.java:1093) at com.mysql.jdbc.ResultSetImpl.getString(ResultSetImpl.java:5488) at com.mchange.v2.c3p0.impl.NewProxyResultSet.getString(NewProxyResultSet.java:3342) at com.ibatis.sqlmap.engine.type.StringTypeHandler.getResult(StringTypeHandler.java:35) at com.ibatis.sqlmap.engine.mapping.result.ResultMap.getPrimitiveResultMappingValue(ResultMap.java:619) at com.ibatis.sqlmap.engine.mapping.result.ResultMap.getResults(ResultMap.java:345) at com.ibatis.sqlmap.engine.mapping.result.ResultMap.setNestedResultMappingValue(ResultMap.java:454) ... 15 more [/code] 请问像这种查询,template_id如何装配到template.templateId中去,并且不要出什么column'name'的异常?
Ibatis typeHandler问题
在配置IbatiS 全局typeHandler时, 在<typeHandler javaType="java.lang.String" callback="com.mht.test.GenderTypeHandlerCallback" />中如果添加了jdbcType="java.sql.Clob" ,所写的转换类则无法执行,请问是什么原因?
动态规划入门到熟悉,看不懂来打我啊
持续更新。。。。。。 2.1斐波那契系列问题 2.2矩阵系列问题 2.3跳跃系列问题 3.1 01背包 3.2 完全背包 3.3多重背包 3.4 一些变形选讲 2.1斐波那契系列问题 在数学上,斐波纳契数列以如下被以递归的方法定义:F(0)=0,F(1)=1, F(n)=F(n-1)+F(n-2)(n&gt;=2,n∈N*)根据定义,前十项为1, 1, 2, 3...
130 个相见恨晚的超实用网站,一次性分享出来
相见恨晚的超实用网站 持续更新中。。。
Java学习的正确打开方式
在博主认为,对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结,前三者博主将淋漓尽致地挥毫于这篇博客文章中,至于总结在于个人,实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次就是国内的书籍,博客次之,这又是一个层次了,这里暂时不提后面再谈。博主将为各位入门java保驾护航,各位只管冲鸭!!!上天是公平的,只要不辜负时间,时间自然不会辜负你。 何谓学习?博主所理解的学习,它是一个过程,是一个不断累积、不断沉淀、不断总结、善于传达自己的个人见解以及乐于分享的过程。
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过...
Python——画一棵漂亮的樱花树(不同种樱花+玫瑰+圣诞树喔)
最近翻到一篇知乎,上面有不少用Python(大多是turtle库)绘制的树图,感觉很漂亮,我整理了一下,挑了一些我觉得不错的代码分享给大家(这些我都测试过,确实可以生成) one 樱花树 动态生成樱花 效果图(这个是动态的): 实现代码 import turtle as T import random import time # 画樱花的躯干(60,t) def Tree(branch, ...
大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了
大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...
为啥国人偏爱Mybatis,而老外喜欢Hibernate/JPA呢?
关于SQL和ORM的争论,永远都不会终止,我也一直在思考这个问题。昨天又跟群里的小伙伴进行了一番讨论,感触还是有一些,于是就有了今天这篇文。 声明:本文不会下关于Mybatis和JPA两个持久层框架哪个更好这样的结论。只是摆事实,讲道理,所以,请各位看官勿喷。 一、事件起因 关于Mybatis和JPA孰优孰劣的问题,争论已经很多年了。一直也没有结论,毕竟每个人的喜好和习惯是大不相同的。我也看...
我在支付宝花了1分钟,查到了女朋友的开房记录!
在大数据时代下,不管你做什么都会留下蛛丝马迹,只要学会把各种软件运用到极致,捉奸简直轻而易举。今天就来给大家分享一下,什么叫大数据抓出轨。据史料证明,马爸爸年轻时曾被...
shell脚本:备份数据库、代码上线
备份MySQL数据库 场景: 一台MySQL服务器,跑着5个数据库,在没有做主从的情况下,需要对这5个库进行备份 需求: 1)每天备份一次,需要备份所有的库 2)把备份数据存放到/data/backup/下 3)备份文件名称格式示例:dbname-2019-11-23.sql 4)需要对1天以前的所有sql文件压缩,格式为gzip 5)本地数据保留1周 6)需要把备份的数据同步到远程备份中心,假如...
聊聊C语言和指针的本质
坐着绿皮车上海到杭州,24块钱,很宽敞,在火车上非正式地聊几句。 很多编程语言都以 “没有指针” 作为自己的优势来宣传,然而,对于C语言,指针却是与生俱来的。 那么,什么是指针,为什么大家都想避开指针。 很简单, 指针就是地址,当一个地址作为一个变量存在时,它就被叫做指针,该变量的类型,自然就是指针类型。 指针的作用就是,给出一个指针,取出该指针指向地址处的值。为了理解本质,我们从计算机模型说起...
为什么你学不过动态规划?告别动态规划,谈谈我的经验
动态规划难吗?说实话,我觉得很难,特别是对于初学者来说,我当时入门动态规划的时候,是看 0-1 背包问题,当时真的是一脸懵逼。后来,我遇到动态规划的题,看的懂答案,但就是自己不会做,不知道怎么下手。就像做递归的题,看的懂答案,但下不了手,关于递归的,我之前也写过一篇套路的文章,如果对递归不大懂的,强烈建议看一看:为什么你学不会递归,告别递归,谈谈我的经验 对于动态规划,春招秋招时好多题都会用到动态...
程序员一般通过什么途径接私活?
二哥,你好,我想知道一般程序猿都如何接私活,我也想接,能告诉我一些方法吗? 上面是一个读者“烦不烦”问我的一个问题。其实不止是“烦不烦”,还有很多读者问过我类似这样的问题。 我接的私活不算多,挣到的钱也没有多少,加起来不到 20W。说实话,这个数目说出来我是有点心虚的,毕竟太少了,大家轻喷。但我想,恰好配得上“一般程序员”这个称号啊。毕竟苍蝇再小也是肉,我也算是有经验的人了。 唾弃接私活、做外...
字节跳动面试官这样问消息队列:分布式事务、重复消费、顺序消费,我整理了一下
你知道的越多,你不知道的越多 点赞再看,养成习惯 GitHub上已经开源 https://github.com/JavaFamily 有一线大厂面试点脑图、个人联系方式和人才交流群,欢迎Star和完善 前言 消息队列在互联网技术存储方面使用如此广泛,几乎所有的后端技术面试官都要在消息队列的使用和原理方面对小伙伴们进行360°的刁难。 作为一个在互联网公司面一次拿一次Offer的面霸...
2020年大前端发展趋势
迅速发展的前端开发,在每⼀年,都为开发者带来了新的关键词。2019 年已步⼊尾声,2020 年前端发展的关键词⼜将有哪些呢?发展的方向又会是什么呢?参考2019年大前端的发展,不出意外,前端依旧会围绕⼩程序、超级APP、跨端开发、前端⼯程化以及新技术运用等几个方面进行展开(可以参考2019年大前端技术趋势深度解读)。 小程序 在⼩程序⽅⾯,今年仍然是⼩程序突⻜猛进的⼀年,各⼤主流的 App 都上线...
如何安装 IntelliJ IDEA 最新版本——详细教程
IntelliJ IDEA 简称 IDEA,被业界公认为最好的 Java 集成开发工具,尤其在智能代码助手、代码自动提示、代码重构、代码版本管理(Git、SVN、Maven)、单元测试、代码分析等方面有着亮眼的发挥。IDEA 产于捷克,开发人员以严谨著称的东欧程序员为主。IDEA 分为社区版和付费版两个版本。 我呢,一直是 Eclipse 的忠实粉丝,差不多十年的老用户了。很早就接触到了 IDEA...
1个月时间整理了2019年上千道Java面试题,近500页文档!
Spring 面试题 1、一般问题 1.1、不同版本的 spring Framework 有哪些主要功能? 1.2、什么是 spring Framework? 1.3、列举 spring Framework 的优点。 1.4、spring Framework 有哪些不同的功能? 1.5、spring Framework 中有多少个模块,它们分别是什么? 1.6、什么是 spring ...
面试还搞不懂redis,快看看这40道面试题(含答案和思维导图)
Redis 面试题 1、什么是 Redis?. 2、Redis 的数据类型? 3、使用 Redis 有哪些好处? 4、Redis 相比 Memcached 有哪些优势? 5、Memcache 与 Redis 的区别都有哪些? 6、Redis 是单进程单线程的? 7、一个字符串类型的值能存储最大容量是多少? 8、Redis 的持久化机制是什么?各自的优缺点? 9、Redis 常见性...
为什么要推荐大家学习字节码?
配套视频: 为什么推荐大家学习Java字节码 https://www.bilibili.com/video/av77600176/ 一、背景 本文主要探讨:为什么要学习 JVM 字节码? 可能很多人会觉得没必要,因为平时开发用不到,而且不学这个也没耽误学习。 但是这里分享一点感悟,即人总是根据自己已经掌握的知识和技能来解决问题的。 这里有个悖论,有时候你觉得有些技术没用恰恰是...
在阿里,40岁的奋斗姿势
在阿里,40岁的奋斗姿势 在阿里,什么样的年纪可以称为老呢?35岁? 在云网络,有这样一群人,他们的平均年龄接近40,却刚刚开辟职业生涯的第二战场。 他们的奋斗姿势是什么样的呢? 洛神赋 “翩若惊鸿,婉若游龙。荣曜秋菊,华茂春松。髣髴兮若轻云之蔽月,飘飖兮若流风之回雪。远而望之,皎若太阳升朝霞;迫而察之,灼若芙蕖出渌波。” 爱洛神,爱阿里云 2018年,阿里云网络产品部门启动洛神2.0升...
【超详细分析】关于三次握手与四次挥手面试官想考我们什么?
在面试中,三次握手和四次挥手可以说是问的最频繁的一个知识点了,我相信大家也都看过很多关于三次握手与四次挥手的文章,今天的这篇文章,重点是围绕着面试,我们应该掌握哪些比较重要的点,哪些是比较被面试官给问到的,我觉得如果你能把我下面列举的一些点都记住、理解,我想就差不多了。 三次握手 当面试官问你为什么需要有三次握手、三次握手的作用、讲讲三次三次握手的时候,我想很多人会这样回答: 首先很多人会先讲下握...
压测学习总结(1)——高并发性能指标:QPS、TPS、RT、吞吐量详解
一、QPS,每秒查询 QPS:Queries Per Second意思是“每秒查询率”,是一台服务器每秒能够相应的查询次数,是对一个特定的查询服务器在规定时间内所处理流量多少的衡量标准。互联网中,作为域名系统服务器的机器的性能经常用每秒查询率来衡量。 二、TPS,每秒事务 TPS:是TransactionsPerSecond的缩写,也就是事务数/秒。它是软件测试结果的测量单位。一个事务是指一...
新程序员七宗罪
当我发表这篇文章《为什么每个工程师都应该开始考虑开发中的分析和编程技能呢?》时,我从未想到它会对读者产生如此积极的影响。那些想要开始探索编程和数据科学领域的人向我寻求建议;还有一些人问我下一篇文章的发布日期;还有许多人询问如何顺利过渡到这个职业。我非常鼓励大家继续分享我在这个旅程的经验,学习,成功和失败,以帮助尽可能多的人过渡到一个充满无数好处和机会的职业生涯。亲爱的读者,谢谢你。 -罗伯特。 ...
活到老,学到老,程序员也该如此
全文共2763字,预计学习时长8分钟 图片来源:Pixabay 此前,“网传阿里巴巴要求尽快实现P8全员35周岁以内”的消息闹得沸沸扬扬。虽然很快被阿里辟谣,但苍蝇不叮无缝的蛋,无蜜不招彩蝶蜂。消息从何而来?真相究竟怎样?我们无从而知。我们只知道一个事实:不知从何时开始,程序猿也被划在了“吃青春饭”行业之列。 饱受“996ICU”摧残后,好不容易“头秃了变强了”,即将步入为“高...
Vue快速实现通用表单验证
本文开篇第一句话,想引用鲁迅先生《祝福》里的一句话,那便是:“我真傻,真的,我单单知道后端整天都是CRUD,我没想到前端整天都是Form表单”。这句话要从哪里说起呢?大概要从最近半个月的“全栈工程师”说起。项目上需要做一个城市配载的功能,顾名思义,就是通过框选和拖拽的方式在地图上完成配载。博主选择了前后端分离的方式,在这个过程中发现:首先,只要有依赖jQuery的组件,譬如Kendoui,即使使用...
2019年Spring Boot面试都问了什么?快看看这22道面试题!
Spring Boot 面试题 1、什么是 Spring Boot? 2、Spring Boot 有哪些优点? 3、什么是 JavaConfig? 4、如何重新加载 Spring Boot 上的更改,而无需重新启动服务器? 5、Spring Boot 中的监视器是什么? 6、如何在 Spring Boot 中禁用 Actuator 端点安全性? 7、如何在自定义端口上运行 Sprin...
Unity项目在pc和ios设备上黑屏的原因探究
0x00 由于项目上线了windows平台的项目(别问我为什么,咱也不敢说,咱也不敢问),由Unity5.4.6升级到Unity2018的过程中,遇到了各种各样的坑,本文为避坑指南1。本项目没有使用HDR和抗锯齿,由于查这几个问题查到吐血,前后用了3天的时间,本文充满了怨气,行文非常啰嗦,需要快速解决问题的,可以直接拉到最后看结论。 0x01 法线贴图 项目在unity2018出了新的androi...
关于裁员几点看法及建议
最近网易裁员事件引起广泛关注,昨天网易针对此事,也发了声明,到底谁对谁错,孰是孰非?我们作为吃瓜观众实在是知之甚少,所以不敢妄下定论。身处软件开发这个行业,近一两年来,对...
面试官:关于Java性能优化,你有什么技巧
通过使用一些辅助性工具来找到程序中的瓶颈,然后就可以对瓶颈部分的代码进行优化。 一般有两种方案:即优化代码或更改设计方法。我们一般会选择后者,因为不去调用以下代码要比调用一些优化的代码更能提高程序的性能。而一个设计良好的程序能够精简代码,从而提高性能。 下面将提供一些在JAVA程序的设计和编码中,为了能够提高JAVA程序的性能,而经常采用的一些方法和技巧。 1.对象的生成和大小的调整。 J...
【图解算法面试】记一次面试:说说游戏中的敏感词过滤是如何实现的?
版权声明:本文为苦逼的码农原创。未经同意禁止任何形式转载,特别是那些复制粘贴到别的平台的,否则,必定追究。欢迎大家多多转发,谢谢。 小秋今天去面试了,面试官问了一个与敏感词过滤算法相关的问题,然而小秋对敏感词过滤算法一点也没听说过。于是,有了下下事情的发生… 面试官开怼 面试官:玩过王者荣耀吧?了解过敏感词过滤吗?,例如在游戏里,如果我们发送“你在干嘛?麻痹演员啊你?”,由于“麻痹”是一个敏感词,...
相关热词 c# 数组类型 泛型约束 c#的赛狗日程序 c# 传递数组 可变参数 c# 生成存储过程 c# list 补集 c#获得所有窗体 c# 当前秒数转成年月日 c#中的枚举 c# 计算校验和 连续随机数不重复c#
立即提问