启动项目报Caused by: java.lang.RuntimeException: java.io.IOException: invalid constant type: 15

jdk1.7升级到jdk1.8,启动项目报错如下:

Caused by: java.lang.RuntimeException: java.io.IOException: invalid constant type: 15
	at javassist.CtClassType.getClassFile2(CtClassType.java:203)
	at javassist.CtClassType.subtypeOf(CtClassType.java:303)
	at javassist.CtClassType.subtypeOf(CtClassType.java:318)
	at javassist.compiler.MemberResolver.compareSignature(MemberResolver.java:247)
	at javassist.compiler.MemberResolver.lookupMethod(MemberResolver.java:119)
	at javassist.compiler.MemberResolver.lookupMethod(MemberResolver.java:96)
	at javassist.compiler.TypeChecker.atMethodCallCore(TypeChecker.java:704)
	at javassist.compiler.TypeChecker.atCallExpr(TypeChecker.java:681)
	at javassist.compiler.JvstTypeChecker.atCallExpr(JvstTypeChecker.java:156)
	at javassist.compiler.ast.CallExpr.accept(CallExpr.java:45)
	at javassist.compiler.JvstTypeChecker.atCastToWrapper(JvstTypeChecker.java:125)
	at javassist.compiler.JvstTypeChecker.atCastExpr(JvstTypeChecker.java:97)
	at javassist.compiler.ast.CastExpr.accept(CastExpr.java:54)
	at javassist.compiler.CodeGen.doTypeCheck(CodeGen.java:241)
	at javassist.compiler.CodeGen.compileExpr(CodeGen.java:228)
	at javassist.compiler.CodeGen.atReturnStmnt2(CodeGen.java:597)
	at javassist.compiler.JvstCodeGen.atReturnStmnt(JvstCodeGen.java:424)
	at javassist.compiler.CodeGen.atStmnt(CodeGen.java:362)
	at javassist.compiler.ast.Stmnt.accept(Stmnt.java:49)
	at javassist.compiler.CodeGen.atStmnt(CodeGen.java:350)
	at javassist.compiler.ast.Stmnt.accept(Stmnt.java:49)
	at javassist.compiler.CodeGen.atIfStmnt(CodeGen.java:390)
	at javassist.compiler.CodeGen.atStmnt(CodeGen.java:354)
	at javassist.compiler.ast.Stmnt.accept(Stmnt.java:49)
	at javassist.compiler.CodeGen.atStmnt(CodeGen.java:350)
	at javassist.compiler.ast.Stmnt.accept(Stmnt.java:49)
	at javassist.compiler.MemberCodeGen.atTryStmnt(MemberCodeGen.java:203)
	at javassist.compiler.CodeGen.atStmnt(CodeGen.java:366)
	at javassist.compiler.ast.Stmnt.accept(Stmnt.java:49)
	at javassist.compiler.CodeGen.atStmnt(CodeGen.java:350)
	at javassist.compiler.ast.Stmnt.accept(Stmnt.java:49)
	at javassist.compiler.CodeGen.atMethodBody(CodeGen.java:291)
	at javassist.compiler.CodeGen.atMethodDecl(CodeGen.java:273)
	at javassist.compiler.ast.MethodDecl.accept(MethodDecl.java:43)
	at javassist.compiler.Javac.compileMethod(Javac.java:168)
	at javassist.compiler.Javac.compile(Javac.java:94)
	at javassist.CtNewMethod.make(CtNewMethod.java:73)
	at javassist.CtNewMethod.make(CtNewMethod.java:44)
	at com.alibaba.dubbo.common.bytecode.ClassGenerator.toClass(ClassGenerator.java:322)
	at com.alibaba.dubbo.common.bytecode.ClassGenerator.toClass(ClassGenerator.java:293)
	at com.alibaba.dubbo.common.bytecode.Wrapper.makeWrapper(Wrapper.java:346)
	at com.alibaba.dubbo.common.bytecode.Wrapper.getWrapper(Wrapper.java:89)
	at com.alibaba.dubbo.config.ServiceConfig.doExportUrlsFor1Protocol(ServiceConfig.java:430)
	at com.alibaba.dubbo.config.ServiceConfig.doExportUrls(ServiceConfig.java:285)
	at com.alibaba.dubbo.config.ServiceConfig.doExport(ServiceConfig.java:246)
	at com.alibaba.dubbo.config.ServiceConfig.export(ServiceConfig.java:145)
	at com.alibaba.dubbo.config.spring.AnnotationBean.postProcessAfterInitialization(AnnotationBean.java:202)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:409)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1518)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
	... 160 more
Caused by: java.io.IOException: invalid constant type: 15
	at javassist.bytecode.ConstPool.readOne(ConstPool.java:1090)
	at javassist.bytecode.ConstPool.read(ConstPool.java:1033)
	at javassist.bytecode.ConstPool.(ConstPool.java:149)
	at javassist.bytecode.ClassFile.read(ClassFile.java:737)
	at javassist.bytecode.ClassFile.(ClassFile.java:108)
	at javassist.CtClassType.getClassFile2(CtClassType.java:190)
	... 209 more

解决方案如下:

1.将javassist-3.15.0-GA.jar包升级到3.18.0或者更高

pom文件修改如下,启动项目报Caused by: java.lang.RuntimeException: java.io.IOException: invalid constant type: 15_第1张图片

2.查看lib下面的包,是否有两个javassist包,

如果有两个包,将其低版本删除即可。

问题解决

你可能感兴趣的:(启动项目报Caused by: java.lang.RuntimeException: java.io.IOException: invalid constant type: 15)