我想在Spring中連接Google App Engine用戶服務,方法是首先創建一個UserServiceFactory bean,然後使用它獲取UserService的實例。使用Spring連接Google AppEngine的UserServiceFactory
<bean id="googleUserServiceFactory"
class="com.google.appengine.api.users.UserServiceFactory"></bean>
<bean id="googleUserService"
class="com.google.appengine.api.users.UserService"
factory-bean="googleUserServiceFactory"
factory-method="getUserService"></bean>
我敢肯定這就是連接你從工廠獲得一個bean正確的方式,但我得到這個錯誤:
Error creating bean with name 'googleUserService' defined in ServletContext resource [/WEB-INF/hardwire-service.xml]: No matching factory method found: factory bean 'googleUserServiceFactory'; factory method 'getUserService'
它說,該工廠方法無法找到。工廠方法名稱是否改變了?