SpelEvaluationException Method cannot be found

前端 未结 2 1130
庸人自扰
庸人自扰 2021-01-16 07:11

I am facing with the next problem, when I am trying to pass the User to the service method using SpEL,

evaluate expression=\"commonService.userTest(user)\"          


        
2条回答
  •  逝去的感伤
    2021-01-16 07:26

    I got this error associated with retrieving an object from the database. To resolve this I made a service class that called the proxied object from withing a transaction and that solved it.

    @Transactional(readOnly = true)
    public User findOneByCustomerPersonalEmail(String email) {
        User user = userRepository.findOneByCustomerPersonalEmail(email);
        user.getCustomer(); //this line fills the proxied object
        return user;
    }
    

提交回复
热议问题