dianping / cat

CAT 作为服务端项目基础组件,提供了 Java, C/C++, Node.js, Python, Go 等多语言客户端,已经在美团点评的基础架构中间件框架(MVC框架,RPC框架,数据库框架,缓存框架等,消息队列,配置系统等)深度集成,为美团点评各业务线提供系统丰富的性能指标、健康状况、实时告警等。
Apache License 2.0
18.7k stars 5.43k forks source link

RPC 服务使用transaction接入cat,调用过程报错,使用的是resin服务器 #1069

Closed kevinYin closed 7 years ago

kevinYin commented 7 years ago

使用的是jdk1.8,resin4.1服务器,本地调用没有报错,配置文件正确远程调用爆以下错误:

异常如下: java.lang.RuntimeException: Unable to get component: interface org.unidal.initialization.Module. at org.unidal.initialization.DefaultModuleContext.lookup(DefaultModuleContext.java:98) at com.dianping.cat.Cat.initialize(Cat.java:112) at com.dianping.cat.Cat.initialize(Cat.java:107) at com.dianping.cat.Cat.checkAndInitialize(Cat.java:48) at com.dianping.cat.Cat.getProducer(Cat.java:98) at com.dianping.cat.Cat.newTransaction(Cat.java:315) at com.ibeiliao.statement.impl.provider.SummaryServiceProviderImpl.querySchoolDaily(SummaryServiceProviderImpl.java:35) at com.alibaba.dubbo.common.bytecode.Wrapper10.invokeMethod(Wrapper10.java) at com.alibaba.dubbo.rpc.proxy.javassist.JavassistProxyFactory$1.doInvoke(JavassistProxyFactory.java:46) at com.alibaba.dubbo.rpc.proxy.AbstractProxyInvoker.invoke(AbstractProxyInvoker.java:72) at com.alibaba.dubbo.rpc.protocol.InvokerWrapper.invoke(InvokerWrapper.java:53) at com.ibeiliao.platform.dubbo.filter.AuthorizationFilter.invoke(AuthorizationFilter.java:80) at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) at com.alibaba.dubbo.rpc.filter.ExceptionFilter.invoke(ExceptionFilter.java:64) at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) at com.alibaba.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:75) at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) at com.alibaba.dubbo.rpc.filter.TimeoutFilter.invoke(TimeoutFilter.java:42) at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) at com.alibaba.dubbo.rpc.protocol.dubbo.filter.TraceFilter.invoke(TraceFilter.java:78) at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) at com.alibaba.dubbo.rpc.filter.ContextFilter.invoke(ContextFilter.java:60) at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) at com.alibaba.dubbo.rpc.filter.GenericFilter.invoke(GenericFilter.java:132) at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) at com.alibaba.dubbo.rpc.filter.ClassLoaderFilter.invoke(ClassLoaderFilter.java:38) at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) at com.alibaba.dubbo.rpc.filter.EchoFilter.invoke(EchoFilter.java:38) at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) at com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol$1.reply(DubboProtocol.java:108) at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.handleRequest(HeaderExchangeHandler.java:84) at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:170) at com.alibaba.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:52) at com.alibaba.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:82) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: org.codehaus.plexus.component.repository.exception.ComponentLookupException: Component descriptor cannot be found in the component repository role: org.unidal.initialization.Module roleHint: cat-client classRealm: none specified at org.codehaus.plexus.DefaultComponentRegistry.getComponentManager(DefaultComponentRegistry.java:435) at org.codehaus.plexus.DefaultComponentRegistry.getComponent(DefaultComponentRegistry.java:353) at org.codehaus.plexus.DefaultComponentRegistry.lookup(DefaultComponentRegistry.java:178) at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:388) at org.unidal.initialization.DefaultModuleContext.lookup(DefaultModuleContext.java:96) ... 36 more

qmwu2000 commented 7 years ago

应该是classloading问题。cat-client.jar中的/META-INF/plexus/components.xml找不到。

kevinYin commented 7 years ago

已经解决了,是maven-shade-plugin 插件引起的,多谢老吴

xutaopro commented 7 years ago

已经解决了,是maven-shade-plugin 插件引起的,要怎么解决呢,去掉这个插件吗

kevinYin commented 7 years ago

我换成别的插件了, 用dependency 或者 aseemly 都行,或者使用新版本2.0,老吴解决了这个问题

csm19910701 commented 2 years ago

components 大佬,怎么解决的?