Repository: oozie
Updated Branches:
  refs/heads/master 9eb82649b -> 494ab6f4a


OOZIE-3386 Misleading error message when workflow application does not exist 
(kmarton)


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

Branch: refs/heads/master
Commit: 494ab6f4ad5e7f31da8b58c724d1a7e89cc39d4b
Parents: 9eb8264
Author: Julia Kinga Marton <[email protected]>
Authored: Wed Nov 28 12:26:34 2018 +0100
Committer: Julia Kinga Marton <[email protected]>
Committed: Wed Nov 28 12:26:34 2018 +0100

----------------------------------------------------------------------
 .../java/org/apache/oozie/servlet/V1JobsServlet.java    | 12 +++++++-----
 release-log.txt                                         |  1 +
 2 files changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/oozie/blob/494ab6f4/core/src/main/java/org/apache/oozie/servlet/V1JobsServlet.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/oozie/servlet/V1JobsServlet.java 
b/core/src/main/java/org/apache/oozie/servlet/V1JobsServlet.java
index b7967be..8ffd441 100644
--- a/core/src/main/java/org/apache/oozie/servlet/V1JobsServlet.java
+++ b/core/src/main/java/org/apache/oozie/servlet/V1JobsServlet.java
@@ -144,8 +144,9 @@ public class V1JobsServlet extends BaseJobsServlet {
         }
 
         final List<String> appPathsWithFileNames;
-        if (!findAppPathsWithFileNames(conf.get(OozieClient.APP_PATH), 
"workflow.xml").isEmpty()) {
-            appPathsWithFileNames = 
findAppPathsWithFileNames(conf.get(OozieClient.APP_PATH), "workflow.xml");
+        final String appPath = conf.get(OozieClient.APP_PATH);
+        if (!findAppPathsWithFileNames(appPath, "workflow.xml").isEmpty()) {
+            appPathsWithFileNames = findAppPathsWithFileNames(appPath, 
"workflow.xml");
         }
         else if (!findAppPathsWithFileNames(conf.get(OozieClient.LIBPATH), 
"workflow.xml").isEmpty()) {
             appPathsWithFileNames = 
findAppPathsWithFileNames(conf.get(OozieClient.LIBPATH), "workflow.xml");
@@ -168,10 +169,11 @@ public class V1JobsServlet extends BaseJobsServlet {
         for (final String appPathWithFileName : appPathsWithFileNames) {
             final String sourceContent = 
conf.get(OozieClient.CONFIG_KEY_GENERATED_XML);
             if (sourceContent == null) {
-                throw new 
XServletException(HttpServletResponse.SC_BAD_REQUEST, ErrorCode.E0307,
-                        String.format("Configuration entry %s not present", 
OozieClient.CONFIG_KEY_GENERATED_XML));
+                final String errorMessage = String.format("App directory [%s] 
does not exist and " +
+                        "app definition cannot be created because of missing 
config value [%s]",
+                        appPath,  OozieClient.CONFIG_KEY_GENERATED_XML);
+                throw new 
XServletException(HttpServletResponse.SC_BAD_REQUEST, ErrorCode.E0307, 
errorMessage);
             }
-
             if (tryCreateOnDFS(userName, appPathWithFileName, sourceContent)) {
                 return;
             }

http://git-wip-us.apache.org/repos/asf/oozie/blob/494ab6f4/release-log.txt
----------------------------------------------------------------------
diff --git a/release-log.txt b/release-log.txt
index 2c7265e..681acb2 100644
--- a/release-log.txt
+++ b/release-log.txt
@@ -1,5 +1,6 @@
 -- Oozie 5.2.0 release (trunk - unreleased)
 
+OOZIE-3386 Misleading error message when workflow application does not exist 
(kmarton)
 OOZIE-3120 Upgrade maven-assembly plugin to v.3.1.0 (dionusos via kmarton)
 OOZIE-3381 [coordinator] Enhance logging of CoordElFunctions (andras.piros via 
kmarton)
 OOZIE-3380 TestCoordMaterializeTransitionXCommand failure after DST change 
date (asalamon74 via kmarton)

Reply via email to