richard1230 opened a new issue #1931:
URL: https://github.com/apache/servicecomb-java-chassis/issues/1931


   Hello, I am the starter with servicecomb 2.0.0.
   When I use the 
sample(https://docs.servicecomb.io/java-chassis/zh_CN/start/first-sample/) to 
learn , I found an error .
   the steps to reproduce the error:
   
https://github.com/richard1230/helloService/blob/master/src/main/java/com/github/AppMain.java
   when run the AppMain.java,the error is as follows:
   ```
   10:32:10.707 [main] INFO  
org.apache.servicecomb.foundation.common.utils.JvmUtils[94] - Found main class 
"com.github.AppMain".
   10:32:10.717 [main] INFO  
org.apache.servicecomb.foundation.common.utils.JvmUtils[63] - Found main class 
"com.github.AppMain" by stackTrace.
   10:32:10.722 [main] INFO  
org.apache.servicecomb.foundation.common.utils.BeanUtils[93] - Scb scan package 
list: org.apache.servicecomb,com.github
   10:32:11.778 [main] INFO  
org.apache.servicecomb.config.ConfigurationSpringInitializer[80] - Environment 
received, will get configurations from 
[org.springframework.core.env.StandardEnvironment@405950359].
   10:32:11.810 [main] WARN  
com.netflix.config.sources.URLConfigurationSource[121] - No URLs will be polled 
as dynamic configuration sources.
   10:32:11.810 [main] INFO  
com.netflix.config.sources.URLConfigurationSource[122] - To enable URLs as 
dynamic configuration sources, define System property 
archaius.configurationSource.additionalUrls or make config.properties available 
on classpath.
   10:32:11.885 [main] INFO  org.apache.servicecomb.config.ConfigUtil[118] - 
create local config:
   10:32:11.885 [main] INFO  org.apache.servicecomb.config.ConfigUtil[120] -  
jar:file:/Users/mac/.m2/repository/org/apache/servicecomb/java-chassis-core/2.0.0/java-chassis-core-2.0.0.jar!/microservice.yaml.
   10:32:11.885 [main] INFO  org.apache.servicecomb.config.ConfigUtil[120] -  
jar:file:/Users/mac/.m2/repository/org/apache/servicecomb/solution-basic/2.0.0/solution-basic-2.0.0.jar!/microservice.yaml.
   10:32:11.885 [main] INFO  org.apache.servicecomb.config.ConfigUtil[120] -  
file:/Users/mac/IdeaProjects/HelloWorldService/target/classes/microservice.yaml.
   10:32:11.910 [main] INFO  
org.apache.servicecomb.foundation.common.utils.SPIServiceUtils[79] - Found SPI 
service org.apache.servicecomb.config.spi.ConfigCenterConfigurationSource, 
count=0.
   10:32:11.910 [main] INFO  
org.apache.servicecomb.foundation.common.utils.SPIServiceUtils[110] - Can not 
find SPI service for 
org.apache.servicecomb.config.spi.ConfigCenterConfigurationSource
   10:32:11.911 [main] INFO  org.apache.servicecomb.config.ConfigUtil[211] - 
config center SPI service can not find, skip to load configuration from config 
center
   10:32:11.922 [main] INFO  
org.apache.servicecomb.foundation.common.utils.SPIServiceUtils[110] - Can not 
find SPI service for 
org.apache.servicecomb.config.spi.ConfigCenterConfigurationSource
   10:32:11.926 [main] INFO  org.apache.servicecomb.config.ConfigUtil[118] - 
create local config:
   10:32:11.926 [main] INFO  org.apache.servicecomb.config.ConfigUtil[120] -  
jar:file:/Users/mac/.m2/repository/org/apache/servicecomb/java-chassis-core/2.0.0/java-chassis-core-2.0.0.jar!/microservice.yaml.
   10:32:11.926 [main] INFO  org.apache.servicecomb.config.ConfigUtil[120] -  
jar:file:/Users/mac/.m2/repository/org/apache/servicecomb/solution-basic/2.0.0/solution-basic-2.0.0.jar!/microservice.yaml.
   10:32:11.927 [main] INFO  org.apache.servicecomb.config.ConfigUtil[120] -  
file:/Users/mac/IdeaProjects/HelloWorldService/target/classes/microservice.yaml.
   10:32:11.940 [main] WARN  
org.springframework.context.support.ClassPathXmlApplicationContext[557] - 
Exception encountered during context initialization - cancelling refresh 
attempt: org.springframework.beans.factory.BeanCreationException: Error 
creating bean with name 'restProducers' defined in URL 
[jar:file:/Users/mac/.m2/repository/org/apache/servicecomb/provider-rest-common/2.0.0/provider-rest-common-2.0.0.jar!/org/apache/servicecomb/provider/rest/common/RestProducers.class]:
 Instantiation of bean failed; nested exception is 
org.springframework.beans.BeanInstantiationException: Failed to instantiate 
[org.apache.servicecomb.provider.rest.common.RestProducers]: Constructor threw 
exception; nested exception is java.lang.NoSuchMethodError: 
org.apache.servicecomb.foundation.common.utils.ReflectUtils.getClassByName(Ljava/lang/String;)Ljava/lang/Class;
   Exception in thread "main" 
org.springframework.beans.factory.BeanCreationException: Error creating bean 
with name 'restProducers' defined in URL 
[jar:file:/Users/mac/.m2/repository/org/apache/servicecomb/provider-rest-common/2.0.0/provider-rest-common-2.0.0.jar!/org/apache/servicecomb/provider/rest/common/RestProducers.class]:
 Instantiation of bean failed; nested exception is 
org.springframework.beans.BeanInstantiationException: Failed to instantiate 
[org.apache.servicecomb.provider.rest.common.RestProducers]: Constructor threw 
exception; nested exception is java.lang.NoSuchMethodError: 
org.apache.servicecomb.foundation.common.utils.ReflectUtils.getClassByName(Ljava/lang/String;)Ljava/lang/Class;
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1287)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1181)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
        at 
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:204)
        at 
org.springframework.context.support.PostProcessorRegistrationDelegate.registerBeanPostProcessors(PostProcessorRegistrationDelegate.java:240)
        at 
org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:721)
        at 
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:534)
        at 
org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:144)
        at 
org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:95)
        at 
org.apache.servicecomb.foundation.common.utils.BeanUtils.init(BeanUtils.java:54)
        at 
org.apache.servicecomb.foundation.common.utils.BeanUtils.init(BeanUtils.java:47)
        at com.github.AppMain.main(AppMain.java:7)
   Caused by: org.springframework.beans.BeanInstantiationException: Failed to 
instantiate [org.apache.servicecomb.provider.rest.common.RestProducers]: 
Constructor threw exception; nested exception is java.lang.NoSuchMethodError: 
org.apache.servicecomb.foundation.common.utils.ReflectUtils.getClassByName(Ljava/lang/String;)Ljava/lang/Class;
        at 
org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:184)
        at 
org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:87)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1279)
        ... 15 more
   Caused by: java.lang.NoSuchMethodError: 
org.apache.servicecomb.foundation.common.utils.ReflectUtils.getClassByName(Ljava/lang/String;)Ljava/lang/Class;
        at 
org.apache.servicecomb.provider.rest.common.RestProducers.<init>(RestProducers.java:39)
        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 
org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:172)
        ... 17 more
   ```
   
   


----------------------------------------------------------------
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:
[email protected]


Reply via email to