You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2020/04/29 14:38:26 UTC

[hbase] branch branch-2.3 updated: HBASE-24215 [Flakey Tests] [ERROR] TestSecureRESTServer java.lang.NoClassDefFoundError: com/sun/jersey/core/spi/factory/AbstractRuntimeDelegate Addendum: Add jersey-servlet to hadoop3 profile.

This is an automated email from the ASF dual-hosted git repository.

stack pushed a commit to branch branch-2.3
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-2.3 by this push:
     new a020e46  HBASE-24215 [Flakey Tests] [ERROR] TestSecureRESTServer java.lang.NoClassDefFoundError: com/sun/jersey/core/spi/factory/AbstractRuntimeDelegate Addendum: Add jersey-servlet to hadoop3 profile.
a020e46 is described below

commit a020e461c5a502b8c02a159db158d09e97d4ea71
Author: stack <st...@apache.org>
AuthorDate: Wed Apr 29 07:37:05 2020 -0700

    HBASE-24215 [Flakey Tests] [ERROR] TestSecureRESTServer java.lang.NoClassDefFoundError: com/sun/jersey/core/spi/factory/AbstractRuntimeDelegate
    Addendum: Add jersey-servlet to hadoop3 profile.
    
    Made the hadoop3 profile in top-level pom same as it is for hadoop2
    when it comes to exclusions. Then backed out previous attempt mostly.
    Made the failing test medium-sized so it ran in its own jvm.
---
 hbase-rest/pom.xml                                 | 54 ++++++----------------
 .../org/apache/hadoop/hbase/rest/RESTServer.java   |  6 +--
 .../hadoop/hbase/rest/TestSecureRESTServer.java    |  4 +-
 .../apache/hadoop/hbase/HBaseTestingUtility.java   |  1 +
 .../hbase/thrift/TestBindExceptionHandling.java    |  8 +++-
 pom.xml                                            | 12 +++++
 6 files changed, 39 insertions(+), 46 deletions(-)

diff --git a/hbase-rest/pom.xml b/hbase-rest/pom.xml
index 63b9127..49231b1 100644
--- a/hbase-rest/pom.xml
+++ b/hbase-rest/pom.xml
@@ -210,27 +210,11 @@
       <exclusions>
         <!--This dependency pulls in hadoop-minicluster
              which pulls in the below. It messes up
-             this build at assembly time. See HBASE-22029-->
+        this build at assembly time. See HBASE-22029 -->
         <exclusion>
          <groupId>com.sun.jersey</groupId>
          <artifactId>jersey-core</artifactId>
         </exclusion>
-        <exclusion>
-         <groupId>com.sun.jersey</groupId>
-         <artifactId>jersey-client</artifactId>
-        </exclusion>
-        <exclusion>
-         <groupId>com.sun.jersey</groupId>
-         <artifactId>jersey-server</artifactId>
-        </exclusion>
-        <exclusion>
-         <groupId>com.sun.jersey</groupId>
-         <artifactId>jersey-json</artifactId>
-        </exclusion>
-        <exclusion>
-         <groupId>com.sun.jersey.contribs</groupId>
-         <artifactId>jersey-guice</artifactId>
-        </exclusion>
       </exclusions>
     </dependency>
     <dependency>
@@ -427,10 +411,6 @@
               <groupId>com.google.guava</groupId>
               <artifactId>guava</artifactId>
             </exclusion>
-            <exclusion>
-              <groupId>com.sun.jersey</groupId>
-              <artifactId>jersey-server</artifactId>
-            </exclusion>
           </exclusions>
         </dependency>
         <dependency>
@@ -510,24 +490,8 @@
           <scope>test</scope>
           <exclusions>
             <exclusion>
-              <groupId>com.sun.jersey</groupId>
-              <artifactId>jersey-client</artifactId>
-            </exclusion>
-            <!--
-            Can't exclude this one; dependency on com.sun.xml package
-              included from here.
-            <exclusion>
-              <groupId>com.sun.jersey</groupId>
-              <artifactId>jersey-json</artifactId>
-            </exclusion>
-            -->
-            <exclusion>
-              <groupId>com.sun.jersey.contribs</groupId>
-              <artifactId>jersey-guice</artifactId>
-            </exclusion>
-            <exclusion>
-              <groupId>com.sun.jersey</groupId>
-              <artifactId>jersey-server</artifactId>
+              <groupId>com.google.guava</groupId>
+              <artifactId>guava</artifactId>
             </exclusion>
           </exclusions>
         </dependency>
@@ -543,6 +507,18 @@
           <groupId>org.apache.hadoop</groupId>
           <artifactId>hadoop-auth</artifactId>
         </dependency>
+        <dependency>
+          <!--Fixes complaint when running TestSecureRESTServer-->
+          <groupId>com.sun.jersey</groupId>
+          <artifactId>jersey-servlet</artifactId>
+          <version>1.19.4</version>
+          <exclusions>
+            <exclusion>
+             <groupId>javax.ws.rs</groupId>
+             <artifactId>jsr311-api</artifactId>
+            </exclusion>
+          </exclusions>
+        </dependency>
       </dependencies>
     </profile>
     <profile>
diff --git a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/RESTServer.java b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/RESTServer.java
index 3411ef2..32605ae 100644
--- a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/RESTServer.java
+++ b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/RESTServer.java
@@ -118,7 +118,7 @@ public class RESTServer implements Constants {
     HelpFormatter formatter = new HelpFormatter();
     formatter.printHelp("hbase rest start", "", options,
       "\nTo run the REST server as a daemon, execute " +
-      "hbase-daemon.sh start|stop rest [--infoport <port>] [-p <port>] [-ro]\n", true);
+      "hbase-daemon.sh start|stop rest [-i <port>] [-p <port>] [-ro]\n", true);
     System.exit(exitCode);
   }
 
@@ -186,7 +186,7 @@ public class RESTServer implements Constants {
     options.addOption("p", "port", true, "Port to bind to [default: " + DEFAULT_LISTEN_PORT + "]");
     options.addOption("ro", "readonly", false, "Respond only to GET HTTP " +
       "method requests [default: false]");
-    options.addOption(null, "infoport", true, "Port for web UI");
+    options.addOption("i", "infoport", true, "Port for WEB UI");
 
     CommandLine commandLine = null;
     try {
@@ -218,7 +218,7 @@ public class RESTServer implements Constants {
       String val = commandLine.getOptionValue("infoport");
       conf.setInt("hbase.rest.info.port", Integer.parseInt(val));
       if (LOG.isDebugEnabled()) {
-        LOG.debug("Web UI port set to " + val);
+        LOG.debug("WEB UI port set to " + val);
       }
     }
 
diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestSecureRESTServer.java b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestSecureRESTServer.java
index 58f7c10..01d81c2 100644
--- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestSecureRESTServer.java
+++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestSecureRESTServer.java
@@ -56,8 +56,8 @@ import org.apache.hadoop.hbase.security.access.AccessControlConstants;
 import org.apache.hadoop.hbase.security.access.AccessController;
 import org.apache.hadoop.hbase.security.access.Permission.Action;
 import org.apache.hadoop.hbase.security.token.TokenProvider;
+import org.apache.hadoop.hbase.testclassification.MediumTests;
 import org.apache.hadoop.hbase.testclassification.MiscTests;
-import org.apache.hadoop.hbase.testclassification.SmallTests;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.Pair;
 import org.apache.hadoop.hdfs.DFSConfigKeys;
@@ -101,7 +101,7 @@ import org.slf4j.LoggerFactory;
  * Test class for SPNEGO authentication on the HttpServer. Uses Kerby's MiniKDC and Apache
  * HttpComponents to verify that a simple Servlet is reachable via SPNEGO and unreachable w/o.
  */
-@Category({MiscTests.class, SmallTests.class})
+@Category({MiscTests.class, MediumTests.class})
 public class TestSecureRESTServer {
 
   @ClassRule
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
index fcf5bc8..4c22e18 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
@@ -731,6 +731,7 @@ public class HBaseTestingUtility extends HBaseZKTestingUtility {
     // Frustrate yarn's and hdfs's attempts at writing /tmp.
     // Below is fragile. Make it so we just interpolate any 'tmp' reference.
     createDirAndSetProperty("yarn.node-labels.fs-store.root-dir");
+    createDirAndSetProperty("yarn.node-attribute.fs-store.root-dir");
     createDirAndSetProperty("yarn.nodemanager.log-dirs");
     createDirAndSetProperty("yarn.nodemanager.remote-app-log-dir");
     createDirAndSetProperty("yarn.timeline-service.entity-group-fs-store.active-dir");
diff --git a/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestBindExceptionHandling.java b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestBindExceptionHandling.java
index 9fc9542..fb8b127 100644
--- a/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestBindExceptionHandling.java
+++ b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestBindExceptionHandling.java
@@ -42,7 +42,9 @@ public class TestBindExceptionHandling {
         createBoundServer(true, false);
       assertNotNull(thriftServer.tserver);
     } finally {
-      thriftServer.stop();
+      if (thriftServer != null) {
+        thriftServer.stop();
+      }
     }
   }
 
@@ -57,7 +59,9 @@ public class TestBindExceptionHandling {
         createBoundServer(false, true);
       assertNotNull(thriftServer.tserver);
     } finally {
-      thriftServer.stop();
+      if (thriftServer != null) {
+        thriftServer.stop();
+      }
     }
   }
 }
diff --git a/pom.xml b/pom.xml
index ffa9f5c..178f025 100755
--- a/pom.xml
+++ b/pom.xml
@@ -2893,6 +2893,10 @@
                <artifactId>netty</artifactId>
              </exclusion>
               <exclusion>
+                <groupId>javax.servlet</groupId>
+                <artifactId>servlet-api</artifactId>
+              </exclusion>
+              <exclusion>
                 <groupId>javax.inject</groupId>
                 <artifactId>javax.inject</artifactId>
               </exclusion>
@@ -2923,6 +2927,10 @@
                <groupId>io.netty</groupId>
                <artifactId>netty</artifactId>
              </exclusion>
+              <exclusion>
+                <groupId>javax.servlet</groupId>
+                <artifactId>servlet-api</artifactId>
+              </exclusion>
            </exclusions>
          </dependency>
          <dependency>
@@ -2940,6 +2948,10 @@
                <groupId>io.netty</groupId>
                <artifactId>netty</artifactId>
              </exclusion>
+              <exclusion>
+                <groupId>javax.servlet</groupId>
+                <artifactId>servlet-api</artifactId>
+              </exclusion>
            </exclusions>
          </dependency>
          <dependency>