0

At the beginning of learning Dubbo,as follow.Configure this parameter in the service,but it doesn't start,the following information is displayed during startup.

An attempt to search the relevant website failed to find the answer.

/**
 * @author author
 * @date 2022年10月05日 9:49
 */
// 暴露服务
@com.alibaba.dubbo.config.annotation.Service(version = "1.0.0", parameters = {
        "getUserAddressList.retries","5",
        "getUserAddressList.timeout","3000"})
@Service
public class UserServiceImpl implements UserService {

    /**
     * 获取用户地址列表
     * @param userId
     * @return
     */
    @Override
    public List<UserAddress> getUserAddressList(String userId) {
        System.out.println("Start call...");
        UserAddress chenAddress1 = new UserAddress(1, "Shaanxi", "1", "a", "110", "Y");
        UserAddress chenAddress2 = new UserAddress(2, "shanghai", "2", "b", "120", "N");
        try {
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        return Arrays.asList(chenAddress1, chenAddress2);
    }
}

Error message

Error creating bean with name 'ServiceBean:userServiceImpl:org.example.dubbointerface.service.UserService:1.0.0': Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'java.lang.String[]' to required type 'java.util.Map' for property 'parameters'; nested exception is java.lang.IllegalStateException: Cannot convert value of type 'java.lang.String[]' to required type 'java.util.Map' for property 'parameters': no matching editors or conversion strategy found

0 Answers0