spring boot项目在eclipse中运行的好好的,打成jar包后
报错如下:
org.springframework.web.client.ResourceAccessException: I/O error on POST
request for "http://127.0.0.1:8086/return/car/selectCarNoByLine": Connection
refused; nested exception is java.net.ConnectException: Connection refused
原始代码:
File mapfile = ResourceUtils.getFile("classpath:map/cityborder.txt");
InputStream mapinputStream = new FileInputStream(mapfile);
修改后的代码:
ClassPathResource resource = new ClassPathResource("map/cityborder.txt");
InputStream mapinputStream = resource.getInputStream();