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  在这个文件中如果配置如下:


        
                
            
                                classpath:database/${database.type}/sql-map-config.xml

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

                                
                                classpath:database/${database.type}/workflow/sql-*-config.xml
                                classpath:database/${database.type}/workdesk/sql-map-config.xml
            
        
        
                
    classpath:database/${database.type}/**/*.xml
                
        


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




        
        
        
        
        
        
        
        
        
        
        


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



你可能感兴趣的:(There is already a statement named maxAmountLimit.queryList in this SqlMap)