You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2019/04/26 04:01:54 UTC

[GitHub] [incubator-dubbo-samples] zhaixiaoxiang opened a new issue #75: update dubbo version to 2.7.1 for 'snakeyaml' not found in 2.7.0

zhaixiaoxiang opened a new issue #75: update dubbo version to 2.7.1 for 'snakeyaml' not found in 2.7.0
URL: https://github.com/apache/incubator-dubbo-samples/issues/75
 
 
   When we run MetadataConfigcenterProvider.main(), then we get failures as following, because 2.7.0 doesn't contains `snakeyaml` jar(But actually I don't know the reason, because dubbo-cluster has already contains 'snakeyaml').
   
   This is the exception stack:
   
   ```
   Exception in thread "main" java.lang.IllegalStateException: Extension instance(name: registry, class: interface org.apache.dubbo.rpc.Protocol)  could not be instantiated: org/yaml/snakeyaml/constructor/BaseConstructor
   	at org.apache.dubbo.common.extension.ExtensionLoader.createExtension(ExtensionLoader.java:539)
   	at org.apache.dubbo.common.extension.ExtensionLoader.getExtension(ExtensionLoader.java:344)
   	at org.apache.dubbo.rpc.Protocol$Adaptive.export(Protocol$Adaptive.java)
   	at org.apache.dubbo.config.ServiceConfig.doExportUrlsFor1Protocol(ServiceConfig.java:553)
   	at org.apache.dubbo.config.ServiceConfig.doExportUrls(ServiceConfig.java:402)
   	at org.apache.dubbo.config.ServiceConfig.doExport(ServiceConfig.java:363)
   	at org.apache.dubbo.config.ServiceConfig.export(ServiceConfig.java:345)
   	at org.apache.dubbo.config.spring.ServiceBean.export(ServiceBean.java:318)
   	at org.apache.dubbo.config.spring.ServiceBean.onApplicationEvent(ServiceBean.java:112)
   	at org.apache.dubbo.config.spring.ServiceBean.onApplicationEvent(ServiceBean.java:58)
   	at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
   	at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
   	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
   	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:393)
   	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:347)
   	at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:883)
   	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546)
   	at org.springframework.context.annotation.AnnotationConfigApplicationContext.<init>(AnnotationConfigApplicationContext.java:84)
   	at org.apache.dubbo.samples.metadatareport.configcenter.MetadataConfigcenterProvider.main(MetadataConfigcenterProvider.java:45)
   Caused by: java.lang.NoClassDefFoundError: org/yaml/snakeyaml/constructor/BaseConstructor
   	at org.apache.dubbo.registry.integration.AbstractConfiguratorListener.process(AbstractConfiguratorListener.java:62)
   	at org.apache.dubbo.registry.integration.AbstractConfiguratorListener.initWith(AbstractConfiguratorListener.java:46)
   	at org.apache.dubbo.registry.integration.RegistryProtocol$ProviderConfigurationListener.<init>(RegistryProtocol.java:577)
   	at org.apache.dubbo.registry.integration.RegistryProtocol.<init>(RegistryProtocol.java:98)
   	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
   	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
   	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
   	at java.lang.Class.newInstance(Class.java:442)
   	at org.apache.dubbo.common.extension.ExtensionLoader.createExtension(ExtensionLoader.java:526)
   	... 18 more
   Caused by: java.lang.ClassNotFoundException: org.yaml.snakeyaml.constructor.BaseConstructor
   	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
   	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
   	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
   	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
   	... 28 more
   ```
   
   After I update dubbo to 2.7.1, we could find `snakeyaml` in maven dependencies, but the version of `snakeyaml` is not correct, it use the dependency from `spring-boot-dependencies`, as following:
   ![image](https://user-images.githubusercontent.com/11908486/56782501-0131f380-681a-11e9-8528-20a8d18aac30.png)
   
   
   ![image](https://user-images.githubusercontent.com/11908486/56782625-79001e00-681a-11e9-974d-e98056b03cd9.png)
   
   because the level of `snakeyaml` in `spring-boot-dependencies` is high than `dubbo-dependencies-bom`, so maven choose the wrong version 1.17 from the former.
   
   
   
   
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org