Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于linkis-spring-cloud-gateway 服务的空指针以及gatewayProperties无法赋值问题 #1086

Closed
joy12825 opened this issue Nov 12, 2021 · 5 comments
Labels
component=SpringCloudServices/Gateway The Gateway component of SpringCloudServices

Comments

@joy12825
Copy link

问题描述
问题1
按照文档来操作调试,网关的一切配置准备就绪后,启动网关服务时,SpringCloudGatewayConfiguration.scala 抛出空指针问题,问题截图如下:
image
另外查看源码时还有一个疑问,如下图
image
gatewayParsers、gatewayRouters变量是如何赋值的,我的理解是初始时为null,没有找到赋值的地方,故出现以上空指针问题,望解答,谢谢!
问题2
如下图:gatewayProperties无法取到yml配置文件的赋值(增加依赖可解决:javax.el-api、javax.el)
image

本地启动配置如下
资源文件列表:
image
application.yml:
image
linkis.properties:
image
linkis-mg-gateway.properties:
image

@peacewong peacewong added the component=SpringCloudServices/Gateway The Gateway component of SpringCloudServices label Nov 23, 2021
@mengfanzhen
Copy link

请问gatewayRouters 为空的问题是怎么解决的?直接判空?

@joy12825
Copy link
Author

joy12825 commented Dec 22, 2021

@mengfanzhen 可以先暂时这样 image

@joy12825
Copy link
Author

@peacewong 感谢标记,问题本人已经解决,解决方案如图
image
需要把linkis-gateway-server-support模块加入到linkis-spring-cloud-gateway模块启动classpath中(不是加入依赖,会报循环依赖)即可启动linkis-spring-cloud-gateway服务,且不会报空指针

@peacewong
Copy link
Contributor

Thank you, because the gateway module needs to be debugged is linkis-gateway-server-support

@joy12825
Copy link
Author

joy12825 commented Dec 27, 2021

The GatewayRouter‘s subclasses are
image
I think when it dependent injection,will automatically find subclasses,however subclasses are in linkis-gateway-server-support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component=SpringCloudServices/Gateway The Gateway component of SpringCloudServices
Projects
None yet
Development

No branches or pull requests

3 participants