美文网首页
常见问题

常见问题

作者: jeho0815 | 来源:发表于2018-05-17 09:41 被阅读0次

    1、CSE服务拉起过程中,只打印了部分日志,没有什么异常信息
    原因:Spring初始化过程中主线程被阻塞,导致整个初始化都卡住了,可以使用jstack查看线程

    2、

    2018-06-26 17:04:49,082 [WARN] Exception encountered during context initialization - cancelling refresh 
    attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.servicecomb.config.ConfigurationSpringInitializer#0' defined in URL [jar:file:/D:/Maven/repository/org/apache/servicecomb/foundation-config/1.0.0.B013/foundation-config-1.0.0.B013.jar!/META-INF/spring/cse.bean.xml]: Initialization of bean failed; nested exception is java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551)
    Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.servicecomb.config.ConfigurationSpringInitializer#0' defined in URL [jar:file:/D:/Maven/repository/org/apache/servicecomb/foundation-config/1.0.0.B013/foundation-config-1.0.0.B013.jar!/META-INF/spring/cse.bean.xml]: Initialization of bean failed; nested exception is java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:564)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
        at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:151)
        at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:687)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:525)
        at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
        at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
        at org.apache.servicecomb.foundation.common.utils.BeanUtils.init(BeanUtils.java:37)
        at org.apache.servicecomb.foundation.common.utils.BeanUtils.init(BeanUtils.java:33)
        at com.huawei.appmarket.fmc.FmcTestMain.init(FmcTestMain.java:28)
        at com.huawei.appmarket.fmc.FmcTestMain.main(FmcTestMain.java:33)
    Caused by: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
        at org.apache.servicecomb.foundation.ssl.SSLOption.getStringProperty(SSLOption.java:267)
        at org.apache.servicecomb.foundation.ssl.SSLOption.buildFromYaml(SSLOption.java:365)
        at org.apache.servicecomb.config.client.ConfigCenterClient.createHttpClientOptions(ConfigCenterClient.java:216)
        at org.apache.servicecomb.config.client.ConfigCenterClient.deployConfigClient(ConfigCenterClient.java:192)
        at org.apache.servicecomb.config.client.ConfigCenterClient.connectServer(ConfigCenterClient.java:133)
        at org.apache.servicecomb.config.archaius.sources.ConfigCenterConfigurationSourceImpl.init(ConfigCenterConfigurationSourceImpl.java:70)
        at org.apache.servicecomb.config.archaius.sources.ConfigCenterConfigurationSourceImpl.init(ConfigCenterConfigurationSourceImpl.java:76)
        at org.apache.servicecomb.config.ConfigUtil.installDynamicConfig(ConfigUtil.java:257)
        at org.apache.servicecomb.config.ConfigurationSpringInitializer.setEnvironment(ConfigurationSpringInitializer.java:65)
        at org.springframework.context.support.ApplicationContextAwareProcessor.invokeAwareInterfaces(ApplicationContextAwareProcessor.java:106)
        at org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:97)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:409)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1626)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
    

    原因:microservice.yaml文件里面ssl配置有数字格式,需要使用引号引起来

    3、使用RPC方式调用出现空指针,使用RestTemplate调用没问题

    Caused by: java.lang.NullPointerException
        at org.apache.servicecomb.common.rest.definition.path.AbstractUrlParamWriter.getParamValue(AbstractUrlParamWriter.java:30)
        at org.apache.servicecomb.common.rest.definition.path.PathVarParamWriter.write(PathVarParamWriter.java:32)
        at org.apache.servicecomb.common.rest.definition.path.URLPathBuilder.genPathString(URLPathBuilder.java:111)
        at org.apache.servicecomb.common.rest.definition.path.URLPathBuilder.createRequestPath(URLPathBuilder.java:97)
        at org.apache.servicecomb.transport.rest.client.http.RestClientInvocation.createRequestPath(RestClientInvocation.java:211)
        at org.apache.servicecomb.transport.rest.client.http.RestClientInvocation.invoke(RestClientInvocation.java:81)
        at org.apache.servicecomb.transport.rest.client.RestTransportClient.send(RestTransportClient.java:103)
    

    原因: 接口定义了一个path参数,但是客户端没有传入,会导致设置参数的时候为null

    4、ServiceComb使用kill pid不能触发优雅停机,但是可以使用kill -1 pid来触发
    原因: 业务代码使用JAVA的sun.misc.SignalHandler机制自己接收了信号量,导致优雅停机的shutDownHook机制不起作用

    相关文章

      网友评论

          本文标题:常见问题

          本文链接:https://www.haomeiwen.com/subject/wqnvdftx.html