dubbo ssm 不能发布服务

「已注销」 2019-05-13 12:18:46
ssm加dubbo发布服务错误,spring配置如下:

<!-- 发布dubbo服务 -->
<!-- 提供方应用信息,用于计算依赖关系 -->
<dubbo:application name="taotao-manager" />
<!-- 注册中心的地址 -->
<dubbo:registry protocol="zookeeper" address="192.168.2.128:2181" />
<!-- 用dubbo协议在20880端口暴露服务 -->
<dubbo:protocol name="dubbo" port="20880" />
<!-- 声明需要暴露的服务接口 -->
<dubbo:service interface="com.wenqiuhan.taotao.service.ItemService" ref="itemServiceImpl" timeout="300000"/>

注释此配置启动时没问题的,启用此配置就报错,错误如下:

严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.wenqiuhan.taotao.service.ItemService': Instantiation of bean failed; nested exception is java.lang.ExceptionInInitializerError
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1105)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1050)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:446)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:328)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:835)
Caused by: java.lang.ExceptionInInitializerError
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:89)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1098)
... 22 more
Caused by: java.lang.IllegalStateException: fail to create adaptive instance: java.lang.IllegalStateException: Can not create adaptive extenstion interface com.alibaba.dubbo.rpc.Protocol, cause: java.io.IOException: invalid constant type: 18
at com.alibaba.dubbo.common.extension.ExtensionLoader.getAdaptiveExtension(ExtensionLoader.java:459)
at com.alibaba.dubbo.config.ServiceConfig.<clinit>(ServiceConfig.java:60)
... 30 more
Caused by: java.lang.IllegalStateException: Can not create adaptive extenstion interface com.alibaba.dubbo.rpc.Protocol, cause: java.io.IOException: invalid constant type: 18
at com.alibaba.dubbo.common.extension.ExtensionLoader.createAdaptiveExtension(ExtensionLoader.java:723)
at com.alibaba.dubbo.common.extension.ExtensionLoader.getAdaptiveExtension(ExtensionLoader.java:455)
... 31 more
Caused by: java.lang.RuntimeException: java.io.IOException: invalid constant type: 18
at javassist.CtClassType.getClassFile2(CtClassType.java:204)
at javassist.CtClassType.subtypeOf(CtClassType.java:304)
at javassist.compiler.MemberResolver.compareSignature(MemberResolver.java:248)
at javassist.compiler.MemberResolver.lookupMethod(MemberResolver.java:120)
at javassist.compiler.MemberResolver.lookupMethod(MemberResolver.java:97)
at javassist.compiler.MemberCodeGen.atMethodCallCore(MemberCodeGen.java:562)
at javassist.compiler.MemberCodeGen.atCallExpr(MemberCodeGen.java:524)
at javassist.compiler.JvstCodeGen.atCallExpr(JvstCodeGen.java:244)
at javassist.compiler.ast.CallExpr.accept(CallExpr.java:46)
at javassist.compiler.MemberCodeGen.atCallExpr(MemberCodeGen.java:497)
at javassist.compiler.JvstCodeGen.atCallExpr(JvstCodeGen.java:244)
at javassist.compiler.ast.CallExpr.accept(CallExpr.java:46)
at javassist.compiler.MemberCodeGen.atCallExpr(MemberCodeGen.java:497)
at javassist.compiler.JvstCodeGen.atCallExpr(JvstCodeGen.java:244)
at javassist.compiler.ast.CallExpr.accept(CallExpr.java:46)
at javassist.compiler.MemberCodeGen.atCallExpr(MemberCodeGen.java:497)
at javassist.compiler.JvstCodeGen.atCallExpr(JvstCodeGen.java:244)
at javassist.compiler.ast.CallExpr.accept(CallExpr.java:46)
at javassist.compiler.CodeGen.atBinExpr(CodeGen.java:964)
at javassist.compiler.ast.BinExpr.accept(BinExpr.java:41)
at javassist.compiler.JvstCodeGen.atMethodArgs(JvstCodeGen.java:358)
at javassist.compiler.MemberCodeGen.atMethodCallCore(MemberCodeGen.java:556)
at javassist.compiler.MemberCodeGen.atNewExpr(MemberCodeGen.java:302)
at javassist.compiler.ast.NewExpr.accept(NewExpr.java:73)
at javassist.compiler.CodeGen.compileExpr(CodeGen.java:230)
at javassist.compiler.CodeGen.atThrowStmnt(CodeGen.java:628)
at javassist.compiler.CodeGen.atStmnt(CodeGen.java:365)
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.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.compiler.support.JavassistCompiler.doCompile(JavassistCompiler.java:119)
at com.alibaba.dubbo.common.compiler.support.AbstractCompiler.compile(AbstractCompiler.java:59)
at com.alibaba.dubbo.common.compiler.support.AdaptiveCompiler.compile(AdaptiveCompiler.java:46)
at com.alibaba.dubbo.common.extension.ExtensionLoader.createAdaptiveExtensionClass(ExtensionLoader.java:739)
at com.alibaba.dubbo.common.extension.ExtensionLoader.getAdaptiveExtensionClass(ExtensionLoader.java:732)
at com.alibaba.dubbo.common.extension.ExtensionLoader.createAdaptiveExtension(ExtensionLoader.java:721)
... 32 more
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)
... 77 more


请问这种情况原因是什么啊,在线等..
如果我提供的信息太少可以回复我需要什么信息,或者直接git https://github.com/wenqiuhan/taotao
...全文
120 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
「已注销」 2019-05-13
  • 打赏
  • 举报
回复
引用 4 楼 maradona1984 的回复:
Caused by: java.io.IOException: invalid constant type: 18 从源码来看,也许javassist的版本低了,可以提供版本号么?
确实是这个原因,可能是我改了父工程没有install,现在好了,谢谢解答!
「已注销」 2019-05-13
  • 打赏
  • 举报
回复
引用 4 楼 maradona1984 的回复:
Caused by: java.io.IOException: invalid constant type: 18 从源码来看,也许javassist的版本低了,可以提供版本号么?
可能不是这个原因,我换了3.21。0的还是这样的,
maradona1984 2019-05-13
  • 打赏
  • 举报
回复
引用 5 楼 WenQiuHan 的回复:
[quote=引用 4 楼 maradona1984 的回复:]
Caused by: java.io.IOException: invalid constant type: 18
从源码来看,也许javassist的版本低了,可以提供版本号么?

3.15.0-GA,我换个高版本试试,[/quote]
这个依赖是dubbo依赖过来的,建议升级下dubbo到最新
「已注销」 2019-05-13
  • 打赏
  • 举报
回复
引用 4 楼 maradona1984 的回复:
Caused by: java.io.IOException: invalid constant type: 18 从源码来看,也许javassist的版本低了,可以提供版本号么?
3.15.0-GA,我换个高版本试试,
maradona1984 2019-05-13
  • 打赏
  • 举报
回复
Caused by: java.io.IOException: invalid constant type: 18
从源码来看,也许javassist的版本低了,可以提供版本号么?
「已注销」 2019-05-13
  • 打赏
  • 举报
回复
引用 1 楼 对梦想的牵挂 的回复:
根据这句来看Error creating bean with name 'com.wenqiuhan.taotao.service.ItemService': Instantiation of bean failed; 可能是因为ItemService 里面有报错没解决。
「已注销」 2019-05-13
  • 打赏
  • 举报
回复
引用 1 楼 对梦想的牵挂 的回复:
根据这句来看Error creating bean with name 'com.wenqiuhan.taotao.service.ItemService': Instantiation of bean failed; 可能是因为ItemService 里面有报错没解决。
service这样的,没找到什么毛病啊QVQ,
对梦想的牵挂 2019-05-13
  • 打赏
  • 举报
回复
根据这句来看Error creating bean with name 'com.wenqiuhan.taotao.service.ItemService': Instantiation of bean failed; 可能是因为ItemService 里面有报错没解决。

67,513

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧