在这里记录下微众Linkis1.0.0在与Hadoop3.1.1整合时产生的依赖问题,编译没问题,但是在安装完后启动微服务linkis-ps-publicservic时报错,我们看下具体错误:
2021-07-23 13:20:39.532 [INFO ] [main ] o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker (335) [postProcessAfterInitialization] - Bean 'insLabelCacheConfiguration' of type [com.webank.wedatasphere.linkis.instance.lab
el.cache.InsLabelCacheConfiguration$$EnhancerBySpringCGLIB$$a795fc1] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)2021-07-23 13:20:39.973 [INFO ] [main ] o.e.j.u.log (169) [initialized] - Logging initialized @6789ms to org.eclipse.jetty.util.log.Slf4jLog
2021-07-23 13:20:40.174 [INFO ] [main ] o.s.b.w.e.j.JettyServletWebServerFactory (147) [getWebServer] - Server initialized with port: 9105
2021-07-23 13:20:40.213 [INFO ] [main ] o.e.j.s.Server (359) [doStart] - jetty-9.4.30.v20200611; built: 2020-06-11T12:34:51.929Z; git: 271836e4c1f4612f12b7bb13ef5a92a927634b0d; jvm 1.8.0_262-b10
2021-07-23 13:20:40.261 [WARN ] [main ] o.e.j.w.WebAppContext (533) [doStart] - Failed startup of context o.s.b.w.e.j.JettyEmbeddedWebAppContext@7f9b851c{application,/,[file:///tmp/jetty-docbase.4815154558816357950.9105/],UNAVAILABLE}
java.lang.NoSuchMethodError: org.eclipse.jetty.server.session.SessionHandler.getSessionManager()Lorg/eclipse/jetty/server/SessionManager;
at org.eclipse.jetty.servlet.ServletContextHandler$Context.getSessionCookieConfig(ServletContextHandler.java:1415) ~[jetty-servlet-9.3.19.v20170502.jar:9.3.19.v20170502]
at org.springframework.boot.web.servlet.server.AbstractServletWebServerFactory$SessionConfiguringInitializer.onStartup(AbstractServletWebServerFactory.java:303) ~[spring-boot-2.3.2.RELEASE.jar:2.3.2.RELEASE]
at org.springframework.boot.web.embedded.jetty.ServletContextInitializerConfiguration.callInitializers(ServletContextInitializerConfiguration.java:65) ~[spring-boot-2.3.2.RELEASE.jar:2.3.2.RELEASE]
at org.springframework.boot.web.embedded.jetty.ServletContextInitializerConfiguration.configure(ServletContextInitializerConfiguration.java:54) ~[spring-boot-2.3.2.RELEASE.jar:2.3.2.RELEASE]
at org.eclipse.jetty.webapp.WebAppContext.configure(WebAppContext.java:498) ~[jetty-webapp-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1402) ~[jetty-webapp-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:821) ~[jetty-server-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:262) ~[jetty-servlet-9.3.19.v20170502.jar:9.3.19.v20170502]
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:524) [jetty-webapp-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72) [jetty-util-9.4.30.v20200611.jar:9.4.30.v20200611]
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169) [jetty-util-9.4.30.v20200611.jar:9.4.30.v20200611]
at org.eclipse.jetty.server.Server.start(Server.java:407) [jetty-server-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:110) [jetty-util-9.4.30.v20200611.jar:9.4.30.v20200611]
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:106) [jetty-server-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.server.Server.doStart(Server.java:371) [jetty-server-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72) [jetty-util-9.4.30.v20200611.jar:9.4.30.v20200611]
at org.springframework.boot.web.embedded.jetty.JettyWebServer.initialize(JettyWebServer.java:136) [spring-boot-2.3.2.RELEASE.jar:2.3.2.RELEASE]
at org.springframework.boot.web.embedded.jetty.JettyWebServer.<init>(JettyWebServer.java:92) [spring-boot-2.3.2.RELEASE.jar:2.3.2.RELEASE]
at org.springframework.boot.web.embedded.jetty.JettyServletWebServerFactory.getJettyWebServer(JettyServletWebServerFactory.java:408) [spring-boot-2.3.2.RELEASE.jar:2.3.2.RELEASE]
at org.springframework.boot.web.embedded.jetty.JettyServletWebServerFactory.getWebServer(JettyServletWebServerFactory.java:162) [spring-boot-2.3.2.RELEASE.jar:2.3.2.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:178) [spring-boot-2.3.2.RELEASE.jar:2.3.2.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:158) [spring-boot-2.3.2.RELEASE.jar:2.3.2.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:545) [spring-context-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143) [spring-boot-2.3.2.RELEASE.jar:2.3.2.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758) [spring-boot-2.3.2.RELEASE.jar:2.3.2.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750) [spring-boot-2.3.2.RELEASE.jar:2.3.2.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.3.2.RELEASE.jar:2.3.2.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-2.3.2.RELEASE.jar:2.3.2.RELEASE]
at com.webank.wedatasphere.linkis.DataWorkCloudApplication.main(DataWorkCloudApplication.java:108) [linkis-module-1.0.0.jar:?]
at com.webank.wedatasphere.linkis.LinkisBaseServerApp.main(LinkisBaseServerApp.java:48) [linkis-module-1.0.0.jar:?]
at com.webank.wedatasphere.linkis.jobhistory.LinkisPublicServiceApp.main(LinkisPublicServiceApp.java:24) [linkis-jobhistory-1.0.0.jar:?]
2021-07-23 13:20:40.280 [INFO ] [main ] o.e.j.s.h.ContextHandler (1007) [doStop] - Stopped o.s.b.w.e.j.JettyEmbeddedWebAppContext@7f9b851c{application,/,[file:///tmp/jetty-docbase.4815154558816357950.9105/],UNAVAILABLE}
2021-07-23 13:20:40.280 [WARN ] [main ] o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext (559) [refresh] - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.App
licationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Jetty web server2021-07-23 13:20:40.300 [INFO ] [main ] o.s.b.a.l.ConditionEvaluationReportLoggingListener (136) [logMessage] -
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-07-23 13:20:40.305 [ERROR] [main ] o.s.b.d.LoggingFailureAnalysisReporter (40) [report]
根据日志我们追踪到错误是发生在jetty-servlet-9.3.19.v20170502.jar包的ServletContextHandler.java类第1415行,我们将jetty-servlet-9.3.19.v20170502.jar解压反编译,然后找到到这个类的这1415行,可以看到这行调用了getSessionManager方法,如图
但是现有的jetty版本(jetty-server-9.4.20.v20190813)已去掉了该方法,所以报错,所以我们要找适配的jetty-servlet包版本,通过比对发现jetty-servlet-9.4.20.v20190813包可用(将新包替换到lib/linkis-commons/public-module下即可)