313607 - JAXB Classes Generation fails to pick SYSTEM classpath variables
diff --git a/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/core/internal/ClassesGenerator.java b/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/core/internal/ClassesGenerator.java
index 74e50d0..aa07c9d 100644
--- a/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/core/internal/ClassesGenerator.java
+++ b/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/core/internal/ClassesGenerator.java
@@ -26,7 +26,10 @@
 import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
 import org.eclipse.debug.core.ILaunchManager;
 import org.eclipse.debug.core.ILaunchesListener2;
+import org.eclipse.jdt.core.IClasspathContainer;
+import org.eclipse.jdt.core.IClasspathEntry;
 import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
 import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
 import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
 import org.eclipse.jdt.launching.IVMInstall;
@@ -166,6 +169,10 @@
 			classpath.add(this.getDefaultProjectClasspathEntry(project).getMemento());
 			// System Library  
 			classpath.add(this.getSystemLibraryClasspathEntry().getMemento());
+			// Containers classpath
+			for(IRuntimeClasspathEntry containerClasspathEntry: this.getContainersClasspathEntries()) {
+				classpath.add(containerClasspathEntry.getMemento());
+			}
 		}
 		catch (CoreException e) {
 			throw new RuntimeException("An error occurs generating a memento", e);
@@ -210,7 +217,7 @@
 			programArguments.append(catalog);
 		}
 		// schema
-		programArguments.append(" ");	  //$NON-NLS-1$
+		programArguments.append(' ');	  //$NON-NLS-1$
 		programArguments.append(xmlSchemaName);
 		
 		// bindings
@@ -235,8 +242,7 @@
 		ILaunchConfigurationWorkingCopy launchConfig = null;
 		this.removeLaunchConfiguration(LAUNCH_CONFIG_NAME);
 
-		ILaunchManager manager = getLaunchManager();
-		ILaunchConfigurationType type = getLaunchManager().getLaunchConfigurationType(IJavaLaunchConfigurationConstants.ID_JAVA_APPLICATION);
+		ILaunchConfigurationType type = this.getLaunchManager().getLaunchConfigurationType(IJavaLaunchConfigurationConstants.ID_JAVA_APPLICATION);
 
 		launchConfig = type.newInstance(null, LAUNCH_CONFIG_NAME);
 		return launchConfig;
@@ -323,6 +329,23 @@
 		
 		return projectEntry;
 	}
+
+	private List<IRuntimeClasspathEntry> getContainersClasspathEntries() throws CoreException {
+		ArrayList<IRuntimeClasspathEntry> classpathEntries = new ArrayList<IRuntimeClasspathEntry>();
+		for(IClasspathEntry classpathEntry: this.javaProject.getRawClasspath()) {
+			if(classpathEntry.getEntryKind() == IClasspathEntry.CPE_CONTAINER) {
+				IClasspathContainer container = JavaCore.getClasspathContainer(classpathEntry.getPath(), this.javaProject);
+				if(container != null && container.getKind() == IClasspathContainer.K_SYSTEM) {
+					classpathEntries.add( 
+						JavaRuntime.newRuntimeContainerClasspathEntry(
+							container.getPath(), 
+							IRuntimeClasspathEntry.BOOTSTRAP_CLASSES, 
+							this.javaProject));
+				}
+			}
+		}
+		return classpathEntries;
+	}
 	
 	private IVMInstall getProjectJRE() throws CoreException {
 		return JavaRuntime.getVMInstall(this.javaProject);