You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by de...@apache.org on 2015/02/02 22:18:53 UTC

svn commit: r1656578 - in /uima/sandbox/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/classload: ProxyJobDriverCollectionReader.java ProxyJobDriverUserError.java

Author: degenaro
Date: Mon Feb  2 21:18:53 2015
New Revision: 1656578

URL: http://svn.apache.org/r1656578
Log:
UIMA-4069 DUCC Job Driver (JD) system classpath

provide full stack trace in JD log when CR throws an exception

Added:
    uima/sandbox/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/classload/ProxyJobDriverUserError.java   (with props)
Modified:
    uima/sandbox/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/classload/ProxyJobDriverCollectionReader.java

Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/classload/ProxyJobDriverCollectionReader.java
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/classload/ProxyJobDriverCollectionReader.java?rev=1656578&r1=1656577&r2=1656578&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/classload/ProxyJobDriverCollectionReader.java (original)
+++ uima/sandbox/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/classload/ProxyJobDriverCollectionReader.java Mon Feb  2 21:18:53 2015
@@ -85,6 +85,7 @@ public class ProxyJobDriverCollectionRea
 			retVal = PrivateClassLoader.create(userClasspath);
 		}
 		catch(Exception e) {
+			ProxyJobDriverUserError.loggifyUserException(e);
 			logger.error(location, ILogger.null_id, e);
 		}
 		return retVal;
@@ -98,6 +99,7 @@ public class ProxyJobDriverCollectionRea
 		} 
 		catch (Exception e) {
 			logger.error(location, ILogger.null_id, e);
+			ProxyJobDriverUserError.loggifyUserException(e);
 			throw new JobDriverException(e);
 		}
 		return retVal;
@@ -122,6 +124,7 @@ public class ProxyJobDriverCollectionRea
 		} 
 		catch (Exception e) {
 			logger.error(location, ILogger.null_id, e);
+			ProxyJobDriverUserError.loggifyUserException(e);
 			throw new JobDriverException(e);
 		}
 		return retVal;
@@ -168,6 +171,7 @@ public class ProxyJobDriverCollectionRea
 		} 
 		catch (Exception e) {
 			logger.error(location, ILogger.null_id, e);
+			ProxyJobDriverUserError.loggifyUserException(e);
 			throw new JobDriverException(e);
 		}
 	}
@@ -203,6 +207,7 @@ public class ProxyJobDriverCollectionRea
 		} 
 		catch (Exception e) {
 			logger.error(location, ILogger.null_id, mb, e);
+			ProxyJobDriverUserError.loggifyUserException(e);
 			throw new JobDriverException(e);
 		}
 	}

Added: uima/sandbox/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/classload/ProxyJobDriverUserError.java
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/classload/ProxyJobDriverUserError.java?rev=1656578&view=auto
==============================================================================
--- uima/sandbox/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/classload/ProxyJobDriverUserError.java (added)
+++ uima/sandbox/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/classload/ProxyJobDriverUserError.java Mon Feb  2 21:18:53 2015
@@ -0,0 +1,42 @@
+/*
+ * 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.uima.ducc.container.jd.classload;
+
+import org.apache.uima.ducc.container.common.logger.IComponent;
+import org.apache.uima.ducc.container.common.logger.ILogger;
+import org.apache.uima.ducc.container.common.logger.Logger;
+import org.apache.uima.ducc.user.jd.JdUserException;
+
+public class ProxyJobDriverUserError {
+
+	private static Logger logger = Logger.getLogger(ProxyJobDriverUserError.class, IComponent.Id.JD.name());
+	
+	public static void loggifyUserException(Exception e) {
+		String location = "loggifyUserException";
+		if(e != null) {
+			if(e instanceof JdUserException) {
+				JdUserException jdUserException = (JdUserException) e;
+				String userException = jdUserException.getUserException();
+				if(userException != null) {
+					logger.error(location, ILogger.null_id, userException);
+				}
+			}
+		}
+	}
+}

Propchange: uima/sandbox/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/classload/ProxyJobDriverUserError.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: uima/sandbox/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/classload/ProxyJobDriverUserError.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain