Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoy Varghese2016-03-03 15:55:35 -0500
committerRoy Varghese2016-03-03 15:55:35 -0500
commit43770f72a640773787e93cfeeb666f7d38458cb2 (patch)
tree95ccbe40b66354f1685e16714f8a999fcf493ba7
parentcd795f55bd1a3fe25e720c0c08b22369891da2be (diff)
downloadorg.eclipse.hudson.core-43770f72a640773787e93cfeeb666f7d38458cb2.tar.gz
org.eclipse.hudson.core-43770f72a640773787e93cfeeb666f7d38458cb2.tar.xz
org.eclipse.hudson.core-43770f72a640773787e93cfeeb666f7d38458cb2.zip
Fix problem preventing Hudson startup when jobs cannot load.
Corrupted or missing jobs throw exceptions when they are read at startup, which prevents Hudson from coming up. This change catches and records the exception in a transient reference so they can be viewed in the UI by the user instead of preventing hudson startup altogether. Signed-off-by: Roy Varghese <rovarghe@gmail.com> Change-Id: I27f26cae84358197b4592faba21075edba0cbc89
-rw-r--r--hudson-core/src/main/java/hudson/model/BrokenTopLevelItem.java4
-rw-r--r--hudson-core/src/main/java/hudson/model/Run.java2
-rw-r--r--hudson-core/src/main/java/hudson/model/TopLevelItemsCache.java2
3 files changed, 4 insertions, 4 deletions
diff --git a/hudson-core/src/main/java/hudson/model/BrokenTopLevelItem.java b/hudson-core/src/main/java/hudson/model/BrokenTopLevelItem.java
index 772cff19..0a8d98d3 100644
--- a/hudson-core/src/main/java/hudson/model/BrokenTopLevelItem.java
+++ b/hudson-core/src/main/java/hudson/model/BrokenTopLevelItem.java
@@ -24,11 +24,11 @@ import java.util.SortedMap;
public class BrokenTopLevelItem extends Job implements TopLevelItem {
final private RunMap runMap;
- final private Exception exception;
+ final private Throwable exception;
final private LazyTopLevelItem.Key key;
BrokenTopLevelItem(LazyTopLevelItem.Key key,
- Exception exception) {
+ Throwable exception) {
super(key.parent, key.name);
this.key = key;
diff --git a/hudson-core/src/main/java/hudson/model/Run.java b/hudson-core/src/main/java/hudson/model/Run.java
index 5e8f1701..66e1b8cf 100644
--- a/hudson-core/src/main/java/hudson/model/Run.java
+++ b/hudson-core/src/main/java/hudson/model/Run.java
@@ -177,7 +177,7 @@ public abstract class Run<JobT extends Job<JobT, RunT>, RunT extends Run<JobT, R
/**
* Stores any exception thrown when loading from 'dataFile'(build.xml)
*/
- private Exception dataFileLoadException;
+ private transient Exception dataFileLoadException;
static enum State {
diff --git a/hudson-core/src/main/java/hudson/model/TopLevelItemsCache.java b/hudson-core/src/main/java/hudson/model/TopLevelItemsCache.java
index c2e191f0..2493eeb0 100644
--- a/hudson-core/src/main/java/hudson/model/TopLevelItemsCache.java
+++ b/hudson-core/src/main/java/hudson/model/TopLevelItemsCache.java
@@ -88,7 +88,7 @@ class TopLevelItemsCache {
catch (Throwable ex) {
System.err.println("ERROR===: Unable to load " +key.name);
key.setLoadErrorFlag();
- return new BrokenTopLevelItem(key, new Exception(ex));
+ return new BrokenTopLevelItem(key, ex);
}
}

Back to the top