spring boot(1):JPA org.hibernate.LazyInitializationException: could not initialize proxy [XXX#1] - no Session
把getOne改为findById就可以了
@Override public AliyunDnsSettings findById(long id) { //return aliyunDnsSettingsRepository.getOne(id); // 把getOne改为findById就可以了 return aliyunDnsSettingsRepository.findById(id).get(); }