[DUBBO] No such extension com.alibaba.dubbo.container.Container by name spring , possible causes:

问题现象:dubbo启动失败

[2019-12-23 14:48:53 ERROR] [main] (com.alibaba.dubbo.container.Main:86) -  [DUBBO] No such extension com.alibaba.dubbo.container.Container by name spring  , possible causes: 
(1) com.alibaba.dubbo.container.logback.LogbackContainer:
java.lang.IllegalStateException: Failed to load extension class(interface: interface com.alibaba.dubbo.container.Container, class line: com.alibaba.dubbo.container.logback.LogbackContainer) in jar:file:/opt/services/ifc-captcha-dubbo-service/lib/dubbo-2.5.3.jar!/META-INF/dubbo/internal/com.alibaba.dubbo.container.Container, cause: ch/qos/logback/core/Context
java.lang.IllegalStateException: Failed to load extension class(interface: interface com.alibaba.dubbo.container.Container, class line: com.alibaba.dubbo.container.logback.LogbackContainer) in jar:file:/opt/services/ifc-captcha-dubbo-service/lib/dubbo-2.5.3.jar!/META-INF/dubbo/internal/com.alibaba.dubbo.container.Container, cause: ch/qos/logback/core/Context
        at com.alibaba.dubbo.common.extension.ExtensionLoader.loadFile(ExtensionLoader.java:685)
        at com.alibaba.dubbo.common.extension.ExtensionLoader.loadExtensionClasses(ExtensionLoader.java:591)
        at com.alibaba.dubbo.common.extension.ExtensionLoader.getExtensionClasses(ExtensionLoader.java:567)
        at com.alibaba.dubbo.common.extension.ExtensionLoader.getDefaultExtensionName(ExtensionLoader.java:358)
        at com.alibaba.dubbo.container.Main.main(Main.java:50)
Caused by: java.lang.NoClassDefFoundError: ch/qos/logback/core/Context
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:278)
        at com.alibaba.dubbo.common.extension.ExtensionLoader.loadFile(ExtensionLoader.java:627)
        ... 4 more
Caused by: java.lang.ClassNotFoundException: ch.qos.logback.core.Context
        at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
        ... 7 more

(2) com.alibaba.dubbo.container.jetty.JettyContainer:
java.lang.IllegalStateException: Failed to load extension class(interface: interface com.alibaba.dubbo.container.Container, class line: com.alibaba.dubbo.container.jetty.JettyContainer) in jar:file:/opt/services/ifc-captcha-dubbo-service/lib/dubbo-2.5.3.jar!/META-INF/dubbo/internal/com.alibaba.dubbo.container.Container, cause: org/mortbay/jetty/Connector
java.lang.IllegalStateException: Failed to load extension class(interface: interface com.alibaba.dubbo.container.Container, class line: com.alibaba.dubbo.container.jetty.JettyContainer) in jar:file:/opt/services/ifc-captcha-dubbo-service/lib/dubbo-2.5.3.jar!/META-INF/dubbo/internal/com.alibaba.dubbo.container.Container, cause: org/mortbay/jetty/Connector
        at com.alibaba.dubbo.common.extension.ExtensionLoader.loadFile(ExtensionLoader.java:685)
        at com.alibaba.dubbo.common.extension.ExtensionLoader.loadExtensionClasses(ExtensionLoader.java:591)
        at com.alibaba.dubbo.common.extension.ExtensionLoader.getExtensionClasses(ExtensionLoader.java:567)
        at com.alibaba.dubbo.common.extension.ExtensionLoader.getDefaultExtensionName(ExtensionLoader.java:358)
        at com.alibaba.dubbo.container.Main.main(Main.java:50)
Caused by: java.lang.NoClassDefFoundError: org/mortbay/jetty/Connector
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:278)
        at com.alibaba.dubbo.common.extension.ExtensionLoader.loadFile(ExtensionLoader.java:627)
        ... 4 more
Caused by: java.lang.ClassNotFoundException: org.mortbay.jetty.Connector
        at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
        ... 7 more
, dubbo version: 2.5.3, current host: 127.0.0.1

问题分析:

一开始当jetty的问题处理,一直到排查为什么找不到jetty包,怎么才能加载到jetty包,看下dubbo包

[DUBBO] No such extension com.alibaba.dubbo.container.Container by name spring , possible causes:_第1张图片

看了启动脚本,也是用srping方式,没有jetty,可能配置的不能找不到spring时默认就用jetty

查证后发现dubbo.container=spring 是配置错了,有空格

[DUBBO] No such extension com.alibaba.dubbo.container.Container by name spring , possible causes:_第2张图片

其实报错的第一行已经很明确了,DUBBO] No such extension com.alibaba.dubbo.container.Container by name spring  , possible causes: ,对dubbo不太熟绕了很多路

你可能感兴趣的:(dubbo)