微众Linkis1.0整合hadoop3启动报错NoSuchMethodError: org.eclipse.jetty.server...getSessionManager()解决

在这里记录下微众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下即可)

这个错误信息是由于缺少某个方法导致的。根据引用\[1\]和引用\[2\]中的信息,这个错误可能是由于缺少org.apache.hadoop.hive.ql.metadata.Hive.databaseExistsByView方法引起的。这个方法在Hive的元数据客户端中被调用,用于检查是否存在指定的数据库视图。然而,由于缺少这个方法,导致在执行相关任务时出现了异常。引用\[3\]中的信息也提到了HiveException和RuntimeException,这些都是由于缺少方法引起的异常。要解决这个问题,可以尝试更新Hive的版本或者检查是否有缺失的依赖。 #### 引用[.reference_title] - *1* [java.lang.NoSuchMethodError: org.apache.hadoop.hive.ql.session.SessionState](https://blog.csdn.net/qq_43306439/article/details/118767731)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [我无法访问Hive - 线程“main”中的异常java.lang.NoSuchMethodErrororg.apache.hadoop.security....](https://blog.csdn.net/weixin_39672194/article/details/116217992)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [HiveException java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.S](https://blog.csdn.net/weixin_42382758/article/details/124220443)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

头顶榴莲树

你的鼓励是我最大的动力~

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值