Hi, I'm encountering a strange problem when configuring cache in iBATIS XML file. When I added <flushOnExecute> statement in cache model and use it in one of statements (see high lighted text), it generated an XML parsing exception during iBATIS initialization and stated that there is no statement name insertCacRecord. If I removed <flushOnExecute>, then it worked fine. I'm using iBATIS 2. Below are my iBATIS XML SQL map file and exception message. Do you know what I'm missing? Thanks in advance for your help! Tuan <?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 <http://ibatis.apache.org/dtd/sql-map-2.dtd> "> <sqlMap namespace="Maintenance"> <typeAlias alias="codeObject" type="com.alcon.eziqs.vo.CodeVo" />
<cacheModel id="cac-cache" type="LRU"> <flushInterval hours="24" /> <flushOnExecute statement="insertCacRecord" /> <property name="size" value="50" /> </cacheModel> <!-- ======================================== --> <!-- get all active CAC records --> <!-- ======================================== --> <select id="getAllCacRecords" resultClass="codeObject" cacheModel="cac-cache"> <![CDATA[ SELECT CG.F_NAME AS "category.name", CD.F_CAC AS "recordId", CD.F_NAME AS "name", CD.F_TEXT AS "description", EI.F_NAME AS "lastUpdatedBy", DATEADD(second, CD.F_EDTM, '01/01/1970 00:00:00.000') AS "lastUpdatedDate" FROM IQS.dbo.CAC_DAT CD JOIN IQS.dbo.CAC_GRP CG ON CD.F_CAGP=CG.F_CAGP JOIN IQS.dbo.EMPL_INF EI ON CD.F_USER=EI.F_EMPL $whereOrderByClauseStr$ ]]> </select> <!-- ======================================== --> <!-- insert CAC record --> <!-- ======================================== --> <insert id="insertCacRecord" parameterClass="codeObject"> INSERT INTO IQS.dbo.CAC_DAT(F_CAC, F_CRTM, F_EDTM, F_CAGP, F_NAME, F_TEXT, F_FCTR, F_USER, F_DSBL, F_RFC) VALUES (DATEDIFF(second, '01/01/1970 00:00:00.000', GETDATE()), DATEDIFF(second, '01/01/1970 00:00:00.000', GETDATE()), DATEDIFF(second, '01/01/1970 00:00:00.000', GETDATE()), #category.recordId#, #name#, #description#, 1, #lastUpdatedByIqsUserId#, 0, 0) </insert> <!-- ======================================== --> <!-- update CAC record --> <!-- ======================================== --> <update id="updateCacRecord" parameterClass="codeObject" > UPDATE IQS.dbo.CAC_DAT SET F_NAME = #name#, F_CAGP = #category.recordId#, F_TEXT = #description#, F_USER = #lastUpdatedByIqsUserId#, F_EDTM = DATEDIFF(second, '01/01/1970 00:00:00.000', GETDATE()) WHERE F_CAC = #recordId# </update> <!-- ======================================== --> <!-- Insert a CAC record in audit tail table --> <!-- ======================================== --> <insert id="insertCacAuditRecord" parameterClass="java.lang.Integer" > INSERT INTO IQS.dbo.CAC_DAT_T SELECT * FROM IQS.dbo.CAC_DAT WHERE F_CAC = #value# </insert> </sqlMap> --- ERROR --- 500 Internal Server Error java.lang.ExceptionInInitializerError: java.lang.RuntimeException at com.alcon.eziqs.service.SecurityService.<init>(SecurityService.java:37) at com.alcon.eziqs.action.LoginAction.<clinit>(LoginAction.java:38) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorA ccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingCons tructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:494) at java.lang.Class.newInstance0(Class.java:350) at java.lang.Class.newInstance(Class.java:303) at org.apache.struts.util.RequestUtils.applicationInstance(RequestUtils.jav a:143) at org.apache.struts.action.RequestProcessor.processActionCreate(RequestPro cessor.java:292) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java: 230) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:416) at javax.servlet.http.HttpServlet.service(HttpServlet.java:743) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.j ava:719) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDis patcher.java:376) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.jav a:870) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java: 451) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java :218) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:119) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:112) at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocke tReadHandler.java:260) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourceP ooledExecutor.java:303) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.RuntimeException: Description. Cause: java.lang.RuntimeException: Could not initialize DaoConfig. Cause: com.ibatis.dao.client.DaoException: Error while configuring DaoManager. Cause: com.ibatis.common.exception.NestedRuntimeException: Error occurred. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/end()'. Cause: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/end()'. Cause: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/end()'. Cause: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/end()'. Cause: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.common.exception.NestedRuntimeException: Error occurred. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/end()'. Cause: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/end()'. Cause: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/end()'. Cause: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/end()'. Cause: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. at com.alcon.eziqs.persistence.DaoFactory.<clinit>(DaoFactory.java:30) ... 25 more Caused by: java.lang.RuntimeException: Could not initialize DaoConfig. Cause: com.ibatis.dao.client.DaoException: Error while configuring DaoManager. Cause: com.ibatis.common.exception.NestedRuntimeException: Error occurred. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/end()'. Cause: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/end()'. Cause: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/end()'. Cause: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/end()'. Cause: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.common.exception.NestedRuntimeException: Error occurred. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/end()'. Cause: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/end()'. Cause: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/end()'. Cause: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/end()'. Cause: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. at com.alcon.eziqs.persistence.DaoFactory.newDaoManager(DaoFactory.java:43) at com.alcon.eziqs.persistence.DaoFactory.<clinit>(DaoFactory.java:28) ... 25 more Caused by: com.ibatis.dao.client.DaoException: Error while configuring DaoManager. Cause: com.ibatis.common.exception.NestedRuntimeException: Error occurred. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/end()'. Cause: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/end()'. Cause: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/end()'. Cause: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/end()'. Cause: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.common.exception.NestedRuntimeException: Error occurred. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/end()'. Cause: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/end()'. Cause: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/end()'. Cause: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/end()'. Cause: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. at com.ibatis.dao.engine.builder.xml.XmlDaoManagerBuilder.buildDaoManager(X mlDaoManagerBuilder.java:129) at com.ibatis.dao.engine.builder.xml.XmlDaoManagerBuilder.buildDaoManager(X mlDaoManagerBuilder.java:78) at com.ibatis.dao.client.DaoManagerBuilder.buildDaoManager(DaoManagerBuilde r.java:49) at com.alcon.eziqs.persistence.DaoFactory.newDaoManager(DaoFactory.java:41) ... 26 more Caused by: com.ibatis.common.exception.NestedRuntimeException: Error occurred. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/end()'. Cause: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/end()'. Cause: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/end()'. Cause: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/end()'. Cause: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConf igParser.java:81) at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConf igParser.java:68) at com.ibatis.sqlmap.client.SqlMapClientBuilder.buildSqlMapClient(SqlMapCli entBuilder.java:78) at com.ibatis.dao.engine.transaction.sqlmap.SqlMapDaoTransactionManager.con figure(SqlMapDaoTransactionManager.java:52) at com.ibatis.dao.engine.builder.xml.XmlDaoManagerBuilder.parseTransactionM anager(XmlDaoManagerBuilder.java:193) at com.ibatis.dao.engine.builder.xml.XmlDaoManagerBuilder.parseContext(XmlD aoManagerBuilder.java:157) at com.ibatis.dao.engine.builder.xml.XmlDaoManagerBuilder.buildDaoManager(X mlDaoManagerBuilder.java:102) ... 29 more Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/end()'. Cause: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/end()'. Cause: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:53) at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConf igParser.java:78) ... 35 more Caused by: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/end()'. Cause: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. Caused by: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:11 4) at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:96) at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:64) at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:51) ... 36 more Caused by: com.ibatis.sqlmap.client.SqlMapException: There is no statement named insertCacRecord in this SqlMap. at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.getMappedStatement( SqlMapExecutorDelegate.java:288) at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser$1.process(SqlMap ConfigParser.java:96) at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:11 2) ... 39 more This e-mail (including any attachments) is confidential and may be legally privileged. If you are not an intended recipient or an authorized representative of an intended recipient, you are prohibited from using, copying or distributing the information in this e-mail or its attachments. If you have received this e-mail in error, please notify the sender immediately by return e-mail and delete all copies of this message and any attachments. Thank you.