Dubbo @Autowired injection failure analysis

mistake:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'XXXX': 

The distributed architecture of Zookeeper+Dubbo is used. During the development process, I gradually became familiar with the system, hoping to leave some traces to avoid detours.

If the above error occurs, please follow the steps below to check:

1: Introduce JAR matching consistency

      import org.springframework.beans.factory.annotation.Autowired;


2: Interface implementation class: Be careful not to use DUBBO's Service here: com.alibaba.dubbo.config.annotation.Service;

    

3: The method name of the Dao layer is consistent with the XML configuration:

    A:XML reference path namespac: <mapper namespace="com.dz.rhcms.card.dao.portDao.IndentityRecDao">


 B: The XML method name is the same

    



C:XML:parameterType specifies the same entity class


    


4: Spring scans mybatis path consistent

 



Here we can see that the Spring configuration scan is the *Mapper.xml configuration file under the mybatis package. Before, I added a new package under the mybatis package that could not be scanned.

5: The most important thing is to do the configuration of Dubbo, because they call each other under different projects, so do the configuration. DUBBO-based services and consumption (remember)


Be consistent with where you use it


Remember that Ref is the same as id.





Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324626912&siteId=291194637