knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmin...@apache.org
Subject git commit: KNOX-297: Should not send Knox stack trace to client in error responses
Date Sun, 09 Mar 2014 19:39:09 GMT
Repository: knox
Updated Branches:
  refs/heads/master 99ba394a4 -> dc547086c


KNOX-297: Should not send Knox stack trace to client in error responses


Project: http://git-wip-us.apache.org/repos/asf/knox/repo
Commit: http://git-wip-us.apache.org/repos/asf/knox/commit/dc547086
Tree: http://git-wip-us.apache.org/repos/asf/knox/tree/dc547086
Diff: http://git-wip-us.apache.org/repos/asf/knox/diff/dc547086

Branch: refs/heads/master
Commit: dc547086c62657a76d4f76f442ba6ad9ad3f0112
Parents: 99ba394
Author: Kevin Minder <kevin.minder@hortonworks.com>
Authored: Sun Mar 9 15:39:09 2014 -0400
Committer: Kevin Minder <kevin.minder@hortonworks.com>
Committed: Sun Mar 9 15:39:09 2014 -0400

----------------------------------------------------------------------
 .../main/java/org/apache/hadoop/gateway/GatewayServer.java   | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/knox/blob/dc547086/gateway-server/src/main/java/org/apache/hadoop/gateway/GatewayServer.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/main/java/org/apache/hadoop/gateway/GatewayServer.java b/gateway-server/src/main/java/org/apache/hadoop/gateway/GatewayServer.java
index abfce3a..9ee0660 100644
--- a/gateway-server/src/main/java/org/apache/hadoop/gateway/GatewayServer.java
+++ b/gateway-server/src/main/java/org/apache/hadoop/gateway/GatewayServer.java
@@ -44,6 +44,7 @@ import org.apache.log4j.PropertyConfigurator;
 import org.eclipse.jetty.server.Connector;
 import org.eclipse.jetty.server.Server;
 import org.eclipse.jetty.server.handler.ContextHandlerCollection;
+import org.eclipse.jetty.server.handler.ErrorHandler;
 import org.eclipse.jetty.webapp.WebAppContext;
 import org.jboss.shrinkwrap.api.exporter.ExplodedExporter;
 import org.jboss.shrinkwrap.api.spec.WebArchive;
@@ -77,6 +78,7 @@ public class GatewayServer {
   private static Properties buildProperties;
 
   private Server jetty;
+  private ErrorHandler errorHandler;
   private GatewayConfig config;
   private ContextHandlerCollection contexts;
   private FileTopologyProvider monitor;
@@ -294,8 +296,7 @@ public class GatewayServer {
 
     // Create the global context handler.
     contexts = new ContextHandlerCollection();
-
-    // A map to keep track of current deployments by cluster name.
+     // A map to keep track of current deployments by cluster name.
     deployments = new ConcurrentHashMap<String, WebAppContext>();
 
     // Determine the socket address and check availability.
@@ -366,10 +367,13 @@ public class GatewayServer {
   private synchronized void internalDeploy( Topology topology, File warFile ) {
     String name = topology.getName();
     String warPath = warFile.getAbsolutePath();
+    errorHandler = new ErrorHandler();
+    errorHandler.setShowStacks(false);
     WebAppContext context = new WebAppContext();
     context.setDefaultsDescriptor( null );
     context.setContextPath( "/" + config.getGatewayPath() + "/" + name );
     context.setWar( warPath );
+    context.setErrorHandler(errorHandler);
     // internalUndeploy( topology ); KNOX-152
     context.setAttribute( GatewayServices.GATEWAY_CLUSTER_ATTRIBUTE, name );
     deployments.put( name, context );


Mime
View raw message