阿里云EDAS开发常见问题


一、使用EDAS时,在启动消费者Ali-tomcat时启动失败,Pandora-container-stopped-

我开发使用的IntelliJIdea, 找到当前问题所在是在其tomcat日志文件中发现的,因此若你还没去查看过该日志文件建议去查看。该日志文件路径在: C:\Users\tom\.IntelliJIdea2017.3\system\tomcat\项目名\logs

在使用阿里的EDAS时,开发中启动消费者的web项目无法启动,控制台打印如下信息:

INFO: spas-client-initializer start
JM.Log:INFO Init JM logger with Log4jLoggerFactory
JM.Log:INFO Log root path: C:\Users\Vchar\logs\
JM.Log:INFO Set pandora log path: C:\Users\Vchar\logs\pandora
2018-07-06 18:21:33,391 com.taobao.tomcat.container.context.pandora.PandoraManager startInternal
INFO: Pandora container started.
log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
2018-07-06 18:21:41,283 org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
2018-07-06 18:21:41,287 org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [] startup failed due to previous errors
2018-07-06 18:21:41,436 com.taobao.tomcat.container.context.pandora.PandoraManager getPandoraLocation
INFO: found pandora location from system property: D:\devtools\taobao-tomcat-7.0.59\deploy\taobao-hsf.sar
2018-07-06 18:21:41,437 com.taobao.tomcat.container.context.pandora.PandoraManager stopInternal
INFO: Stopping pandora container: D:\devtools\taobao-tomcat-7.0.59\deploy\taobao-hsf.sar
[EagleEye][INFO] SelfLog async thread is exited
[EagleEye][INFO] closed AsyncAppender: AsyncAppender [appender=EagleEyeRollingFileAppender [filePath=C:\Users\Vchar\logs\eagleeye\eagleeye-self.log]]
INFO: spas-client-initializer stop
2018-07-06 18:21:41,853 com.taobao.tomcat.container.context.pandora.PandoraManager stopInternal
INFO: Pandora container stopped.
[2018-07-06 06:21:41,879] Artifact Skyecho-Web-New:war exploded: Error during artifact deployment. See server log for details.

根据提示去查看logs\eagleeye\eagleeye-self.log日志文件发现里面有如下错误:

[ERROR] failed to add tracing to RxJava.
java.lang.NoClassDefFoundError: io/reactivex/functions/Consumer
at com.taobao.eagleeye.EagleEye.addRxJavaTracing(EagleEye.java:506)
at com.taobao.eagleeye.EagleEye.init(EagleEye.java:585)
at com.taobao.eagleeye.EagleEye.init(EagleEye.java:616)
at com.taobao.eagleeye.EagleEye.<clinit>(EagleEye.java:529)
at com.taobao.eagleeye.EagleEyePandoraService.init(EagleEyePandoraService.java:37)
......
......
......
Caused by: com.taobao.pandora.common.exception.PandoraLoaderException: [Module-Loader] eagleeye-core: can not load class {io.reactivex.functions.Consumer} after all phase.
......
......

但是看了错误提示后一脸懵逼,不晓得如何解决,网上查了很久还是无果。最后又返回阿里官方文档去一个个的查阅,官方文档说tomcat启动失败时,请去查看tomcat的catalina.loglocalhost.log日志文件,在查阅了日志文档后发现是有同事的service的bean重复注入,导致启动失败,最后解决后项目正常启动。

因此在发现不晓得的错误后,最好去这两个日志文件头去查看一下。因为阿里的这个潘多拉容器会将我们的日志配置文件覆盖掉,同时它们自己也有一个日志配置。因此控制台打印的信息可能不全面。

网上其他的相似问题的解决方案:

  1. 解决方式一: 如果你使用的是Eclipse; 右键项目>properties>targeted runtimes>去掉 apache tomcat的勾
  2. 解决方式二: 由于本地启动了多个项目,导致容器在进行临时文件同步时发生错误,解决办法:在tomcat的启动参数上加上 -Dcom.taobao.pandora.tmp_path=D:\logs\pandoralog\coustomer-log 后面那个是你自己定义的一个路径。

现在阿里云HSF的官方文档已经比较完善,可以在到官方文档上去找对应的错误 https://help.aliyun.com/document_detail/142956.html


特别提醒:扫码关注微信订阅号'起岸星辰',实时掌握IT业界技术资讯! 转载请保留原文中的链接!
  目录