title: Spring Boot ClassNotfoundException EmbeddedServletContainerCustomizer
body: <p>I am using Spring Boot 1.5.9. When packaging an application as an executable war (layout is WAR) and running it, it only works with mvn spring-boot:run.
  As soon as I start the application by java -jar , I get a NullPointerException:</p>
  
  <pre><code>Exception in thread "main" java.lang.NoClassDefFoundError:     
  org/springframework/boot/context/embedded/EmbeddedServletContainerCustomizer
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
      at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
      at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:411)
      at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:94)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
      at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
      at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURL     ClassLoader.java:94)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      at   org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:46)
      at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
      at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
      at org.springframework.boot.loader.WarLauncher.main(WarLauncher.java:59)
  Caused by: java.lang.ClassNotFoundException:     org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer
      at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      ... 30 more
  </code></pre>
  
  <p>spring-boot-1.5.9.RELEASE.jar is in WEB-INF/lib.</p>
  
  <p>Any help is highly appreciated.</p>
  
  <p>Kind regards</p>