invalid constant type: 18

今天在做dubbo项目的时候发现启动服务生产者出现以下问题:

错误信息

Exception in thread "main" java.lang.RuntimeException: java.io.IOException: invalid constant type: 18
	at javassist.CtClassType.getClassFile2(CtClassType.java:204)
	at javassist.compiler.MemberResolver.lookupMethod(MemberResolver.java:111)
	at javassist.compiler.MemberResolver.lookupMethod(MemberResolver.java:97)
	at javassist.compiler.TypeChecker.atMethodCallCore(TypeChecker.java:711)
	at javassist.compiler.TypeChecker.atCallExpr(TypeChecker.java:688)
	at javassist.compiler.JvstTypeChecker.atCallExpr(JvstTypeChecker.java:157)
	at javassist.compiler.ast.CallExpr.accept(CallExpr.java:46)
	at javassist.compiler.CodeGen.doTypeCheck(CodeGen.java:242)
	at javassist.compiler.CodeGen.atStmnt(CodeGen.java:330)
	at javassist.compiler.ast.Stmnt.accept(Stmnt.java:50)
	at javassist.compiler.CodeGen.atStmnt(CodeGen.java:351)
	at javassist.compiler.ast.Stmnt.accept(Stmnt.java:50)
	at javassist.compiler.CodeGen.atIfStmnt(CodeGen.java:391)
	at javassist.compiler.CodeGen.atStmnt(CodeGen.java:355)
	at javassist.compiler.ast.Stmnt.accept(Stmnt.java:50)
	at javassist.compiler.CodeGen.atStmnt(CodeGen.java:351)
	at javassist.compiler.ast.Stmnt.accept(Stmnt.java:50)
	at javassist.compiler.MemberCodeGen.atTryStmnt(MemberCodeGen.java:204)
	at javassist.compiler.CodeGen.atStmnt(CodeGen.java:367)
	at javassist.compiler.ast.Stmnt.accept(Stmnt.java:50)
	at javassist.compiler.CodeGen.atStmnt(CodeGen.java:351)
	at javassist.compiler.ast.Stmnt.accept(Stmnt.java:50)
	at javassist.compiler.CodeGen.atMethodBody(CodeGen.java:292)
	at javassist.compiler.CodeGen.atMethodDecl(CodeGen.java:274)
	at javassist.compiler.ast.MethodDecl.accept(MethodDecl.java:44)
	at javassist.compiler.Javac.compileMethod(Javac.java:169)
	at javassist.compiler.Javac.compile(Javac.java:95)
	at javassist.CtNewMethod.make(CtNewMethod.java:74)
	at javassist.CtNewMethod.make(CtNewMethod.java:45)
	at com.alibaba.dubbo.common.bytecode.ClassGenerator.toClass(ClassGenerator.java:318)
	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.rpc.proxy.javassist.JavassistProxyFactory.getInvoker(JavassistProxyFactory.java:40)
	at com.alibaba.dubbo.rpc.proxy.wrapper.StubProxyFactoryWrapper.getInvoker(StubProxyFactoryWrapper.java:104)
	at com.alibaba.dubbo.rpc.ProxyFactory$Adpative.getInvoker(ProxyFactory$Adpative.java)
	at com.alibaba.dubbo.config.ServiceConfig.exportLocal(ServiceConfig.java:507)
	at com.alibaba.dubbo.config.ServiceConfig.doExportUrlsFor1Protocol(ServiceConfig.java:465)
	at com.alibaba.dubbo.config.ServiceConfig.doExportUrls(ServiceConfig.java:281)
	at com.alibaba.dubbo.config.ServiceConfig.doExport(ServiceConfig.java:242)
	at com.alibaba.dubbo.config.ServiceConfig.export(ServiceConfig.java:143)
	at com.alibaba.dubbo.config.spring.ServiceBean.onApplicationEvent(ServiceBean.java:109)
	at org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:78)
	at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:76)
	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:274)
	at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:736)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:383)
	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
	at Main.main(Main.java:13)
	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:498)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
Caused by: java.io.IOException: invalid constant type: 18
	at javassist.bytecode.ConstPool.readOne(ConstPool.java:1113)
	at javassist.bytecode.ConstPool.read(ConstPool.java:1056)
	at javassist.bytecode.ConstPool.<init>(ConstPool.java:150)
	at javassist.bytecode.ClassFile.read(ClassFile.java:765)
	at javassist.bytecode.ClassFile.<init>(ClassFile.java:109)
	at javassist.CtClassType.getClassFile2(CtClassType.java:191)
	... 54 more

原因:jar包的版本1.7的不支持在1.8的JDK上运行

这个包如果是3.15之前的应该是不支持1.8的,可以换到更新的版本

<!-- https://mvnrepository.com/artifact/org.javassist/javassist -->
<dependency>
    <groupId>org.javassist</groupId>
    <artifactId>javassist</artifactId>
    <version>3.21.0-GA</version>
</dependency>


展开阅读全文

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: Age of Ai 设计师: meimeiellie
应支付0元
点击重新获取
扫码支付

支付成功即可阅读