ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aonis...@apache.org
Subject [1/2] git commit: AMBARI-6242. Error during ambari-server upgradestack command (aonishuk)
Date Mon, 23 Jun 2014 19:41:22 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-1.6.1 f7a6b94a7 -> 3027d3484
  refs/heads/trunk ac7f1da22 -> 82f154964


AMBARI-6242. Error during ambari-server upgradestack command (aonishuk)


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

Branch: refs/heads/branch-1.6.1
Commit: 3027d3484e5ed35f8ddee2cfa3a70025fcc6c665
Parents: f7a6b94
Author: Andrew Onishuk <aonishuk@hortonworks.com>
Authored: Mon Jun 23 22:40:46 2014 +0300
Committer: Andrew Onishuk <aonishuk@hortonworks.com>
Committed: Mon Jun 23 22:40:46 2014 +0300

----------------------------------------------------------------------
 .../server/upgrade/StackUpgradeHelper.java      |  84 ++----
 ambari-server/src/main/python/ambari-server.py  |  20 +-
 .../server/upgrade/StackUpgradeHelperTest.java  |  69 -----
 .../src/test/python/TestAmbariServer.py         |  42 +--
 ambari-server/velocity.log                      | 256 +++++++++++++++++++
 5 files changed, 300 insertions(+), 171 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/3027d348/ambari-server/src/main/java/org/apache/ambari/server/upgrade/StackUpgradeHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/StackUpgradeHelper.java
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/StackUpgradeHelper.java
index 6420ca7..77ec069 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/StackUpgradeHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/StackUpgradeHelper.java
@@ -24,6 +24,8 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
+import javax.ws.rs.core.UriInfo;
+
 import org.apache.ambari.server.controller.ControllerModule;
 import org.apache.ambari.server.orm.DBAccessor;
 import org.apache.ambari.server.orm.dao.MetainfoDAO;
@@ -37,14 +39,10 @@ import com.google.inject.Inject;
 import com.google.inject.Injector;
 import com.google.inject.persist.PersistService;
 import com.google.inject.persist.Transactional;
-import java.io.IOException;
-import java.net.HttpURLConnection;
-import java.net.URL;
-import org.eclipse.jetty.http.HttpStatus;
 
 public class StackUpgradeHelper {
-
-  private static final Logger LOG = LoggerFactory.getLogger(StackUpgradeHelper.class);
+  private static final Logger LOG = LoggerFactory.getLogger
+    (StackUpgradeHelper.class);
 
   private static final String STACK_ID_UPDATE_ACTION = "updateStackId";
   private static final String METAINFO_UPDATE_ACTION = "updateMetaInfo";
@@ -69,7 +67,6 @@ public class StackUpgradeHelper {
 
   /**
    * Add key value to the metainfo table.
-   *
    * @param data
    * @throws SQLException
    */
@@ -94,7 +91,6 @@ public class StackUpgradeHelper {
 
   /**
    * Change the stack id in the Ambari DB.
-   *
    * @param stackInfo
    * @throws SQLException
    */
@@ -102,75 +98,44 @@ public class StackUpgradeHelper {
     if (stackInfo == null || stackInfo.isEmpty()) {
       throw new IllegalArgumentException("Empty stack id. " + stackInfo);
     }
-
+    
     String repoUrl = stackInfo.remove("repo_url");
     String repoUrlOs = stackInfo.remove("repo_url_os");
-
+    
     Iterator<Map.Entry<String, String>> stackIdEntry = stackInfo.entrySet().iterator();
     Map.Entry<String, String> stackEntry = stackIdEntry.next();
 
     String stackName = stackEntry.getKey();
     String stackVersion = stackEntry.getValue();
 
-    LOG.info("Updating stack id, stackName = " + stackName + ", "
-            + "stackVersion = " + stackVersion);
-    
-    if (null != repoUrl && !repoUrl.isEmpty() && repoUrl.startsWith("http"))
{
-      if (!repoUrl.trim().endsWith("/")) repoUrl = repoUrl + "/";
-      if (checkURL(repoUrl + "repodata/repomd.xml", 2000)) {
-        stackUpgradeUtil.updateLocalRepo(stackName, stackVersion, repoUrl, repoUrlOs);
-      }
-    } else {
-      throw (new Exception("Base repo URL not found"));
-    }
+    LOG.info("Updating stack id, stackName = " + stackName + ", " +
+      "stackVersion = "+ stackVersion);
 
     stackUpgradeUtil.updateStackDetails(stackName, stackVersion);
-
-    dbAccessor.updateTable("hostcomponentstate", "current_state",
-            "INSTALLED", "where current_state = 'UPGRADING'");
-  }
-
-  public boolean checkURL(String url, int timeout) throws Exception {
-    int responseCode = 0;
-    try {
-      HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection();
-      connection.setConnectTimeout(timeout);
-      connection.setReadTimeout(timeout);
-      connection.setRequestMethod("HEAD");
-      responseCode = connection.getResponseCode();
-      if (responseCode != HttpStatus.OK_200) {
-        throw (new Exception("Invalid repository base URL" +
-                ", Responce: "+ HttpStatus.getMessage(responseCode) +
-                ", during check URL: " + url));        
-      } else {
-        return true;
-      } 
-    } catch (IOException exception) {
-      throw (new Exception(exception.getClass().getSimpleName() +
-              ", Responce: "+ HttpStatus.getMessage(responseCode) +
-              ", during check URL: " + url));
+    
+    if (null != repoUrl) {
+      stackUpgradeUtil.updateLocalRepo(stackName, stackVersion, repoUrl, repoUrlOs);  
     }
+
+    dbAccessor.updateTable("hostcomponentstate", "current_state", "INSTALLED", "where current_state
= 'UPGRADING'");
   }
 
   private List<String> getValidActions() {
-    return new ArrayList<String>() {
-      {
-        add(STACK_ID_UPDATE_ACTION);
-        add(METAINFO_UPDATE_ACTION);
-      }
-    };
+    return new ArrayList<String>() {{
+      add(STACK_ID_UPDATE_ACTION);
+      add(METAINFO_UPDATE_ACTION);
+    }};
   }
 
   /**
    * Support changes need to support upgrade of Stack
-   *
    * @param args Simple key value json map
    */
   public static void main(String[] args) {
     try {
       if (args.length < 2) {
-        throw new InputMismatchException("Need to provide action, "
-                + "stack name and stack version.");
+        throw new InputMismatchException("Need to provide action, " +
+          "stack name and stack version.");
       }
 
       String action = args[0];
@@ -181,16 +146,17 @@ public class StackUpgradeHelper {
       Gson gson = injector.getInstance(Gson.class);
 
       if (!stackUpgradeHelper.getValidActions().contains(action)) {
-        throw new IllegalArgumentException("Unsupported action. Allowed "
-                + "actions: " + stackUpgradeHelper.getValidActions());
+        throw new IllegalArgumentException("Unsupported action. Allowed " +
+          "actions: " + stackUpgradeHelper.getValidActions());
       }
 
+      
       stackUpgradeHelper.startPersistenceService();
       Map values = gson.fromJson(valueMap, Map.class);
 
       if (action.equals(STACK_ID_UPDATE_ACTION)) {
         stackUpgradeHelper.updateStackVersion(values);
-
+        
       } else if (action.equals(METAINFO_UPDATE_ACTION)) {
 
         stackUpgradeHelper.updateMetaInfo(values);
@@ -199,8 +165,8 @@ public class StackUpgradeHelper {
       stackUpgradeHelper.stopPersistenceService();
 
     } catch (Throwable t) {
-      System.err.println("Caught exception on upgrade. Exiting..." + t.getMessage());
-      System.exit(2);
+      LOG.error("Caught exception on upgrade. Exiting...", t);
+      System.exit(1);
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/3027d348/ambari-server/src/main/python/ambari-server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/python/ambari-server.py b/ambari-server/src/main/python/ambari-server.py
index d011ce7..20ccba2 100755
--- a/ambari-server/src/main/python/ambari-server.py
+++ b/ambari-server/src/main/python/ambari-server.py
@@ -2639,10 +2639,13 @@ def upgrade_stack(args, stack_id, repo_url=None, repo_url_os=None):
   check_database_name_property()
 
   stack_name, stack_version = stack_id.split(STACK_NAME_VER_SEP)
-  retcode, stdout, stderr = run_stack_upgrade(stack_name, stack_version, repo_url, repo_url_os)
+  retcode = run_stack_upgrade(stack_name, stack_version, repo_url, repo_url_os)
 
   if not retcode == 0:
-    raise FatalException(retcode, 'Error executing stack upgrade. ' + stderr)
+    raise FatalException(retcode, 'Stack upgrade failed.')
+  
+  return retcode
+
 
 
 def load_stack_values(version, filename):
@@ -2754,9 +2757,10 @@ def run_schema_upgrade():
 def run_stack_upgrade(stackName, stackVersion, repo_url, repo_url_os):
   jdk_path = find_jdk()
   if jdk_path is None:
-    return 1, "", "No JDK found, please run the \"setup\" \
-                    command to install a JDK automatically or install any \
-                    JDK manually to " + JDK_INSTALL_DIR
+    print_error_msg("No JDK found, please run the \"setup\" "
+                    "command to install a JDK automatically or install any "
+                    "JDK manually to " + JDK_INSTALL_DIR)
+    return 1
   stackId = {}
   stackId[stackName] = stackVersion
   if repo_url is not None:
@@ -2767,7 +2771,11 @@ def run_stack_upgrade(stackName, stackVersion, repo_url, repo_url_os):
   command = STACK_UPGRADE_HELPER_CMD.format(jdk_path, get_conf_dir(), get_ambari_classpath(),
                                              "updateStackId",
                                             "'" + json.dumps(stackId) + "'")
-  return run_os_command(command)
+  (retcode, stdout, stderr) = run_os_command(command)
+  print_info_msg("Return code from stack upgrade command, retcode = " + str(retcode))
+  if retcode > 0:
+    print_error_msg("Error executing stack upgrade, please check the server logs.")
+  return retcode
 
 
 def run_metainfo_upgrade(keyValueMap=None):

http://git-wip-us.apache.org/repos/asf/ambari/blob/3027d348/ambari-server/src/test/java/org/apache/ambari/server/upgrade/StackUpgradeHelperTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/StackUpgradeHelperTest.java
b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/StackUpgradeHelperTest.java
deleted file mode 100644
index 0bb303e..0000000
--- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/StackUpgradeHelperTest.java
+++ /dev/null
@@ -1,69 +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.
- */
-package org.apache.ambari.server.upgrade;
-
-import java.net.HttpURLConnection;
-import java.net.URL;
-import java.net.UnknownHostException;
-import java.util.HashMap;
-import java.util.Map;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.powermock.api.easymock.PowerMock;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-import static org.easymock.EasyMock.expect;
-import static org.junit.Assert.*;
-import static org.powermock.api.easymock.PowerMock.replayAll;
-
-/**
- *
- * @author root
- */
-@RunWith(PowerMockRunner.class)
-@PrepareForTest({StackUpgradeHelper.class})
-public class StackUpgradeHelperTest {
-  
-  public StackUpgradeHelperTest() {
-  }
-
-  @Test
-  public void testUpdateStackVersion()  throws Exception {
-    System.out.println("updateStackVersion");
-    String repoUrl="http://foo.bar";
-    String fullUrl=repoUrl+"/repodata/repomd.xml";
-    URL url = PowerMock.createMockAndExpectNew(URL.class, fullUrl);
-    HttpURLConnection urlConnectionMock = PowerMock.createNiceMock(HttpURLConnection.class);
-    expect(url.openConnection()).andReturn(urlConnectionMock);
-    expect(urlConnectionMock.getResponseCode()).andThrow(new UnknownHostException(fullUrl));
-    PowerMock.replayAll();
-    Map<String, String> stackInfo = new HashMap<String, String>();
-    stackInfo.put("repo_url", repoUrl);
-    stackInfo.put("repo_url_os", "centos6");
-    stackInfo.put("HDP", "1.3.0");
-    StackUpgradeHelper instance = new StackUpgradeHelper();
-    try {
-      instance.updateStackVersion(stackInfo);
-    } catch (Exception ex) {
-      assertEquals("UnknownHostException, Responce: 0, "
-       + "during check URL: " + fullUrl, ex.getMessage());
-    }
-  }
-
-  
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/3027d348/ambari-server/src/test/python/TestAmbariServer.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/TestAmbariServer.py b/ambari-server/src/test/python/TestAmbariServer.py
index dbbefab..4d4816d 100644
--- a/ambari-server/src/test/python/TestAmbariServer.py
+++ b/ambari-server/src/test/python/TestAmbariServer.py
@@ -1091,7 +1091,7 @@ class TestAmbariServer(TestCase):
       # Expected
       self.assertTrue("JCE Policy path" in fe.reason)
       pass
-    os_path_exists_mock.reset_mock()
+    os_path_exists_mock.reset()
 
     # Case when JCE is a directory
     os_path_exists_mock.return_value = True
@@ -1103,7 +1103,7 @@ class TestAmbariServer(TestCase):
       # Expected
       self.assertTrue("JCE Policy path is a directory" in fe.reason)
       pass
-    os_path_isdir_mock.reset_mock()
+    os_path_isdir_mock.reset()
 
     os_path_isdir_mock.return_value = False
     os_path_join_mock.return_value = \
@@ -2847,12 +2847,11 @@ MIIFHjCCAwYCCQDpHKOBI+Lt0zANBgkqhkiG9w0BAQUFADBRMQswCQYDVQQGEwJV
     self.assertTrue(removeMock.called)
 
 
-  @patch.object(ambari_server, "run_in_shell")
   @patch.object(ambari_server, "is_root")
   @patch.object(ambari_server, "check_database_name_property")
   @patch.object(ambari_server, "run_stack_upgrade")
   def test_upgrade_stack(self, run_stack_upgrade_mock,
-                         check_database_name_property_mock, is_root_mock, run_in_shell_mock):
+                         check_database_name_property_mock, is_root_mock):
     args = MagicMock()
     args.persistence_type = "local"
 
@@ -2867,43 +2866,12 @@ MIIFHjCCAwYCCQDpHKOBI+Lt0zANBgkqhkiG9w0BAQUFADBRMQswCQYDVQQGEwJV
       pass
 
     # Testing calls under root
-    run_in_shell_mock.return_value = 0, "existed!", ""
     is_root_mock.return_value = True
-    run_stack_upgrade_mock.return_value = 0, "", ""
+    run_stack_upgrade_mock.return_value = 0
     ambari_server.upgrade_stack(args, 'HDP-2.0')
 
     self.assertTrue(run_stack_upgrade_mock.called)
     run_stack_upgrade_mock.assert_called_with("HDP", "2.0", None, None)
-    run_stack_upgrade_mock.reset_mock()
-
-    # Testing calls if desired stack repo not existed
-    run_in_shell_mock.return_value = 1, "", ""
-    is_root_mock.return_value = True
-
-    run_stack_upgrade_mock.reset_mock()
-
-    # Testing calls if desired stack repo not existed but base URL is not empty
-    run_in_shell_mock.return_value = 0, "existed!", ""
-    is_root_mock.return_value = True
-    run_stack_upgrade_mock.return_value = 0, "", ""
-    ambari_server.upgrade_stack(args, 'HDP-2.0', "URL")
-
-    self.assertTrue(run_stack_upgrade_mock.called)
-    run_stack_upgrade_mock.assert_called_with("HDP", "2.0", "URL", None)
-    run_stack_upgrade_mock.reset_mock()
-
-    # Testing calls if upgrade stack return non zero retcode
-    run_in_shell_mock.return_value = 0, "", ""
-    is_root_mock.return_value = True
-    run_stack_upgrade_mock.return_value = 2, "", ""
-    try:
-      ambari_server.upgrade_stack(args, 'HDP-2.0', "URL")
-      self.fail("Should throw exception")
-    except FatalException as fe:
-      # Expected
-      self.assertTrue("Error executing stack upgrade." in fe.reason)
-      pass
-
 
   @patch.object(ambari_server, 'get_conf_dir')
   @patch.object(ambari_server, 'get_ambari_classpath')
@@ -3834,7 +3802,7 @@ MIIFHjCCAwYCCQDpHKOBI+Lt0zANBgkqhkiG9w0BAQUFADBRMQswCQYDVQQGEwJV
     copy_files_mock.assert_called_with(drivers_list, resources_dir)
 
     # Non-Silent option, no drivers at first ask, present drivers after that
-    find_jdbc_driver_mock.reset_mock()
+    find_jdbc_driver_mock.reset()
     find_jdbc_driver_mock.side_effect = [-1, -1]
 
     rcode = ambari_server.check_jdbc_drivers(args)

http://git-wip-us.apache.org/repos/asf/ambari/blob/3027d348/ambari-server/velocity.log
----------------------------------------------------------------------
diff --git a/ambari-server/velocity.log b/ambari-server/velocity.log
new file mode 100644
index 0000000..b8afed1
--- /dev/null
+++ b/ambari-server/velocity.log
@@ -0,0 +1,256 @@
+2014-06-23 17:02:52,078 - Log4JLogChute initialized using file 'velocity.log'
+2014-06-23 17:02:52,078 - Initializing Velocity, Calling init()...
+2014-06-23 17:02:52,078 - Starting Apache Velocity v1.7 (compiled: 2010-11-19 12:14:37)
+2014-06-23 17:02:52,078 - Default Properties File: org/apache/velocity/runtime/defaults/velocity.properties
+2014-06-23 17:02:52,078 - Trying to use logger class org.apache.velocity.runtime.log.AvalonLogChute
+2014-06-23 17:02:52,078 - Target log system for org.apache.velocity.runtime.log.AvalonLogChute
is not available (java.lang.NoClassDefFoundError: org/apache/log/format/Formatter).  Falling
back to next log system...
+2014-06-23 17:02:52,079 - Trying to use logger class org.apache.velocity.runtime.log.Log4JLogChute
+2014-06-23 17:02:52,079 - Using logger class org.apache.velocity.runtime.log.Log4JLogChute
+2014-06-23 17:02:52,083 - ResourceLoader instantiated: org.apache.velocity.runtime.resource.loader.FileResourceLoader
+2014-06-23 17:02:52,084 - Do unicode file recognition:  false
+2014-06-23 17:02:52,084 - FileResourceLoader : adding path '.'
+2014-06-23 17:02:52,094 - ResourceCache: initialized (class org.apache.velocity.runtime.resource.ResourceCacheImpl)
with class java.util.Collections$SynchronizedMap cache map.
+2014-06-23 17:02:52,095 - Loaded System Directive: org.apache.velocity.runtime.directive.Stop
+2014-06-23 17:02:52,096 - Loaded System Directive: org.apache.velocity.runtime.directive.Define
+2014-06-23 17:02:52,097 - Loaded System Directive: org.apache.velocity.runtime.directive.Break
+2014-06-23 17:02:52,097 - Loaded System Directive: org.apache.velocity.runtime.directive.Evaluate
+2014-06-23 17:02:52,098 - Loaded System Directive: org.apache.velocity.runtime.directive.Literal
+2014-06-23 17:02:52,099 - Loaded System Directive: org.apache.velocity.runtime.directive.Macro
+2014-06-23 17:02:52,106 - Loaded System Directive: org.apache.velocity.runtime.directive.Parse
+2014-06-23 17:02:52,108 - Loaded System Directive: org.apache.velocity.runtime.directive.Include
+2014-06-23 17:02:52,108 - Loaded System Directive: org.apache.velocity.runtime.directive.Foreach
+2014-06-23 17:02:52,133 - Created '20' parsers.
+2014-06-23 17:02:52,139 - Velocimacro : "velocimacro.library" is not set.  Trying default
library: VM_global_library.vm
+2014-06-23 17:02:52,139 - Velocimacro : Default library not found.
+2014-06-23 17:02:52,139 - Velocimacro : allowInline = true : VMs can be defined inline in
templates
+2014-06-23 17:02:52,139 - Velocimacro : allowInlineToOverride = false : VMs defined inline
may NOT replace previous VM definitions
+2014-06-23 17:02:52,139 - Velocimacro : allowInlineLocal = false : VMs defined inline will
be global in scope if allowed.
+2014-06-23 17:02:52,139 - Velocimacro : autoload off : VM system will not automatically reload
global library macros
+2014-06-23 17:02:52,250 - Parser Exception: /path/to/${incorrect_parameter
+org.apache.velocity.runtime.parser.ParseException: Encountered "<EOF>" at line 1, column
30.
+Was expecting one of:
+    "[" ...
+    "}" ...
+    
+	at org.apache.velocity.runtime.parser.Parser.generateParseException(Parser.java:3679)
+	at org.apache.velocity.runtime.parser.Parser.jj_consume_token(Parser.java:3558)
+	at org.apache.velocity.runtime.parser.Parser.Reference(Parser.java:1521)
+	at org.apache.velocity.runtime.parser.Parser.Statement(Parser.java:357)
+	at org.apache.velocity.runtime.parser.Parser.process(Parser.java:317)
+	at org.apache.velocity.runtime.parser.Parser.parse(Parser.java:117)
+	at org.apache.velocity.runtime.RuntimeInstance.parse(RuntimeInstance.java:1226)
+	at org.apache.velocity.runtime.RuntimeInstance.parse(RuntimeInstance.java:1181)
+	at org.apache.velocity.runtime.RuntimeInstance.evaluate(RuntimeInstance.java:1297)
+	at org.apache.velocity.runtime.RuntimeInstance.evaluate(RuntimeInstance.java:1265)
+	at org.apache.velocity.app.Velocity.evaluate(Velocity.java:180)
+	at org.apache.ambari.server.view.ViewContextImpl.parameterize(ViewContextImpl.java:284)
+	at org.apache.ambari.server.view.ViewContextImpl.getProperties(ViewContextImpl.java:156)
+	at org.apache.ambari.server.view.ViewContextImplTest.testGetPropertiesWithParameters(ViewContextImplTest.java:119)
+	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
+	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
+	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
+	at java.lang.reflect.Method.invoke(Method.java:606)
+	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
+	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
+	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
+	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
+	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
+	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
+	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
+	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
+	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
+	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
+	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
+	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
+	at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
+	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:236)
+	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:134)
+	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:113)
+	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
+	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
+	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
+	at java.lang.reflect.Method.invoke(Method.java:606)
+	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
+	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
+	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
+	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:103)
+	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:74)
+2014-06-23 17:02:52,255 - Null reference [template '/path/to/${unspecified_parameter}', line
1, column 10] : ${unspecified_parameter} cannot be resolved.
+2014-06-23 17:02:52,256 - Parser Exception: /path/to/${incorrect_parameter
+org.apache.velocity.runtime.parser.ParseException: Encountered "<EOF>" at line 1, column
30.
+Was expecting one of:
+    "[" ...
+    "}" ...
+    
+	at org.apache.velocity.runtime.parser.Parser.generateParseException(Parser.java:3679)
+	at org.apache.velocity.runtime.parser.Parser.jj_consume_token(Parser.java:3558)
+	at org.apache.velocity.runtime.parser.Parser.Reference(Parser.java:1521)
+	at org.apache.velocity.runtime.parser.Parser.Statement(Parser.java:357)
+	at org.apache.velocity.runtime.parser.Parser.process(Parser.java:317)
+	at org.apache.velocity.runtime.parser.Parser.parse(Parser.java:117)
+	at org.apache.velocity.runtime.RuntimeInstance.parse(RuntimeInstance.java:1226)
+	at org.apache.velocity.runtime.RuntimeInstance.parse(RuntimeInstance.java:1181)
+	at org.apache.velocity.runtime.RuntimeInstance.evaluate(RuntimeInstance.java:1297)
+	at org.apache.velocity.runtime.RuntimeInstance.evaluate(RuntimeInstance.java:1265)
+	at org.apache.velocity.app.Velocity.evaluate(Velocity.java:180)
+	at org.apache.ambari.server.view.ViewContextImpl.parameterize(ViewContextImpl.java:284)
+	at org.apache.ambari.server.view.ViewContextImpl.getProperties(ViewContextImpl.java:156)
+	at org.apache.ambari.server.view.ViewContextImplTest.testGetPropertiesWithParameters(ViewContextImplTest.java:129)
+	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
+	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
+	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
+	at java.lang.reflect.Method.invoke(Method.java:606)
+	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
+	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
+	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
+	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
+	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
+	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
+	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
+	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
+	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
+	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
+	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
+	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
+	at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
+	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:236)
+	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:134)
+	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:113)
+	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
+	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
+	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
+	at java.lang.reflect.Method.invoke(Method.java:606)
+	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
+	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
+	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
+	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:103)
+	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:74)
+2014-06-23 17:02:52,257 - Null reference [template '/path/to/${unspecified_parameter}', line
1, column 10] : ${unspecified_parameter} cannot be resolved.
+2014-06-23 22:24:10,447 - Log4JLogChute initialized using file 'velocity.log'
+2014-06-23 22:24:10,447 - Initializing Velocity, Calling init()...
+2014-06-23 22:24:10,447 - Starting Apache Velocity v1.7 (compiled: 2010-11-19 12:14:37)
+2014-06-23 22:24:10,447 - Default Properties File: org/apache/velocity/runtime/defaults/velocity.properties
+2014-06-23 22:24:10,447 - Trying to use logger class org.apache.velocity.runtime.log.AvalonLogChute
+2014-06-23 22:24:10,447 - Target log system for org.apache.velocity.runtime.log.AvalonLogChute
is not available (java.lang.NoClassDefFoundError: org/apache/log/format/Formatter).  Falling
back to next log system...
+2014-06-23 22:24:10,447 - Trying to use logger class org.apache.velocity.runtime.log.Log4JLogChute
+2014-06-23 22:24:10,447 - Using logger class org.apache.velocity.runtime.log.Log4JLogChute
+2014-06-23 22:24:10,451 - ResourceLoader instantiated: org.apache.velocity.runtime.resource.loader.FileResourceLoader
+2014-06-23 22:24:10,453 - Do unicode file recognition:  false
+2014-06-23 22:24:10,453 - FileResourceLoader : adding path '.'
+2014-06-23 22:24:10,464 - ResourceCache: initialized (class org.apache.velocity.runtime.resource.ResourceCacheImpl)
with class java.util.Collections$SynchronizedMap cache map.
+2014-06-23 22:24:10,466 - Loaded System Directive: org.apache.velocity.runtime.directive.Stop
+2014-06-23 22:24:10,467 - Loaded System Directive: org.apache.velocity.runtime.directive.Define
+2014-06-23 22:24:10,467 - Loaded System Directive: org.apache.velocity.runtime.directive.Break
+2014-06-23 22:24:10,468 - Loaded System Directive: org.apache.velocity.runtime.directive.Evaluate
+2014-06-23 22:24:10,468 - Loaded System Directive: org.apache.velocity.runtime.directive.Literal
+2014-06-23 22:24:10,470 - Loaded System Directive: org.apache.velocity.runtime.directive.Macro
+2014-06-23 22:24:10,477 - Loaded System Directive: org.apache.velocity.runtime.directive.Parse
+2014-06-23 22:24:10,478 - Loaded System Directive: org.apache.velocity.runtime.directive.Include
+2014-06-23 22:24:10,479 - Loaded System Directive: org.apache.velocity.runtime.directive.Foreach
+2014-06-23 22:24:10,503 - Created '20' parsers.
+2014-06-23 22:24:10,508 - Velocimacro : "velocimacro.library" is not set.  Trying default
library: VM_global_library.vm
+2014-06-23 22:24:10,508 - Velocimacro : Default library not found.
+2014-06-23 22:24:10,508 - Velocimacro : allowInline = true : VMs can be defined inline in
templates
+2014-06-23 22:24:10,508 - Velocimacro : allowInlineToOverride = false : VMs defined inline
may NOT replace previous VM definitions
+2014-06-23 22:24:10,508 - Velocimacro : allowInlineLocal = false : VMs defined inline will
be global in scope if allowed.
+2014-06-23 22:24:10,509 - Velocimacro : autoload off : VM system will not automatically reload
global library macros
+2014-06-23 22:24:10,625 - Parser Exception: /path/to/${incorrect_parameter
+org.apache.velocity.runtime.parser.ParseException: Encountered "<EOF>" at line 1, column
30.
+Was expecting one of:
+    "[" ...
+    "}" ...
+    
+	at org.apache.velocity.runtime.parser.Parser.generateParseException(Parser.java:3679)
+	at org.apache.velocity.runtime.parser.Parser.jj_consume_token(Parser.java:3558)
+	at org.apache.velocity.runtime.parser.Parser.Reference(Parser.java:1521)
+	at org.apache.velocity.runtime.parser.Parser.Statement(Parser.java:357)
+	at org.apache.velocity.runtime.parser.Parser.process(Parser.java:317)
+	at org.apache.velocity.runtime.parser.Parser.parse(Parser.java:117)
+	at org.apache.velocity.runtime.RuntimeInstance.parse(RuntimeInstance.java:1226)
+	at org.apache.velocity.runtime.RuntimeInstance.parse(RuntimeInstance.java:1181)
+	at org.apache.velocity.runtime.RuntimeInstance.evaluate(RuntimeInstance.java:1297)
+	at org.apache.velocity.runtime.RuntimeInstance.evaluate(RuntimeInstance.java:1265)
+	at org.apache.velocity.app.Velocity.evaluate(Velocity.java:180)
+	at org.apache.ambari.server.view.ViewContextImpl.parameterize(ViewContextImpl.java:284)
+	at org.apache.ambari.server.view.ViewContextImpl.getProperties(ViewContextImpl.java:156)
+	at org.apache.ambari.server.view.ViewContextImplTest.testGetPropertiesWithParameters(ViewContextImplTest.java:119)
+	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
+	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
+	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
+	at java.lang.reflect.Method.invoke(Method.java:606)
+	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
+	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
+	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
+	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
+	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
+	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
+	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
+	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
+	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
+	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
+	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
+	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
+	at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
+	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:236)
+	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:134)
+	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:113)
+	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
+	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
+	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
+	at java.lang.reflect.Method.invoke(Method.java:606)
+	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
+	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
+	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
+	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:103)
+	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:74)
+2014-06-23 22:24:10,630 - Null reference [template '/path/to/${unspecified_parameter}', line
1, column 10] : ${unspecified_parameter} cannot be resolved.
+2014-06-23 22:24:10,631 - Parser Exception: /path/to/${incorrect_parameter
+org.apache.velocity.runtime.parser.ParseException: Encountered "<EOF>" at line 1, column
30.
+Was expecting one of:
+    "[" ...
+    "}" ...
+    
+	at org.apache.velocity.runtime.parser.Parser.generateParseException(Parser.java:3679)
+	at org.apache.velocity.runtime.parser.Parser.jj_consume_token(Parser.java:3558)
+	at org.apache.velocity.runtime.parser.Parser.Reference(Parser.java:1521)
+	at org.apache.velocity.runtime.parser.Parser.Statement(Parser.java:357)
+	at org.apache.velocity.runtime.parser.Parser.process(Parser.java:317)
+	at org.apache.velocity.runtime.parser.Parser.parse(Parser.java:117)
+	at org.apache.velocity.runtime.RuntimeInstance.parse(RuntimeInstance.java:1226)
+	at org.apache.velocity.runtime.RuntimeInstance.parse(RuntimeInstance.java:1181)
+	at org.apache.velocity.runtime.RuntimeInstance.evaluate(RuntimeInstance.java:1297)
+	at org.apache.velocity.runtime.RuntimeInstance.evaluate(RuntimeInstance.java:1265)
+	at org.apache.velocity.app.Velocity.evaluate(Velocity.java:180)
+	at org.apache.ambari.server.view.ViewContextImpl.parameterize(ViewContextImpl.java:284)
+	at org.apache.ambari.server.view.ViewContextImpl.getProperties(ViewContextImpl.java:156)
+	at org.apache.ambari.server.view.ViewContextImplTest.testGetPropertiesWithParameters(ViewContextImplTest.java:129)
+	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
+	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
+	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
+	at java.lang.reflect.Method.invoke(Method.java:606)
+	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
+	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
+	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
+	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
+	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
+	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
+	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
+	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
+	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
+	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
+	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
+	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
+	at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
+	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:236)
+	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:134)
+	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:113)
+	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
+	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
+	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
+	at java.lang.reflect.Method.invoke(Method.java:606)
+	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
+	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
+	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
+	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:103)
+	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:74)
+2014-06-23 22:24:10,632 - Null reference [template '/path/to/${unspecified_parameter}', line
1, column 10] : ${unspecified_parameter} cannot be resolved.


Mime
View raw message