问题一:Consider defining a bean of type 'org.springframework.web.client.RestTemplate' in your configuration.
ERROR 31473 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
Field restTemplate in org.springframework.cloud.zookeeper.discovery.dependency.DependencyRestTemplateAutoConfiguration required a bean of type 'org.springframework.web.client.RestTemplate' that could not be found.
Action:
Consider defining a bean of type 'org.springframework.web.client.RestTemplate' in your configuration.
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;
@Configuration
public class Config {
@Bean
@LoadBalanced
public RestTemplate restTemplate() {
return new RestTemplate();
}
}
问题二:Springboot长时间运行后,上传文件时提示临时目录无效(500 null)
java.io.IOException: The temporary upload location [C:\Users\hexuhong\AppData\Local\Temp\tomcat.
1541434565861045247.2002
\work\Tomcat\localhost\ROOT] is not valid
解决方法:
application.properties配置:spring.servlet.multipart.location= /data/tmp
持续更新。。。。。。