ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oleew...@apache.org
Subject ambari git commit: AMBARI-17711. Updating jetty version from 6 to 9.2 for Log Search (Hayat Behlim via oleewere)
Date Mon, 18 Jul 2016 10:31:15 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.4 b0c77fb1f -> 2c26dbab2


AMBARI-17711. Updating jetty version from 6 to 9.2 for Log Search (Hayat Behlim via oleewere)


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

Branch: refs/heads/branch-2.4
Commit: 2c26dbab2eb47f2d834554e380b5c815f7b822d1
Parents: b0c77fb
Author: oleewere <oleewere@gmail.com>
Authored: Mon Jul 18 12:23:08 2016 +0200
Committer: oleewere <oleewere@gmail.com>
Committed: Mon Jul 18 12:30:19 2016 +0200

----------------------------------------------------------------------
 .../ambari-logsearch-portal/pom.xml             |  71 ++++++--
 .../org/apache/ambari/logsearch/LogSearch.java  | 169 +++++++++++++------
 .../LogsearchAuthSuccessHandler.java            |  13 +-
 .../LogsearchLogoutSuccessHandler.java          |   7 +-
 .../LogsearchAuthenticationProvider.java        |   2 +
 .../src/main/resources/logsearch.properties     |   5 -
 .../META-INF/security-applicationContext.xml    |  23 +--
 .../src/main/webapp/WEB-INF/web.xml             |   2 +-
 .../src/main/webapp/login.html                  | 155 +++++++++++++++++
 .../src/main/webapp/login.jsp                   | 155 -----------------
 .../src/main/webapp/scripts/utils/Utils.js      |   4 +-
 .../webapp/scripts/views/common/ProfileBar.js   |   2 +-
 .../LOGSEARCH/0.5.0/package/scripts/params.py   |   2 +-
 13 files changed, 362 insertions(+), 248 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/2c26dbab/ambari-logsearch/ambari-logsearch-portal/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/pom.xml b/ambari-logsearch/ambari-logsearch-portal/pom.xml
index b7ce7ca..fcdc77d 100755
--- a/ambari-logsearch/ambari-logsearch-portal/pom.xml
+++ b/ambari-logsearch/ambari-logsearch-portal/pom.xml
@@ -34,6 +34,7 @@
     <spring.security.version>4.0.4.RELEASE</spring.security.version>
     <spring.ldap.version>2.0.4.RELEASE</spring.ldap.version>
     <jersey.version>1.19</jersey.version>
+    <jetty-version>9.2.11.v20150529</jetty-version>
   </properties>
   <profiles>
     <!-- Dev Profile Start -->
@@ -518,16 +519,16 @@
     <artifactId>jersey-apache-client</artifactId>
     <version>${jersey.version}</version>
   </dependency>
-    <dependency>
-      <groupId>javax.servlet</groupId>
-      <artifactId>javax.servlet-api</artifactId>
-      <version>3.1.0</version>
-    </dependency>
-    <dependency>
-      <groupId>log4j</groupId>
-      <artifactId>log4j</artifactId>
-      <version>1.2.17</version>
-    </dependency>
+  <dependency>
+    <groupId>javax.servlet</groupId>
+    <artifactId>javax.servlet-api</artifactId>
+    <version>3.1.0</version>
+  </dependency>
+      <dependency>
+    <groupId>log4j</groupId>
+    <artifactId>log4j</artifactId>
+    <version>1.2.17</version>
+  </dependency>
     <dependency>
       <groupId>org.apache.solr</groupId>
       <artifactId>solr-solrj</artifactId>
@@ -543,6 +544,20 @@
       <groupId>org.apache.hadoop</groupId>
       <artifactId>hadoop-common</artifactId>
       <version>2.7.0</version>
+      <exclusions>
+        <exclusion>
+          <groupId>javax.servlet</groupId>
+          <artifactId>servlet-api</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.mortbay.jetty</groupId>
+          <artifactId>jetty</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.mortbay.jetty</groupId>
+          <artifactId>jetty-util</artifactId>
+        </exclusion>
+      </exclusions>
     </dependency>
     <dependency>
       <groupId>commons-io</groupId>
@@ -550,10 +565,6 @@
       <version>2.4</version>
     </dependency>
     <dependency>
-      <groupId>commons-codec</groupId>
-      <artifactId>commons-codec</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.apache.ambari</groupId>
       <artifactId>ambari-logsearch-appender</artifactId>
       <version>${project.version}</version>
@@ -568,5 +579,37 @@
       <artifactId>ambari-metrics-common</artifactId>
       <version>${project.version}</version>
     </dependency>
+    <dependency>
+      <groupId>commons-cli</groupId>
+      <artifactId>commons-cli</artifactId>
+      <version>1.3.1</version>
+    </dependency>
+    <dependency>
+      <groupId>org.eclipse.jetty</groupId>
+      <artifactId>jetty-webapp</artifactId>
+      <version>${jetty-version}</version>
+      <exclusions>
+        <exclusion>
+          <groupId>org.springframework</groupId>
+          <artifactId>*</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>org.eclipse.jetty</groupId>
+      <artifactId>jetty-annotations</artifactId>
+      <version>${jetty-version}</version>
+      <exclusions>
+        <exclusion>
+          <groupId>org.springframework</groupId>
+          <artifactId>*</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>cglib</groupId>
+      <artifactId>cglib</artifactId>
+      <version>3.2.4</version>
+    </dependency>
   </dependencies>
 </project>

http://git-wip-us.apache.org/repos/asf/ambari/blob/2c26dbab/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/LogSearch.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/LogSearch.java
b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/LogSearch.java
index 77f4185..627d5a4 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/LogSearch.java
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/LogSearch.java
@@ -18,9 +18,11 @@
  */
 package org.apache.ambari.logsearch;
 
+import java.io.IOException;
+import java.net.ServerSocket;
 import java.net.URI;
-import java.util.ArrayList;
-import java.util.List;
+import java.net.URISyntaxException;
+import java.net.URL;
 import java.util.Timer;
 
 import org.apache.ambari.logsearch.common.ManageStartEndTime;
@@ -28,8 +30,18 @@ import org.apache.ambari.logsearch.solr.metrics.SolrMetricsLoader;
 import org.apache.ambari.logsearch.util.ConfigUtil;
 import org.apache.ambari.logsearch.util.PropertiesUtil;
 import org.apache.commons.lang.StringUtils;
-import org.apache.hadoop.http.HttpServer2;
 import org.apache.log4j.Logger;
+import org.eclipse.jetty.server.Connector;
+import org.eclipse.jetty.server.HttpConfiguration;
+import org.eclipse.jetty.server.HttpConnectionFactory;
+import org.eclipse.jetty.server.SecureRequestCustomizer;
+import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.server.ServerConnector;
+import org.eclipse.jetty.server.SslConnectionFactory;
+import org.eclipse.jetty.util.resource.Resource;
+import org.eclipse.jetty.util.ssl.SslContextFactory;
+import org.eclipse.jetty.webapp.WebAppContext;
+
 
 public class LogSearch {
   private static final Logger logger = Logger.getLogger(LogSearch.class);
@@ -48,67 +60,128 @@ public class LogSearch {
   private static final String HTTP_PROTOCOL = "http";
   private static final String HTTPS_PORT = "61889";
   private static final String HTTP_PORT = "61888";
+  
+  private static final String WEB_RESOURCE_FOLDER = "webapps/app";
+  private static final String ROOT_CONTEXT = "/";
 
+ 
   public static void main(String[] argv) {
-    HttpServer2.Builder builder = new HttpServer2.Builder();
-    builder.setName("app");
-
-    URI logsearchURI = addUri(argv, builder);
-    builder.setFindPort(false);
-    List<String> pathList = new ArrayList<String>();
-    pathList.add("/*");
-    builder.setPathSpec(pathList.toArray(new String[0]));
-    builder.needsClientAuth(false);
+    LogSearch logSearch = new LogSearch();
     Timer timer = new Timer();
     timer.schedule(new ManageStartEndTime(), 0, 40000);
     try {
-      logger.info("Starting logsearch server URI=" + logsearchURI);
-      HttpServer2 server = builder.build();
-      server.start();
       ConfigUtil.initializeApplicationConfig();
-      logger.info(server.toString());
+      logSearch.run(argv);
     } catch (Throwable e) {
       logger.error("Error running logsearch server", e);
     }
-
     SolrMetricsLoader.startSolrMetricsLoaderTasks();
   }
-
-  private static URI addUri(String[] argv, HttpServer2.Builder builder) {
+  
+  public void run(String[] argv) throws Exception {
+    Server server = buildSever(argv);
+    URI webResourceBase = findWebResourceBase(server.getClass()
+        .getClassLoader());
+    WebAppContext context = new WebAppContext();
+    context.setBaseResource(Resource.newResource(webResourceBase));
+    context.setContextPath(ROOT_CONTEXT);
+    context.setParentLoaderPriority(true);
+    server.setHandler(context);
+    server.start();
+    logger
+        .debug("============================Server Dump=======================================");
+    logger.debug(server.dump());
+    logger
+        .debug("==============================================================================");
+    server.join();
+  }
+  
+  public Server buildSever(String argv[]) {
+    Server server = new Server();
+    ServerConnector connector = new ServerConnector(server);
     boolean portSpecified = argv.length > 0;
-    String port = portSpecified ? argv[0] : HTTP_PORT;
-    String protocol = HTTP_PROTOCOL;
-
-    String protcolProperty = PropertiesUtil.getProperty(LOGSEARCH_PROTOCOL_PROP);
-    if (HTTPS_PROTOCOL.equals(protcolProperty)) {
-      String keystoreLocation = System.getProperty(KEYSTORE_LOCATION_ARG);
-      String keystorePassword = System.getProperty(KEYSTORE_PASSWORD_ARG);
-      String keystoreType = System.getProperty(KEYSTORE_TYPE_ARG, DEFAULT_KEYSTORE_TYPE);
-
-      String trustoreLocation = System.getProperty(TRUSTSTORE_LOCATION_ARG);
-      String trustorePassword = System.getProperty(TRUSTSTORE_PASSWORD_ARG);
-      String truststoreType = System.getProperty(TRUSTSTORE_TYPE_ARG, DEFAULT_TRUSTSTORE_TYPE);
+    String protcolProperty = PropertiesUtil.getProperty(LOGSEARCH_PROTOCOL_PROP,HTTP_PROTOCOL);
+    if (StringUtils.isEmpty(protcolProperty)) {
+      protcolProperty = HTTP_PROTOCOL;
+    }
+    String port = null;
+    String keystoreLocation = System.getProperty(KEYSTORE_LOCATION_ARG);
+    String keystorePassword = System.getProperty(KEYSTORE_PASSWORD_ARG);
+    String keystoreType = System.getProperty(KEYSTORE_TYPE_ARG,DEFAULT_KEYSTORE_TYPE);
+    String trustStoreLocation = System.getProperty(TRUSTSTORE_LOCATION_ARG);
+    String trustStorePassword = System.getProperty(TRUSTSTORE_PASSWORD_ARG);
+    String trustStoreType = System.getProperty(TRUSTSTORE_TYPE_ARG,DEFAULT_TRUSTSTORE_TYPE);
+    if (HTTPS_PROTOCOL.equals(protcolProperty) 
+        && !StringUtils.isEmpty(keystoreLocation) && !StringUtils.isEmpty(keystorePassword))
{
+      logger.info("Building https server...........");
+      port = portSpecified ? argv[0] : HTTPS_PORT;
+      checkPort(Integer.parseInt(port));
+      HttpConfiguration https = new HttpConfiguration();
+      https.addCustomizer(new SecureRequestCustomizer());
+      SslContextFactory sslContextFactory = new SslContextFactory();
+      sslContextFactory.setKeyStorePath(keystoreLocation);
+      sslContextFactory.setKeyStorePassword(keystorePassword);
+      sslContextFactory.setKeyStoreType(keystoreType);
+      if (!StringUtils.isEmpty(trustStoreLocation) && !StringUtils.isEmpty(trustStorePassword))
{
+        sslContextFactory.setTrustStorePath(trustStoreLocation);
+        sslContextFactory.setTrustStorePassword(trustStorePassword);
+        sslContextFactory.setTrustStoreType(trustStoreType);
+      }
+      ServerConnector sslConnector = new ServerConnector(server,
+          new SslConnectionFactory(sslContextFactory, "http/1.1"),
+          new HttpConnectionFactory(https));
+      sslConnector.setPort(Integer.parseInt(port));
+      server.setConnectors(new Connector[] { sslConnector });
+    } else {
+      logger.info("Building http server...........");
+      port = portSpecified ? argv[0] : HTTP_PORT;
+      checkPort(Integer.parseInt(port));
+      connector.setPort(Integer.parseInt(port));
+      server.setConnectors(new Connector[] { connector });
+    }
+    URI logsearchURI = URI.create(String.format("%s://0.0.0.0:%s", protcolProperty,
+        port));
+    logger.info("Starting logsearch server URI=" + logsearchURI);
+    return server;
+  }
 
-      if (!StringUtils.isEmpty(keystoreLocation) && !StringUtils.isEmpty(keystorePassword))
{
-        builder.keyPassword(keystorePassword);
-        builder.keyStore(keystoreLocation, keystorePassword, keystoreType);
-        
-        if (!StringUtils.isEmpty(trustoreLocation) && !StringUtils.isEmpty(trustorePassword))
{
-          builder.trustStore(trustoreLocation, trustorePassword, truststoreType);
-        }
+  private URI findWebResourceBase(ClassLoader classLoader) {
+    URL fileCompleteUrl = Thread.currentThread().getContextClassLoader()
+        .getResource(WEB_RESOURCE_FOLDER);
+    if (fileCompleteUrl != null) {
+      try {
+        return fileCompleteUrl.toURI().normalize();
+      } catch (URISyntaxException e) {
+        logger.error("Web Resource Folder " + WEB_RESOURCE_FOLDER+ " not found in classpath",
e);
+        System.exit(1);
+      }
+    }else{
+      logger.error("Web Resource Folder " + WEB_RESOURCE_FOLDER+ " not found in classpath");
+      System.exit(1);
+    }
+    return null;
+  }
 
-        protocol = HTTPS_PROTOCOL;
-        if (!portSpecified) {
-          port = HTTPS_PORT;
+  private void checkPort(int port) {
+    ServerSocket serverSocket = null;
+    boolean portBusy = false;
+    try {
+      new ServerSocket(port);
+    } catch (IOException ex) {
+      portBusy = true;
+      logger.error(ex.getLocalizedMessage() + " PORT :" + port);
+    } finally {
+      if (serverSocket != null) {
+        try {
+          serverSocket.close();
+        } catch (Exception exception) {
+          // ignore
         }
-      } else{
-        logger.warn("starting logsearch in with http protocol as keystore location or password
was not present");
+      }
+      if (portBusy) {
+        System.exit(1);
       }
     }
-
-    URI logsearchURI = URI.create(String.format("%s://0.0.0.0:%s", protocol, port));
-    builder.addEndpoint(logsearchURI);
-
-    return logsearchURI;
   }
+
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/2c26dbab/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/authenticate/LogsearchAuthSuccessHandler.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/authenticate/LogsearchAuthSuccessHandler.java
b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/authenticate/LogsearchAuthSuccessHandler.java
index d400858..cf9d200 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/authenticate/LogsearchAuthSuccessHandler.java
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/authenticate/LogsearchAuthSuccessHandler.java
@@ -26,17 +26,16 @@ import javax.servlet.http.HttpServletResponse;
 
 import org.apache.log4j.Logger;
 import org.springframework.security.core.Authentication;
-import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler;
+import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
 
-public class LogsearchAuthSuccessHandler extends SavedRequestAwareAuthenticationSuccessHandler
{
+public class LogsearchAuthSuccessHandler implements AuthenticationSuccessHandler {
   private static final Logger logger = Logger.getLogger(LogsearchAuthSuccessHandler.class);
 
-  private String HOME_PAGE = "/index.html";
 
   @Override
-  public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response,
-                                      Authentication authentication) throws ServletException,
IOException {
-    logger.debug("Login successfully !!!!!! Redirecting to home page :" + HOME_PAGE);
-    response.sendRedirect(HOME_PAGE);
+  public void onAuthenticationSuccess(HttpServletRequest request,
+      HttpServletResponse response, Authentication authentication)
+      throws ServletException, IOException {
+    response.setStatus(HttpServletResponse.SC_OK);
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/2c26dbab/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/authenticate/LogsearchLogoutSuccessHandler.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/authenticate/LogsearchLogoutSuccessHandler.java
b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/authenticate/LogsearchLogoutSuccessHandler.java
index 9fe82ba..5da1c97 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/authenticate/LogsearchLogoutSuccessHandler.java
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/authenticate/LogsearchLogoutSuccessHandler.java
@@ -35,8 +35,7 @@ public class LogsearchLogoutSuccessHandler extends SimpleUrlLogoutSuccessHandler
     @Override
     public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response,
Authentication authentication)
       throws IOException, ServletException {
-  logger.debug("LogsearchLogoutSuccessHandler ::: onLogoutSuccess");
-//  super.onLogoutSuccess(request, response, authentication);
-  response.sendRedirect("/login.jsp");
-    }
+      logger.debug("LogsearchLogoutSuccessHandler ::: onLogoutSuccess");
+      response.sendRedirect("/login.html");
+  }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/2c26dbab/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchAuthenticationProvider.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchAuthenticationProvider.java
b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchAuthenticationProvider.java
index e17650a..8c69152 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchAuthenticationProvider.java
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchAuthenticationProvider.java
@@ -103,6 +103,8 @@ public class LogsearchAuthenticationProvider extends
             // Let's save the first one
             authException = ex;
           }
+        }catch(Exception e){
+          logger.error(e,e.getCause());
         }
       }
       auditRecord.put("result", "denied");

http://git-wip-us.apache.org/repos/asf/ambari/blob/2c26dbab/ambari-logsearch/ambari-logsearch-portal/src/main/resources/logsearch.properties
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/resources/logsearch.properties
b/ambari-logsearch/ambari-logsearch-portal/src/main/resources/logsearch.properties
index b194359..1c832d8 100755
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/resources/logsearch.properties
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/resources/logsearch.properties
@@ -51,11 +51,6 @@ logsearch.roles.allowed=AMBARI.ADMINISTRATOR
 
 #communication protocol i.e http or https etc.
 logsearch.protocol=
-logsearch.https.keystore=
-logsearch.https.trustore=
-logsearch.https.keystore.password=
-logsearch.https.trustore.password=
-logsearch.https.keystore.type=
 
 logsearch.solr.kerberos.enable=false
 logsearch.solr.jaas.file=/usr/lib/ambari-logsearch-portal/logsearch_solr_jaas.conf
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/2c26dbab/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/META-INF/security-applicationContext.xml
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/META-INF/security-applicationContext.xml
b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/META-INF/security-applicationContext.xml
index 2d64c66..a85ff8c 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/META-INF/security-applicationContext.xml
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/META-INF/security-applicationContext.xml
@@ -23,14 +23,17 @@ xsi:schemaLocation="http://www.springframework.org/schema/beans
 http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
 http://www.springframework.org/schema/security
 http://www.springframework.org/schema/security/spring-security-4.0.xsd">
-
-	<security:http pattern="/login.jsp" security="none" />
-	<security:http pattern="/**/*.css" security="none" />
-	<security:http pattern="/**/jquery.*.js" security="none" />
-	<security:http pattern="/**/*.css.map" security="none" />
-	<security:http pattern="/service/public/**" security="none" />
-	<security:http pattern="/images/**" security="none" />
-	
+  
+    <security:http pattern="/login.html" security="none" />
+    <security:http pattern="/styles/**" security="none" />
+    <security:http pattern="/fonts/**" security="none" />
+    <security:http pattern="/scripts/**" security="none" />
+    <security:http pattern="/libs/**" security="none" />
+    <security:http pattern="/images/**" security="none" />
+    <security:http pattern="/templates/**" security="none" />
+    <security:http pattern="/service/public/**" security="none" />
+    <security:http pattern="/favicon.ico" security="none" />
+  	
 	<security:http disable-url-rewriting="true" use-expressions="true" create-session="always"
entry-point-ref="authenticationProcessingFilterEntryPoint">
 		<csrf disabled="true"/> 
 		<security:session-management session-fixation-protection="newSession" />
@@ -48,9 +51,9 @@ http://www.springframework.org/schema/security/spring-security-4.0.xsd">
 		<beans:property name="authenticationSuccessHandler" ref="authSuccessHandler"/>
 		<beans:property name="authenticationFailureHandler"	ref="authFailureHandler"/>
 	</beans:bean>
-
+  
 	<beans:bean id="authenticationProcessingFilterEntryPoint" class="org.apache.ambari.logsearch.web.filters.LogsearchAuthenticationEntryPoint">
-		<beans:constructor-arg index="0" value="/login.jsp"/>
+		<beans:constructor-arg index="0" value="/login.html"/>
 		<beans:property name="forceHttps" value="false"/>
 	</beans:bean>
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/2c26dbab/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/WEB-INF/web.xml b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/WEB-INF/web.xml
index 2ba4481..dc8519a 100755
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/WEB-INF/web.xml
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/WEB-INF/web.xml
@@ -50,7 +50,7 @@
 		<servlet-name>REST service</servlet-name>
 		<servlet-class>com.sun.jersey.spi.spring.container.servlet.SpringServlet</servlet-class>
 		<init-param>
-			<param-name>com.sun.jersey.config.property.packages</param-name>
+			<param-name>jersey.config.server.provider.packages</param-name>
 			<param-value>org.apache.ambari.logsearch.rest</param-value>
 		</init-param>
 		<init-param>

http://git-wip-us.apache.org/repos/asf/ambari/blob/2c26dbab/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/login.html
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/login.html b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/login.html
new file mode 100644
index 0000000..ff546ef
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/login.html
@@ -0,0 +1,155 @@
+<!-- 
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<!DOCTYPE html>
+
+<html lang="en">
+	<head>
+		<meta charset="utf-8">
+		<title>Log Search</title>
+		<meta name="description" content="description">
+		<meta name="author" content="Evgeniya">
+		<meta name="keyword" content="keywords">
+		<meta name="viewport" content="width=device-width, initial-scale=1">
+		<link href="libs/bower/bootstrap/bootstrap.css" rel="stylesheet">
+		<link href="libs/other/font-awesome/css/font-awesome.min.css" rel="stylesheet">
+
+		<link href="styles/style_v2.css" rel="stylesheet">
+		<link href="styles/style.css" rel="stylesheet">
+		<script   src="libs/bower/jquery/js/jquery.min.js"></script>
+		<script type="text/javascript">
+			$(document).ready(function() {
+				var passDiv = $('#passCont');
+
+		        $.ajax({
+					url : "/service/public/getGeneralConfig",
+					type: "GET",
+					async: true,
+					dataType: 'json',
+						success:function(results,status) 
+						{
+							for(var i in results.vNameValues){
+								if ((results.vNameValues[i].name === "simpleAuth") && (results.vNameValues[i].value
=== "true")){
+									$("#password").val("");
+									passDiv.hide();
+								}	
+								if (passDiv.is(':hidden'))
+								   $("#password").prop('required',false);
+							}
+						},
+						error: function(errorThrown) 
+						{
+						    passDiv.show();
+						},
+			            complete : function(){
+			                $('[data-id="loader"]').hide();            
+			            }
+				});
+			});
+	</script>
+	</head>
+
+	<body>
+		<div class="container-fluid">
+				<header class="navbar">
+					<div class="container-fluid expanded-panel">
+						<div class="row top-panel-right">
+							<div id="logo" class="col-xs-12 col-sm-3">
+						        <div class="row">
+							          <div class="col-sm-2"><img title="Apache Ambari" alt="Apache Ambari"
src="images/logo-white.png" height="32px"></div>
+							          <div class="col-sm-10"><a href="javascript:void(0);">Log Search</a></div>
+						        </div>
+							</div>
+						</div>
+					</div>
+				</header>
+					<div class="box-wrapper">
+						<div class="box">
+						<div class="box-content logBox">
+						<form id="login_form" name ="login_form" role="form" action='/login'>
+							<div class="text-left">
+								<h2 class="page-header custHeader">Ambari Log Search</h2>
+							</div>
+							<div class="errorBox">
+								<a href="javascript:void(0)" class="close" title="close"><i class="fa fa-times"></i></a>
+								<div class="alert alert-danger">
+								  	<strong>Error!</strong> Invalid User credentials.<br> Please
try again.
+								</div>
+							</div>
+							<div class="form-group">
+								<label class="control-label custLabel">Username</label>
+								<input type="text" class="form-control custTxtInput" id="username" name="username"
required="true" />
+							</div>
+							<div class="form-group" id="passCont">
+								<label class="control-label custLabel">Password</label>
+								<input type="password" class="form-control custTxtInput" id="password" name="password"
required="true"/>
+							</div>
+							<div class="text-left">
+								<input name="submit" type="submit" class="btn btn-success custLogin" value="Sign
In"/>
+							</div>
+							<div>&nbsp;</div>
+							</form>
+						</div>
+						<div data-id="loader" class="loading"></div>
+					</div>
+					</div>			
+		</div>
+
+		<script type="text/javascript">
+
+		$(window).load(function() {
+		      $("#login_form").submit(function(e)
+				{
+				    var postData = {};
+				    var formURL = ($(this).attr("action")) ? $(this).attr("action") : "/login";
+				    postData = {"username" : $("#username").val() , "password" : $("#password").val()};
+				 
+					$.ajax({
+						url : formURL,
+						type: "POST",
+						data : postData,
+							success:function(results,status) 
+							{
+							    window.location = 'index.html'+window.location.search;
+							},
+							error: function(errorThrown) 
+							{
+							    showError(errorThrown);
+							}
+						});				    
+				 		return false;
+				});
+
+					$('.close').click(function(){
+						$('.errorBox').hide();
+					});
+
+				function showError(errorThrown){
+					var errorMsg = errorThrown.status;
+					
+				    switch(errorMsg){
+		                case 401: $('.errorBox').show(); 
+		                        break;
+		              
+		                default: $('.errorBox').hide();
+				    }
+				}
+		});
+
+		</script>
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/ambari/blob/2c26dbab/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/login.jsp
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/login.jsp b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/login.jsp
deleted file mode 100644
index ff546ef..0000000
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/login.jsp
+++ /dev/null
@@ -1,155 +0,0 @@
-<!-- 
-  Licensed to the Apache Software Foundation (ASF) under one or more
-  contributor license agreements.  See the NOTICE file distributed with
-  this work for additional information regarding copyright ownership.
-  The ASF licenses this file to You under the Apache License, Version 2.0
-  (the "License"); you may not use this file except in compliance with
-  the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
--->
-<!DOCTYPE html>
-
-<html lang="en">
-	<head>
-		<meta charset="utf-8">
-		<title>Log Search</title>
-		<meta name="description" content="description">
-		<meta name="author" content="Evgeniya">
-		<meta name="keyword" content="keywords">
-		<meta name="viewport" content="width=device-width, initial-scale=1">
-		<link href="libs/bower/bootstrap/bootstrap.css" rel="stylesheet">
-		<link href="libs/other/font-awesome/css/font-awesome.min.css" rel="stylesheet">
-
-		<link href="styles/style_v2.css" rel="stylesheet">
-		<link href="styles/style.css" rel="stylesheet">
-		<script   src="libs/bower/jquery/js/jquery.min.js"></script>
-		<script type="text/javascript">
-			$(document).ready(function() {
-				var passDiv = $('#passCont');
-
-		        $.ajax({
-					url : "/service/public/getGeneralConfig",
-					type: "GET",
-					async: true,
-					dataType: 'json',
-						success:function(results,status) 
-						{
-							for(var i in results.vNameValues){
-								if ((results.vNameValues[i].name === "simpleAuth") && (results.vNameValues[i].value
=== "true")){
-									$("#password").val("");
-									passDiv.hide();
-								}	
-								if (passDiv.is(':hidden'))
-								   $("#password").prop('required',false);
-							}
-						},
-						error: function(errorThrown) 
-						{
-						    passDiv.show();
-						},
-			            complete : function(){
-			                $('[data-id="loader"]').hide();            
-			            }
-				});
-			});
-	</script>
-	</head>
-
-	<body>
-		<div class="container-fluid">
-				<header class="navbar">
-					<div class="container-fluid expanded-panel">
-						<div class="row top-panel-right">
-							<div id="logo" class="col-xs-12 col-sm-3">
-						        <div class="row">
-							          <div class="col-sm-2"><img title="Apache Ambari" alt="Apache Ambari"
src="images/logo-white.png" height="32px"></div>
-							          <div class="col-sm-10"><a href="javascript:void(0);">Log Search</a></div>
-						        </div>
-							</div>
-						</div>
-					</div>
-				</header>
-					<div class="box-wrapper">
-						<div class="box">
-						<div class="box-content logBox">
-						<form id="login_form" name ="login_form" role="form" action='/login'>
-							<div class="text-left">
-								<h2 class="page-header custHeader">Ambari Log Search</h2>
-							</div>
-							<div class="errorBox">
-								<a href="javascript:void(0)" class="close" title="close"><i class="fa fa-times"></i></a>
-								<div class="alert alert-danger">
-								  	<strong>Error!</strong> Invalid User credentials.<br> Please
try again.
-								</div>
-							</div>
-							<div class="form-group">
-								<label class="control-label custLabel">Username</label>
-								<input type="text" class="form-control custTxtInput" id="username" name="username"
required="true" />
-							</div>
-							<div class="form-group" id="passCont">
-								<label class="control-label custLabel">Password</label>
-								<input type="password" class="form-control custTxtInput" id="password" name="password"
required="true"/>
-							</div>
-							<div class="text-left">
-								<input name="submit" type="submit" class="btn btn-success custLogin" value="Sign
In"/>
-							</div>
-							<div>&nbsp;</div>
-							</form>
-						</div>
-						<div data-id="loader" class="loading"></div>
-					</div>
-					</div>			
-		</div>
-
-		<script type="text/javascript">
-
-		$(window).load(function() {
-		      $("#login_form").submit(function(e)
-				{
-				    var postData = {};
-				    var formURL = ($(this).attr("action")) ? $(this).attr("action") : "/login";
-				    postData = {"username" : $("#username").val() , "password" : $("#password").val()};
-				 
-					$.ajax({
-						url : formURL,
-						type: "POST",
-						data : postData,
-							success:function(results,status) 
-							{
-							    window.location = 'index.html'+window.location.search;
-							},
-							error: function(errorThrown) 
-							{
-							    showError(errorThrown);
-							}
-						});				    
-				 		return false;
-				});
-
-					$('.close').click(function(){
-						$('.errorBox').hide();
-					});
-
-				function showError(errorThrown){
-					var errorMsg = errorThrown.status;
-					
-				    switch(errorMsg){
-		                case 401: $('.errorBox').show(); 
-		                        break;
-		              
-		                default: $('.errorBox').hide();
-				    }
-				}
-		});
-
-		</script>
-
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/ambari/blob/2c26dbab/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/utils/Utils.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/utils/Utils.js
b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/utils/Utils.js
index 4e7b348..919a0c7 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/utils/Utils.js
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/utils/Utils.js
@@ -433,13 +433,13 @@ define(['require',
 		        }
 		    } catch (e) {}
 		} else if (error.status == 401) {
-		    window.location = 'login.jsp' + window.location.search;
+		    window.location = 'login.html' + window.location.search;
 		    // App.rContent.show(new vError({
 		    // 	status : error.status
 		    // }));
 
 		} else if (error.status == 419) {
-		    window.location = 'login.jsp' + window.location.search;
+		    window.location = 'login.html' + window.location.search;
 
 		} else if (error.status == "0") {
 		    var diffTime = (new Date().getTime() - prevNetworkErrorTime);

http://git-wip-us.apache.org/repos/asf/ambari/blob/2c26dbab/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/common/ProfileBar.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/common/ProfileBar.js
b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/common/ProfileBar.js
index c42bc84..f46d94b 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/common/ProfileBar.js
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/common/ProfileBar.js
@@ -60,7 +60,7 @@ define(['require',
 					"cache-control" : "no-cache"
 				},
 				success : function() {
-					window.location.replace('login.jsp');
+					window.location.replace('login.html');
 				},
 				error : function(jqXHR, textStatus, err ) {
 				}

http://git-wip-us.apache.org/repos/asf/ambari/blob/2c26dbab/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/params.py
b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/params.py
index 9990a6c..0d6f4ec 100644
--- a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/params.py
@@ -364,4 +364,4 @@ logsearch_server_hosts = config['clusterHostInfo']['logsearch_server_hosts']
 logsearch_server_host = ""
 if logsearch_server_hosts is not None and len(logsearch_server_hosts) > 0:
   logsearch_server_host = logsearch_server_hosts[0]
-smoke_logsearch_cmd = format('curl -k -s -o /dev/null -w "%{{http_code}}" {logsearch_ui_protocol}://{logsearch_server_host}:{logsearch_ui_port}/login.jsp
| grep 200')
+smoke_logsearch_cmd = format('curl -k -s -o /dev/null -w "%{{http_code}}" {logsearch_ui_protocol}://{logsearch_server_host}:{logsearch_ui_port}/login.html
| grep 200')


Mime
View raw message