记录一个springboot启动的报错解决

关键是下面的zipException, 找到这个class not found所在jar包, 目录删了, 让project重新 update maven.

根本原因是mvn local repository 里这个jar corrupted, 果不其然, 新jar 才 804k, 之前用的这个jar不知道怎么弄的1.4m+

java.lang.ClassNotFoundException: org.springframework.http.converter.json.MappingJackson2HttpMessageConverter

java.util.zip.ZipException: invalid block type
       at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107) [spring-boot-1.5.8.RELEASE.jar!/:
.5.8.RELEASE]
       at com.jesper.seckill.MainApplication.main(MainApplication.java:9) [classes!/:0.0.1-SNAPSHOT]
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_112]
       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_112]
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_112]
       at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_112]
       at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) [jesper_seckill.jar:0.0.1-SNAP
HOT]
       at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) [jesper_seckill.jar:0.0.1-SNAPSHOT]
       at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) [jesper_seckill.jar:0.0.1-SNAPSHOT]
       at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51) [jesper_seckill.jar:0.0.1-SNAPSHOT]

xception in thread "main" java.lang.reflect.InvocationTargetException
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
       at java.lang.reflect.Method.invoke(Unknown Source)
       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)
aused by: java.lang.NoClassDefFoundError: org/springframework/http/converter/json/MappingJackson2HttpMessageConverter
       at java.lang.Class.getDeclaredMethods0(Native Method)
       at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
       at java.lang.Class.getDeclaredMethods(Unknown Source)
       at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:613)
       at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:524)
       at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:510)
       at org.springframework.util.ReflectionUtils.getUniqueDeclaredMethods(ReflectionUtils.java:570)
       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryMethod(Abstract
utowireCapableBeanFactory.java:697)
       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAuto
ireCapableBeanFactory.java:640)
       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowire
apableBeanFactory.java:609)
       at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1484)
       at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBea
Factory.java:425)
       at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanF
ctory.java:395)
       at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactor
.java:515)
       at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactor
.java:508)
       at org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java
1186)
       at org.springframework.boot.SpringApplication.getExitCodeFromMappedException(SpringApplication.java:818)
       at org.springframework.boot.SpringApplication.getExitCodeFromException(SpringApplication.java:804)
       at org.springframework.boot.SpringApplication.handleExitCode(SpringApplication.java:790)
       at org.springframework.boot.SpringApplication.handleRunFailure(SpringApplication.java:744)
       at org.springframework.boot.SpringApplication.run(SpringApplication.java:314)
       at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118)
       at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107)
       at com.jesper.seckill.MainApplication.main(MainApplication.java:9)
       ... 8 more
aused by: java.lang.ClassNotFoundException: org.springframework.http.converter.json.MappingJackson2HttpMessageConverter

       at java.net.URLClassLoader$1.run(Unknown Source)
       at java.net.URLClassLoader$1.run(Unknown Source)
       at java.security.AccessController.doPrivileged(Native Method)
       at java.net.URLClassLoader.findClass(Unknown Source)
       at java.lang.ClassLoader.loadClass(Unknown Source)
       at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:94)
       at java.lang.ClassLoader.loadClass(Unknown Source)
       ... 32 more
aused by: java.util.zip.ZipException: invalid block type
       at java.util.zip.InflaterInputStream.read(Unknown Source)
       at org.springframework.boot.loader.jar.ZipInflaterInputStream.read(ZipInflaterInputStream.java:52)
       at sun.misc.Resource.getBytes(Unknown Source)
       at java.net.URLClassLoader.defineClass(Unknown Source)
       at java.net.URLClassLoader.access$100(Unknown Source)
       ... 39 more

你可能感兴趣的:(记录一个springboot启动的报错解决)