We use Play Framework 2.7 for scala develop our backend project, we need export 
some dubbo service, like this:

<code>
   class UserService @Inject()(
                             userDao: UserDao
                           ) extends NJUserService {
  
        def updateUserProfile(uid: String, avatar: String) = {
            userDao.updateAvatar(uid, avatar).map { result =>
               ...
            }
        }
    }
</code>

but dubbo using reflect to create UserService instance, so that can not handle 
@Inject correctly.

I exported dubbo service ref 
https://dubbo.apache.org/docs/v2.7/user/quick-start/#service-provider It seem 
play using Google Guice to realize injection, but it not support by dubbo, any 
one have a good solution, I am very appreciative.

when play framework run, the exception like:

Error injecting constructor, 
org.springframework.beans.factory.BeanCreationException: Error creating bean 
with name 'UserService' defined in class path resource [dubbo-provider.xml]: 
Instantiation of bean failed;

Reply via email to