[294716] ClasspathDecorationsManager may cause SAXParseException
[295494] RuntimeClasspathContainer should update runtime if it is null
diff --git a/features/org.eclipse.jst.server_core.feature.patch/buildnotes_org.eclipse.jst.server_core.feature.patch.html b/features/org.eclipse.jst.server_core.feature.patch/buildnotes_org.eclipse.jst.server_core.feature.patch.html
index 43743bd..bdbb7ab 100644
--- a/features/org.eclipse.jst.server_core.feature.patch/buildnotes_org.eclipse.jst.server_core.feature.patch.html
+++ b/features/org.eclipse.jst.server_core.feature.patch/buildnotes_org.eclipse.jst.server_core.feature.patch.html
@@ -14,4 +14,5 @@
 <h2>org.eclipse.jst.server_core.feature</h2>
 
 <p>Bug <a href='https://bugs.eclipse.org/bugs/show_bug.cgi?id=294664'>294664</a>. Classpath entry attributes lost when updating runtime classpath container</p>
+<p>Bug <a href='https://bugs.eclipse.org/bugs/show_bug.cgi?id=295494'>295494</a>. RuntimeClasspathContainer should update runtime if it is null</p>
 </body></html>
\ No newline at end of file
diff --git a/features/org.eclipse.jst.server_core.feature.patch/feature.properties b/features/org.eclipse.jst.server_core.feature.patch/feature.properties
index 06ef350..703ef92 100644
--- a/features/org.eclipse.jst.server_core.feature.patch/feature.properties
+++ b/features/org.eclipse.jst.server_core.feature.patch/feature.properties
@@ -31,6 +31,7 @@
 The fixes are described in the following bugzilla entries:\n\
 \n\
 Bug https://bugs.eclipse.org/294664 Classpath entry attributes lost when updating runtime classpath container\n\
+Bug https://bugs.eclipse.org/295494 RuntimeClasspathContainer should update runtime if it is null\n\
 \n\
 # "copyright" property - text of the "Feature Update Copyright"
 copyright=\
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeClasspathContainer.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeClasspathContainer.java
index d044b05..e76f687 100644
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeClasspathContainer.java
+++ b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeClasspathContainer.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * Copyright (c) 2003, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -18,6 +18,7 @@
 
 import org.eclipse.wst.server.core.IRuntime;
 import org.eclipse.wst.server.core.IRuntimeType;
+import org.eclipse.wst.server.core.ServerCore;
 /**
  * 
  */
@@ -69,8 +70,11 @@
 	 */
 	public IClasspathEntry[] getClasspathEntries() {
 		IClasspathEntry[] entries = null;
-		if (delegate != null && runtime != null)
-			entries = delegate.resolveClasspathContainerImpl(project, runtime);
+		
+		IRuntime curRuntime = getRuntime();
+		
+		if (delegate != null && curRuntime != null)
+			entries = delegate.resolveClasspathContainerImpl(project, curRuntime);
 		
 		if (entries == null)
 			return new IClasspathEntry[0];
@@ -78,14 +82,24 @@
 		return entries;
 	}
 
+	private IRuntime getRuntime(){
+		if (runtime == null && runtimeId != null) {
+			// Make sure the runtime object is initialized.
+			runtime = ServerCore.findRuntime(runtimeId);
+		}
+		return runtime;
+	}
+	
 	/** (non-Javadoc)
 	 * @see org.eclipse.jdt.core.IClasspathContainer#getDescription()
 	 */
 	public String getDescription() {
-		if (runtime != null) {
-			IRuntimeType runtimeType = runtime.getRuntimeType();
+		IRuntime curRuntime = getRuntime();
+
+		if (curRuntime != null) {
+			IRuntimeType runtimeType = curRuntime.getRuntimeType();
 			if (runtimeType != null)
-				return NLS.bind(Messages.classpathContainer, runtimeType.getName(), runtime.getName());
+				return NLS.bind(Messages.classpathContainer, runtimeType.getName(), curRuntime.getName());
 		}
 		return NLS.bind(Messages.classpathContainerUnbound, Messages.classpathContainerDescription, runtimeId);
 	}