开发者社区> 问答> 正文

dubbo消费者启动报空指针?报错

junit测试没问题如下图:

启动就报错空指针如下图:

展开
收起
爱吃鱼的程序员 2020-06-08 12:45:36 919 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    不知道咋回事。看了网上许多解决方案,调整springMVC的加载顺序,也没没用。

    其他配置如下:

    provider:

    consumer:

    救是这个bean有问题:

    蓝瘦香菇

    2017-07-1017:13:52,410[localhost-startStop-1]INFO [com.alibaba.dubbo.common.logger.LoggerFactory]-usinglogger:com.alibaba.dubbo.common.logger.log4j.Log4jLoggerAdapter
     2017-07-1017:13:52,885[localhost-startStop-1]DEBUG[com.alibaba.dubbo.common.extension.ExtensionLoader]- [DUBBO]packagecom.alibaba.dubbo.rpc;
    importcom.alibaba.dubbo.common.extension.ExtensionLoader;
    publicclassProtocol$Adpativeimplementscom.alibaba.dubbo.rpc.Protocol{
    publicvoiddestroy(){thrownewUnsupportedOperationException("methodpublicabstractvoidcom.alibaba.dubbo.rpc.Protocol.destroy()ofinterfacecom.alibaba.dubbo.rpc.Protocolisnotadaptivemethod!");
    }
    publicintgetDefaultPort(){thrownewUnsupportedOperationException("methodpublicabstractintcom.alibaba.dubbo.rpc.Protocol.getDefaultPort()ofinterfacecom.alibaba.dubbo.rpc.Protocolisnotadaptivemethod!");
    }
    publiccom.alibaba.dubbo.rpc.Exporterexport(com.alibaba.dubbo.rpc.Invokerarg0)throwscom.alibaba.dubbo.rpc.Invoker{
    if(arg0==null)thrownewIllegalArgumentException("com.alibaba.dubbo.rpc.Invokerargument==null");
    if(arg0.getUrl()==null)thrownewIllegalArgumentException("com.alibaba.dubbo.rpc.InvokerargumentgetUrl()==null");com.alibaba.dubbo.common.URLurl=arg0.getUrl();
    StringextName=(url.getProtocol()==null?"dubbo":url.getProtocol());
    if(extName==null)thrownewIllegalStateException("Failtogetextension(com.alibaba.dubbo.rpc.Protocol)namefromurl("+url.toString()+")usekeys([protocol])");
    com.alibaba.dubbo.rpc.Protocolextension=(com.alibaba.dubbo.rpc.Protocol)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.rpc.Protocol.class).getExtension(extName);
    returnextension.export(arg0);
    }
    publiccom.alibaba.dubbo.rpc.Invokerrefer(java.lang.Classarg0,com.alibaba.dubbo.common.URLarg1)throwsjava.lang.Class{
    if(arg1==null)thrownewIllegalArgumentException("url==null");
    com.alibaba.dubbo.common.URLurl=arg1;
    StringextName=(url.getProtocol()==null?"dubbo":url.getProtocol());
    if(extName==null)thrownewIllegalStateException("Failtogetextension(com.alibaba.dubbo.rpc.Protocol)namefromurl("+url.toString()+")usekeys([protocol])");
    com.alibaba.dubbo.rpc.Protocolextension=(com.alibaba.dubbo.rpc.Protocol)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.rpc.Protocol.class).getExtension(extName);
    returnextension.refer(arg0,arg1);
    }
    },dubboversion:2.5.3,currenthost:127.0.0.1
     2017-07-1017:13:53,032[localhost-startStop-1]DEBUG[com.alibaba.dubbo.common.extension.ExtensionLoader]- [DUBBO]packagecom.alibaba.dubbo.rpc.cluster;
    importcom.alibaba.dubbo.common.extension.ExtensionLoader;
    publicclassCluster$Adpativeimplementscom.alibaba.dubbo.rpc.cluster.Cluster{
    publiccom.alibaba.dubbo.rpc.Invokerjoin(com.alibaba.dubbo.rpc.cluster.Directoryarg0)throwscom.alibaba.dubbo.rpc.cluster.Directory{
    if(arg0==null)thrownewIllegalArgumentException("com.alibaba.dubbo.rpc.cluster.Directoryargument==null");
    if(arg0.getUrl()==null)thrownewIllegalArgumentException("com.alibaba.dubbo.rpc.cluster.DirectoryargumentgetUrl()==null");com.alibaba.dubbo.common.URLurl=arg0.getUrl();
    StringextName=url.getParameter("cluster","failover");
    if(extName==null)thrownewIllegalStateException("Failtogetextension(com.alibaba.dubbo.rpc.cluster.Cluster)namefromurl("+url.toString()+")usekeys([cluster])");
    com.alibaba.dubbo.rpc.cluster.Clusterextension=(com.alibaba.dubbo.rpc.cluster.Cluster)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.rpc.cluster.Cluster.class).getExtension(extName);
    returnextension.join(arg0);
    }
    },dubboversion:2.5.3,currenthost:127.0.0.1
     2017-07-1017:13:53,052[localhost-startStop-1]DEBUG[com.alibaba.dubbo.common.extension.ExtensionLoader]- [DUBBO]packagecom.alibaba.dubbo.rpc;
    importcom.alibaba.dubbo.common.extension.ExtensionLoader;
    publicclassProxyFactory$Adpativeimplementscom.alibaba.dubbo.rpc.ProxyFactory{
    publicjava.lang.ObjectgetProxy(com.alibaba.dubbo.rpc.Invokerarg0)throwscom.alibaba.dubbo.rpc.Invoker{
    if(arg0==null)thrownewIllegalArgumentException("com.alibaba.dubbo.rpc.Invokerargument==null");
    if(arg0.getUrl()==null)thrownewIllegalArgumentException("com.alibaba.dubbo.rpc.InvokerargumentgetUrl()==null");com.alibaba.dubbo.common.URLurl=arg0.getUrl();
    StringextName=url.getParameter("proxy","javassist");
    if(extName==null)thrownewIllegalStateException("Failtogetextension(com.alibaba.dubbo.rpc.ProxyFactory)namefromurl("+url.toString()+")usekeys([proxy])");
    com.alibaba.dubbo.rpc.ProxyFactoryextension=(com.alibaba.dubbo.rpc.ProxyFactory)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.rpc.ProxyFactory.class).getExtension(extName);
    returnextension.getProxy(arg0);
    }
    publiccom.alibaba.dubbo.rpc.InvokergetInvoker(java.lang.Objectarg0,java.lang.Classarg1,com.alibaba.dubbo.common.URLarg2)throwsjava.lang.Object{
    if(arg2==null)thrownewIllegalArgumentException("url==null");
    com.alibaba.dubbo.common.URLurl=arg2;
    StringextName=url.getParameter("proxy","javassist");
    if(extName==null)thrownewIllegalStateException("Failtogetextension(com.alibaba.dubbo.rpc.ProxyFactory)namefromurl("+url.toString()+")usekeys([proxy])");
    com.alibaba.dubbo.rpc.ProxyFactoryextension=(com.alibaba.dubbo.rpc.ProxyFactory)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.rpc.ProxyFactory.class).getExtension(extName);
    returnextension.getInvoker(arg0,arg1,arg2);
    }
    },dubboversion:2.5.3,currenthost:127.0.0.1

    2020-06-08 12:45:50
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Dubbo开源现状与2.7规划 立即下载
Dubbo分布式服务治理实战 立即下载
《Dubbo 3.0 前瞻》 立即下载