Sql fragments don´t use namespaces ---------------------------------- Key: IBATIS-41 URL: http://issues.apache.org/jira/browse/IBATIS-41 Project: iBatis for Java Type: Bug Components: SQL Maps Versions: 2.0.9 Reporter: Peter Köhler Priority: Minor
If You use namespaces and try to include a sql fragment referenced by its fully qualified name an exception is thrown. Everything works fine if the sql fragments are referenced in a "flat" way. Actually i don´t know if this is a bug or a feature but i assume it to be a bug ;) Greetings from Frankfurt Peter Köhler ===================================== The Stacktrace: com.ibatis.dao.client.DaoException: Error while configuring DaoManager. Cause: java.lang.RuntimeException: Error occurred. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMap/select'. Cause: java.lang.RuntimeException: Could not find SQL statement to include with refid 'Fragment.beforeSortedPaging' Caused by: java.lang.RuntimeException: Error parsing XPath '/sqlMap/select'. Cause: java.lang.RuntimeException: Could not find SQL statement to include with refid 'Fragment.beforeSortedPaging' Caused by: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMap/select'. Cause: java.lang.RuntimeException: Could not find SQL statement to include with refid 'Fragment.beforeSortedPaging' Caused by: java.lang.RuntimeException: Error parsing XPath '/sqlMap/select'. Cause: java.lang.RuntimeException: Could not find SQL statement to include with refid 'Fragment.beforeSortedPaging' Caused by: java.lang.RuntimeException: Error occurred. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMap/select'. Cause: java.lang.RuntimeException: Could not find SQL statement to include with refid 'Fragment.beforeSortedPaging' Caused by: java.lang.RuntimeException: Error parsing XPath '/sqlMap/select'. Cause: java.lang.RuntimeException: Could not find SQL statement to include with refid 'Fragment.beforeSortedPaging' Caused by: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMap/select'. Cause: java.lang.RuntimeException: Could not find SQL statement to include with refid 'Fragment.beforeSortedPaging' Caused by: java.lang.RuntimeException: Error parsing XPath '/sqlMap/select'. Cause: java.lang.RuntimeException: Could not find SQL statement to include with refid 'Fragment.beforeSortedPaging' at com.ibatis.dao.engine.builder.xml.XmlDaoManagerBuilder.buildDaoManager(XmlDaoManagerBuilder.java:126) at com.ibatis.dao.engine.builder.xml.XmlDaoManagerBuilder.buildDaoManager(XmlDaoManagerBuilder.java:76) at com.ibatis.dao.client.DaoManagerBuilder.buildDaoManager(DaoManagerBuilder.java:49) at com.awaro.app.fox.common.FoxInitializer.initDaoManager(FoxInitializer.java:61) at com.awaro.app.fox.common.FoxInitializer.initialize(FoxInitializer.java:40) at com.awaro.app.fox.bb.ibatis.test.SqlMapConfigTest.testSqlMapConfig(SqlMapConfigTest.java:46) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:421) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:305) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:186) Caused by: java.lang.RuntimeException: Error occurred. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMap/select'. Cause: java.lang.RuntimeException: Could not find SQL statement to include with refid 'Fragment.beforeSortedPaging' Caused by: java.lang.RuntimeException: Error parsing XPath '/sqlMap/select'. Cause: java.lang.RuntimeException: Could not find SQL statement to include with refid 'Fragment.beforeSortedPaging' Caused by: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMap/select'. Cause: java.lang.RuntimeException: Could not find SQL statement to include with refid 'Fragment.beforeSortedPaging' Caused by: java.lang.RuntimeException: Error parsing XPath '/sqlMap/select'. Cause: java.lang.RuntimeException: Could not find SQL statement to include with refid 'Fragment.beforeSortedPaging' at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigParser.java:80) at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigParser.java:68) at com.ibatis.sqlmap.client.SqlMapClientBuilder.buildSqlMapClient(SqlMapClientBuilder.java:78) at com.ibatis.dao.engine.transaction.sqlmap.SqlMapDaoTransactionManager.configure(SqlMapDaoTransactionManager.java:52) at com.ibatis.dao.engine.builder.xml.XmlDaoManagerBuilder.parseTransactionManager(XmlDaoManagerBuilder.java:190) at com.ibatis.dao.engine.builder.xml.XmlDaoManagerBuilder.parseContext(XmlDaoManagerBuilder.java:154) at com.ibatis.dao.engine.builder.xml.XmlDaoManagerBuilder.buildDaoManager(XmlDaoManagerBuilder.java:99) ... 20 more Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMap/select'. Cause: java.lang.RuntimeException: Could not find SQL statement to include with refid 'Fragment.beforeSortedPaging' Caused by: java.lang.RuntimeException: Error parsing XPath '/sqlMap/select'. Cause: java.lang.RuntimeException: Could not find SQL statement to include with refid 'Fragment.beforeSortedPaging' Caused by: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMap/select'. Cause: java.lang.RuntimeException: Could not find SQL statement to include with refid 'Fragment.beforeSortedPaging' Caused by: java.lang.RuntimeException: Error parsing XPath '/sqlMap/select'. Cause: java.lang.RuntimeException: Could not find SQL statement to include with refid 'Fragment.beforeSortedPaging' at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:51) at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigParser.java:77) ... 26 more Caused by: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMap/select'. Cause: java.lang.RuntimeException: Could not find SQL statement to include with refid 'Fragment.beforeSortedPaging' Caused by: java.lang.RuntimeException: Error parsing XPath '/sqlMap/select'. Cause: java.lang.RuntimeException: Could not find SQL statement to include with refid 'Fragment.beforeSortedPaging' at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:112) at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:73) at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:91) at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:61) at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:49) ... 27 more Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMap/select'. Cause: java.lang.RuntimeException: Could not find SQL statement to include with refid 'Fragment.beforeSortedPaging' Caused by: java.lang.RuntimeException: Error parsing XPath '/sqlMap/select'. Cause: java.lang.RuntimeException: Could not find SQL statement to include with refid 'Fragment.beforeSortedPaging' at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:51) at com.ibatis.sqlmap.engine.builder.xml.SqlMapParser.parse(SqlMapParser.java:45) at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser$12.process(SqlMapConfigParser.java:351) at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:110) ... 31 more Caused by: java.lang.RuntimeException: Error parsing XPath '/sqlMap/select'. Cause: java.lang.RuntimeException: Could not find SQL statement to include with refid 'Fragment.beforeSortedPaging' at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:112) at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:73) at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:91) at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:61) at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:49) ... 34 more Caused by: java.lang.RuntimeException: Could not find SQL statement to include with refid 'Fragment.beforeSortedPaging' at com.ibatis.sqlmap.engine.builder.xml.SqlStatementParser.parseDynamicTags(SqlStatementParser.java:211) at com.ibatis.sqlmap.engine.builder.xml.SqlStatementParser.processSqlStatement(SqlStatementParser.java:166) at com.ibatis.sqlmap.engine.builder.xml.SqlStatementParser.parseGeneralStatement(SqlStatementParser.java:131) at com.ibatis.sqlmap.engine.builder.xml.SqlMapParser$19.process(SqlMapParser.java:429) at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:110) ... 38 more Caused by: java.lang.RuntimeException: Error occurred. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMap/select'. Cause: java.lang.RuntimeException: Could not find SQL statement to include with refid 'Fragment.beforeSortedPaging' Caused by: java.lang.RuntimeException: Error parsing XPath '/sqlMap/select'. Cause: java.lang.RuntimeException: Could not find SQL statement to include with refid 'Fragment.beforeSortedPaging' Caused by: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMap/select'. Cause: java.lang.RuntimeException: Could not find SQL statement to include with refid 'Fragment.beforeSortedPaging' Caused by: java.lang.RuntimeException: Error parsing XPath '/sqlMap/select'. Cause: java.lang.RuntimeException: Could not find SQL statement to include with refid 'Fragment.beforeSortedPaging' at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigParser.java:80) at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigParser.java:68) at com.ibatis.sqlmap.client.SqlMapClientBuilder.buildSqlMapClient(SqlMapClientBuilder.java:78) at com.ibatis.dao.engine.transaction.sqlmap.SqlMapDaoTransactionManager.configure(SqlMapDaoTransactionManager.java:52) at com.ibatis.dao.engine.builder.xml.XmlDaoManagerBuilder.parseTransactionManager(XmlDaoManagerBuilder.java:190) at com.ibatis.dao.engine.builder.xml.XmlDaoManagerBuilder.parseContext(XmlDaoManagerBuilder.java:154) at com.ibatis.dao.engine.builder.xml.XmlDaoManagerBuilder.buildDaoManager(XmlDaoManagerBuilder.java:99) at com.ibatis.dao.engine.builder.xml.XmlDaoManagerBuilder.buildDaoManager(XmlDaoManagerBuilder.java:76) at com.ibatis.dao.client.DaoManagerBuilder.buildDaoManager(DaoManagerBuilder.java:49) at com.awaro.app.fox.common.FoxInitializer.initDaoManager(FoxInitializer.java:61) at com.awaro.app.fox.common.FoxInitializer.initialize(FoxInitializer.java:40) at com.awaro.app.fox.bb.ibatis.test.SqlMapConfigTest.testSqlMapConfig(SqlMapConfigTest.java:46) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:421) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:305) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:186) Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMap/select'. Cause: java.lang.RuntimeException: Could not find SQL statement to include with refid 'Fragment.beforeSortedPaging' Caused by: java.lang.RuntimeException: Error parsing XPath '/sqlMap/select'. Cause: java.lang.RuntimeException: Could not find SQL statement to include with refid 'Fragment.beforeSortedPaging' Caused by: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMap/select'. Cause: java.lang.RuntimeException: Could not find SQL statement to include with refid 'Fragment.beforeSortedPaging' Caused by: java.lang.RuntimeException: Error parsing XPath '/sqlMap/select'. Cause: java.lang.RuntimeException: Could not find SQL statement to include with refid 'Fragment.beforeSortedPaging' at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:51) at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigParser.java:77) ... 26 more Caused by: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMap/select'. Cause: java.lang.RuntimeException: Could not find SQL statement to include with refid 'Fragment.beforeSortedPaging' Caused by: java.lang.RuntimeException: Error parsing XPath '/sqlMap/select'. Cause: java.lang.RuntimeException: Could not find SQL statement to include with refid 'Fragment.beforeSortedPaging' at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:112) at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:73) at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:91) at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:61) at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:49) ... 27 more Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMap/select'. Cause: java.lang.RuntimeException: Could not find SQL statement to include with refid 'Fragment.beforeSortedPaging' Caused by: java.lang.RuntimeException: Error parsing XPath '/sqlMap/select'. Cause: java.lang.RuntimeException: Could not find SQL statement to include with refid 'Fragment.beforeSortedPaging' at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:51) at com.ibatis.sqlmap.engine.builder.xml.SqlMapParser.parse(SqlMapParser.java:45) at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser$12.process(SqlMapConfigParser.java:351) at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:110) ... 31 more Caused by: java.lang.RuntimeException: Error parsing XPath '/sqlMap/select'. Cause: java.lang.RuntimeException: Could not find SQL statement to include with refid 'Fragment.beforeSortedPaging' at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:112) at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:73) at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:91) at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:61) at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:49) ... 34 more Caused by: java.lang.RuntimeException: Could not find SQL statement to include with refid 'Fragment.beforeSortedPaging' at com.ibatis.sqlmap.engine.builder.xml.SqlStatementParser.parseDynamicTags(SqlStatementParser.java:211) at com.ibatis.sqlmap.engine.builder.xml.SqlStatementParser.processSqlStatement(SqlStatementParser.java:166) at com.ibatis.sqlmap.engine.builder.xml.SqlStatementParser.parseGeneralStatement(SqlStatementParser.java:131) at com.ibatis.sqlmap.engine.builder.xml.SqlMapParser$19.process(SqlMapParser.java:429) at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:110) ... 38 more -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira