From f8fdcc1312f2e74bd94282dcae1c29acf257d42b Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Wed, 24 Jun 2015 17:08:16 +0100 Subject: [PATCH] Include value of java.io.tmpdir in message when createTempFile fails If java.io.tmpdir is configured to a directory that does not exist, calls to File.createTempFile will fail with an IOException with the message "The system cannot find the path specified". Unfortunately, the path the was specified is not included in the message. Rather than trying to automatically create the directory in what may be a misconfigured location, we now include the value of java.io.tmpdir in our own exception's message. Hopefully this will help users to figure out what they've done wrong. Closes gh-3307 --- .../embedded/tomcat/TomcatEmbeddedServletContainerFactory.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spring-boot/src/main/java/org/springframework/boot/context/embedded/tomcat/TomcatEmbeddedServletContainerFactory.java b/spring-boot/src/main/java/org/springframework/boot/context/embedded/tomcat/TomcatEmbeddedServletContainerFactory.java index aa43dfd798..6dfa8838be 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/embedded/tomcat/TomcatEmbeddedServletContainerFactory.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/embedded/tomcat/TomcatEmbeddedServletContainerFactory.java @@ -388,7 +388,8 @@ public class TomcatEmbeddedServletContainerFactory extends } catch (IOException ex) { throw new EmbeddedServletContainerException( - "Unable to create Tomcat tempdir", ex); + "Unable to create Tomcat tempdir. java.io.tmpdir is set to " + + System.getProperty("java.io.tmpdir"), ex); } }