This is an automated email from the ASF dual-hosted git repository.
haonan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new 5732861f698 fixed rest start fail (#11398)
5732861f698 is described below
commit 5732861f698c0ef9357bdfa6b397f913caea74e1
Author: CloudWise-Lukemiao
<[email protected]>
AuthorDate: Sun Oct 29 19:54:44 2023 +0800
fixed rest start fail (#11398)
---
iotdb-core/datanode/pom.xml | 17 ++++++++++++-----
.../db/protocol/rest/filter/AuthorizationFilter.java | 3 ++-
pom.xml | 5 +++++
3 files changed, 19 insertions(+), 6 deletions(-)
diff --git a/iotdb-core/datanode/pom.xml b/iotdb-core/datanode/pom.xml
index dc272d74ed3..01b2dec2265 100644
--- a/iotdb-core/datanode/pom.xml
+++ b/iotdb-core/datanode/pom.xml
@@ -259,6 +259,16 @@
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlet</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.inject</groupId>
+ <artifactId>jersey-hk2</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ <scope>runtime</scope>
+ </dependency>
<dependency>
<groupId>com.github.ben-manes.caffeine</groupId>
<artifactId>caffeine</artifactId>
@@ -318,11 +328,6 @@
<artifactId>httpcore</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-databind</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.apache.ratis</groupId>
<artifactId>ratis-thirdparty-misc</artifactId>
@@ -523,6 +528,8 @@
<!-- We need these dependencies as they provide the
metric managers used in tests -->
<usedDependency>org.apache.iotdb:dropwizard-metrics</usedDependency>
<usedDependency>org.apache.iotdb:micrometer-metrics</usedDependency>
+ <!-- This dependency is required at runtime, when
esnabling the rest service -->
+
<usedDependency>org.glassfish.jersey.inject:jersey-hk2</usedDependency>
</usedDependencies>
</configuration>
</plugin>
diff --git
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/rest/filter/AuthorizationFilter.java
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/rest/filter/AuthorizationFilter.java
index 96dbca17425..8082c0390ef 100644
---
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/rest/filter/AuthorizationFilter.java
+++
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/rest/filter/AuthorizationFilter.java
@@ -155,7 +155,8 @@ public class AuthorizationFilter implements
ContainerRequestFilter, ContainerRes
public void filter(
ContainerRequestContext requestContext, ContainerResponseContext
responseContext)
throws IOException {
- if (SESSION_MANAGER.getSessionInfo(SESSION_MANAGER.getCurrSession()) !=
null) {
+ if (SESSION_MANAGER.getCurrSession() != null
+ && SESSION_MANAGER.getSessionInfo(SESSION_MANAGER.getCurrSession()) !=
null) {
SESSION_MANAGER.removeCurrSession();
}
}
diff --git a/pom.xml b/pom.xml
index 4e5ffe45016..e855dc7889c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1730,6 +1730,11 @@
<artifactId>orc-shims</artifactId>
<version>${orc-core.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.inject</groupId>
+ <artifactId>jersey-hk2</artifactId>
+ <version>${jersey.version}</version>
+ </dependency>
</dependencies>
</dependencyManagement>
<build>