You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by mo...@apache.org on 2021/12/24 13:33:42 UTC
[incubator-doris] branch master updated: [fix](fe-ut) Fix NPE when start FE in unit test. (#7471)
This is an automated email from the ASF dual-hosted git repository.
morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git
The following commit(s) were added to refs/heads/master by this push:
new 2347f12 [fix](fe-ut) Fix NPE when start FE in unit test. (#7471)
2347f12 is described below
commit 2347f128b07d510ee07904ab60f446cf5f90e18c
Author: Shuo Wang <wa...@gmail.com>
AuthorDate: Fri Dec 24 21:33:30 2021 +0800
[fix](fe-ut) Fix NPE when start FE in unit test. (#7471)
Before this PR, NPE would be thrown if start FE in a unit test.
---
.gitignore | 2 +-
fe/fe-core/src/main/java/org/apache/doris/httpv2/HttpServer.java | 5 ++++-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/.gitignore b/.gitignore
index f1a2a54..5029d87 100644
--- a/.gitignore
+++ b/.gitignore
@@ -71,4 +71,4 @@ samples/doris-demo/*/target
# ignore vscode project file
.vscode
-
+derby.log
diff --git a/fe/fe-core/src/main/java/org/apache/doris/httpv2/HttpServer.java b/fe/fe-core/src/main/java/org/apache/doris/httpv2/HttpServer.java
index d52c73c..0904463 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/httpv2/HttpServer.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/httpv2/HttpServer.java
@@ -85,7 +85,10 @@ public class HttpServer extends SpringBootServletInitializer {
// This is to disable the spring-boot-devtools restart feature.
// To avoid some unexpected behavior.
System.setProperty("spring.devtools.restart.enabled", "false");
- System.setProperty("spring.http.multipart.location", PaloFe.DORIS_HOME_DIR);
+ // Value of `DORIS_HOME_DIR` is null in unit test.
+ if (PaloFe.DORIS_HOME_DIR != null) {
+ System.setProperty("spring.http.multipart.location", PaloFe.DORIS_HOME_DIR);
+ }
System.setProperty("spring.banner.image.location", "doris-logo.png");
properties.put("logging.config", Config.custom_config_dir + "/" + SpringLog4j2Config.SPRING_LOG_XML_FILE);
new SpringApplicationBuilder()
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org