Spring 4.1 @Qualifier doesnt'work

前端 未结 8 1105
隐瞒了意图╮
隐瞒了意图╮ 2020-12-18 06:11

I have classes, xml configuration file and error stack trace like this. I have no idea why @Qualifier doesn\'t work. I see on errors that he don\'t even do anything.

8条回答
  •  萌比男神i
    2020-12-18 06:54

    In Spring 4.x you should work with the following XML schema in order for this to work for you:

    xmlns="http://www.springframework.org/schema/beans"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
               xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
            http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd"
    

    and you should add the following tag:

    
    

    So the following XML should solve your problem (it solved mine :) ):

    
    
    
        
    
        
           
        
    
        
            
            
            
        
    
        
            
            
            
        
    
    

    See more here.

提交回复
热议问题