There is already a statement named maxAmountLimit.queryList in this SqlMap

[Servlet Error]-[GenericServletWrapper]: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'loginDao':
Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException:
 Could not autowire field: private com.ibatis.sqlmap.client.SqlMapClient com.iss.finance.portal.login.dao.LoginDaoImpl.sqlMapClient;
 nested exception is org.springframework.beans.factory.BeanCreationException:
 Error creating bean with name 'TLD.sqlMapClient' defined in file
[/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/401ee7890481154Node01Cell/ifinance-treasurymonitor_war.ear/ifinance-treasurymonitor.war/WEB-INF/classes/spring-context.xml]:
Invocation of init method failed; nested exception is org.springframework.core.NestedIOException:
Failed to parse mapping resource:
file [/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/401ee7890481154Node01Cell/ifinance-treasurymonitor_war.ear/ifinance-treasurymonitor.war/WEB-INF/classes/database/oracle/linkedTrans/MaxAmountLimit.xml];
nested exception is com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMap/select'.  
Cause: com.ibatis.sqlmap.client.SqlMapException:
There is already a statement named maxAmountLimit.queryList in this SqlMap


1.最简单的一种情况是确实在



SqlMap标签内有两个一模一样的queryList  ,都在namespace 为maxAmountLimit 下面,但是这种低级问题,出现概率较少。

2.spring-context.xml  在这个文件中如果配置如下:

<!-- Ibatis SqlMap Bean -->
        <bean id="TLD.sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean" primary="true">
                <property name="configLocations">
            <list>
                                <value>classpath:database/${database.type}/sql-map-config.xml</value>

                                           <value>classpath:database/${database.type}/sql-map-treasurymonitor-config.xml</value>

                                <!-- 工作流 -->
                                <value>classpath:database/${database.type}/workflow/sql-*-config.xml</value>
                                <value>classpath:database/${database.type}/workdesk/sql-map-config.xml</value>
            </list>
        </property>
        <property name="mappingLocations">
                <list>
    <value>classpath:database/${database.type}/**/*.xml</value>
                </list>
        </property>


上面红色字体标记的部分是通配database/oracle/下所有的XML(${database.type} 这个变量我配的是oracle),同时sql-map-treasurymonitor-config.xml中如下:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMapConfig PUBLIC "-//iBATIS.com//DTD SQL Map Config 2.0//EN"
    "http://www.ibatis.com/dtd/sql-map-config-2.dtd">
<sqlMapConfig>
        <settings
                cacheModelsEnabled="true"
                enhancementEnabled="true"
                lazyLoadingEnabled="true"
                maxRequests="32"
                maxSessions="10"
                maxTransactions="20"
                useStatementNamespaces="true" />
        <sqlMap resource="database/oracle/dailyMonitor/BankAccountMonitor.xml"/>
        <sqlMap resource="database/oracle/dailyMonitor/DailyPayMonitor.xml"/>
        <sqlMap resource="database/oracle/importantAccount/ImportantAccount.xml"/>
        <sqlMap resource="database/oracle/linkedTrans/LinkedTrans.xml"/>
        <sqlMap resource="database/oracle/linkedTrans/MaxAmountLimit.xml"/>
        <sqlMap resource="database/oracle/linkedTransQuery/LinkedTransQuery.xml"/>
        <sqlMap resource="database/oracle/nonuseAccountAudit/NonuseAccountAudit.xml"/>
        <sqlMap resource="database/oracle/nonuseAccountAudit/NonuseAccountCycle.xml"/>
        <sqlMap resource="database/oracle/notproductkeyword/Notproductkeyword.xml"/>
        <sqlMap resource="database/oracle/util/Util.xml"/>
</sqlMapConfig>


这时候,这两个地方都会加载database/oracle  这个目录下所有的XMl,导致重复加载,从而报已经有了某个名字在sqlMap中了。



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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值