title: Included spring core, so why am I getting "java.lang.ClassNotFoundException: org.springframework.core.ErrorCoded" error?
body: <p>I'm using Java 8 and Spring 5.  I have the following Grade dependencies for this Spring boot application I'm trying to build ...</p>
  
  <pre><code>repositories {
      mavenCentral()
  }
  
  sourceCompatibility = 1.8
  targetCompatibility = 1.8
  
  dependencies {
      compile 'org.springframework.boot:spring-boot-starter-data-mongodb:2.1.5.RELEASE'
      compile 'org.springframework:spring-web:5.1.7.RELEASE'
      compile 'org.springframework:spring-core:5.1.7.RELEASE'
  }
  </code></pre>
  
  <p>After I build the application and run it, I get the below error ("java.lang.ClassNotFoundException: org.springframework.core.ErrorCoded").  I'm including spring-core, so I'm not sure what it's complaining about ...</p>
  
  <pre><code>localhost:todoapp-backend davea$ java -jar ./build/libs/spring-data-mongodb-example-1.0.jar
  12:37:24.249 [main] DEBUG org.springframework.boot.logging.ClasspathLoggingApplicationListener - Application failed to start with classpath: [jar:file:/Users/davea/Documents/workspace/todoapp-backend/build/libs/spring-data-mongodb-example-1.0.jar!/BOOT-INF/classes!/, jar:file:/Users/davea/Documents/workspace/todoapp-backend/build/libs/spring-data-mongodb-example-1.0.jar!/BOOT-INF/lib/spring-boot-starter-data-mongodb-2.1.5.RELEASE.jar!/, jar:file:/Users/davea/Documents/workspace/todoapp-backend/build/libs/spring-data-mongodb-example-1.0.jar!/BOOT-INF/lib/spring-web-5.1.7.RELEASE.jar!/, jar:file:/Users/davea/Documents/workspace/todoapp-backend/build/libs/spring-data-mongodb-example-1.0.jar!/BOOT-INF/lib/spring-core-5.1.7.RELEASE.jar!/, jar:file:/Users/davea/Documents/workspace/todoapp-backend/build/libs/spring-data-mongodb-example-1.0.jar!/BOOT-INF/lib/spring-boot-starter-1.5.1.RELEASE.jar!/, jar:file:/Users/davea/Documents/workspace/todoapp-backend/build/libs/spring-data-mongodb-example-1.0.jar!/BOOT-INF/lib/mongodb-driver-3.4.1.jar!/, jar:file:/Users/davea/Documents/workspace/todoapp-backend/build/libs/spring-data-mongodb-example-1.0.jar!/BOOT-INF/lib/spring-data-mongodb-1.10.0.RELEASE.jar!/, jar:file:/Users/davea/Documents/workspace/todoapp-backend/build/libs/spring-data-mongodb-example-1.0.jar!/BOOT-INF/lib/spring-beans-4.3.6.RELEASE.jar!/, jar:file:/Users/davea/Documents/workspace/todoapp-backend/build/libs/spring-data-mongodb-example-1.0.jar!/BOOT-INF/lib/spring-jcl-5.1.7.RELEASE.jar!/, jar:file:/Users/davea/Documents/workspace/todoapp-backend/build/libs/spring-data-mongodb-example-1.0.jar!/BOOT-INF/lib/spring-boot-1.5.1.RELEASE.jar!/, jar:file:/Users/davea/Documents/workspace/todoapp-backend/build/libs/spring-data-mongodb-example-1.0.jar!/BOOT-INF/lib/spring-boot-autoconfigure-1.5.1.RELEASE.jar!/, jar:file:/Users/davea/Documents/workspace/todoapp-backend/build/libs/spring-data-mongodb-example-1.0.jar!/BOOT-INF/lib/spring-boot-starter-logging-1.5.1.RELEASE.jar!/, jar:file:/Users/davea/Documents/workspace/todoapp-backend/build/libs/spring-data-mongodb-example-1.0.jar!/BOOT-INF/lib/snakeyaml-1.17.jar!/, jar:file:/Users/davea/Documents/workspace/todoapp-backend/build/libs/spring-data-mongodb-example-1.0.jar!/BOOT-INF/lib/mongodb-driver-core-3.4.1.jar!/, jar:file:/Users/davea/Documents/workspace/todoapp-backend/build/libs/spring-data-mongodb-example-1.0.jar!/BOOT-INF/lib/bson-3.4.1.jar!/, jar:file:/Users/davea/Documents/workspace/todoapp-backend/build/libs/spring-data-mongodb-example-1.0.jar!/BOOT-INF/lib/spring-tx-4.3.6.RELEASE.jar!/, jar:file:/Users/davea/Documents/workspace/todoapp-backend/build/libs/spring-data-mongodb-example-1.0.jar!/BOOT-INF/lib/spring-context-4.3.6.RELEASE.jar!/, jar:file:/Users/davea/Documents/workspace/todoapp-backend/build/libs/spring-data-mongodb-example-1.0.jar!/BOOT-INF/lib/spring-expression-4.3.6.RELEASE.jar!/, jar:file:/Users/davea/Documents/workspace/todoapp-backend/build/libs/spring-data-mongodb-example-1.0.jar!/BOOT-INF/lib/spring-data-commons-1.13.0.RELEASE.jar!/, jar:file:/Users/davea/Documents/workspace/todoapp-backend/build/libs/spring-data-mongodb-example-1.0.jar!/BOOT-INF/lib/slf4j-api-1.7.22.jar!/, jar:file:/Users/davea/Documents/workspace/todoapp-backend/build/libs/spring-data-mongodb-example-1.0.jar!/BOOT-INF/lib/logback-classic-1.1.9.jar!/, jar:file:/Users/davea/Documents/workspace/todoapp-backend/build/libs/spring-data-mongodb-example-1.0.jar!/BOOT-INF/lib/jcl-over-slf4j-1.7.22.jar!/, jar:file:/Users/davea/Documents/workspace/todoapp-backend/build/libs/spring-data-mongodb-example-1.0.jar!/BOOT-INF/lib/jul-to-slf4j-1.7.22.jar!/, jar:file:/Users/davea/Documents/workspace/todoapp-backend/build/libs/spring-data-mongodb-example-1.0.jar!/BOOT-INF/lib/log4j-over-slf4j-1.7.22.jar!/, jar:file:/Users/davea/Documents/workspace/todoapp-backend/build/libs/spring-data-mongodb-example-1.0.jar!/BOOT-INF/lib/spring-aop-4.3.6.RELEASE.jar!/, jar:file:/Users/davea/Documents/workspace/todoapp-backend/build/libs/spring-data-mongodb-example-1.0.jar!/BOOT-INF/lib/logback-core-1.1.9.jar!/]
  12:37:24.255 [main] ERROR org.springframework.boot.SpringApplication - Application startup failed
  java.lang.NoClassDefFoundError: org/springframework/core/ErrorCoded
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
      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(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:760)
      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(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:760)
      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(LaunchedURLClassLoader.java:94)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      at org.springframework.boot.bind.RelaxedDataBinder.modifyProperties(RelaxedDataBinder.java:146)
      at org.springframework.boot.bind.RelaxedDataBinder.doBind(RelaxedDataBinder.java:128)
      at org.springframework.validation.DataBinder.bind(DataBinder.java:740)
      at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.bindSpringProfiles(ConfigFileApplicationListener.java:530)
      at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.bindSpringProfiles(ConfigFileApplicationListener.java:523)
      at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.handleProfileProperties(ConfigFileApplicationListener.java:515)
      at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.loadIntoGroup(ConfigFileApplicationListener.java:476)
      at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.load(ConfigFileApplicationListener.java:459)
      at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.load(ConfigFileApplicationListener.java:380)
      at org.springframework.boot.context.config.ConfigFileApplicationListener.addPropertySources(ConfigFileApplicationListener.java:215)
      at org.springframework.boot.context.config.ConfigFileApplicationListener.postProcessEnvironment(ConfigFileApplicationListener.java:184)
      at org.springframework.boot.context.config.ConfigFileApplicationListener.onApplicationEnvironmentPreparedEvent(ConfigFileApplicationListener.java:171)
      at org.springframework.boot.context.config.ConfigFileApplicationListener.onApplicationEvent(ConfigFileApplicationListener.java:157)
      at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167)
      at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
      at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:122)
      at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:73)
      at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54)
      at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:336)
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:1162)
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:1151)
      at com.mkyong.Application.main(Application.java:20)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:497)
      at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
      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.JarLauncher.main(JarLauncher.java:51)
  Caused by: java.lang.ClassNotFoundException: org.springframework.core.ErrorCoded
      at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:94)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
  </code></pre>