Error creating bean with name 'loginController': Injection of autowired dependencies failed
以上為報錯信息,意思是創建bean loginController出錯: 注入失敗
dubbo的配置沒有寫所導致,在springmvc.xml加入下句后正常:
<dubbo:reference interface="cn.jhxcom.sso.service.LoginService" id="loginService" />
另外在service端的配置文件還要暴露服務,如下句:
<dubbo:service interface="cn.jhxcom.sso.service.LoginService" ref="loginServiceImpl" timeout="600000"/>
有這兩句后程序正常。
小結:物理上沒有關系上的兩個獨立工程之間建立關系必須要有中間件作為橋梁,這樣被服務方在注入服務方的服務時才會正常。
