package com.rpaisley.example.osgi.xml.impl;

import javax.xml.XMLConstants;
import javax.xml.validation.SchemaFactory;

public class XMLServiceImpl {
	public XMLServiceImpl() {
		System.out.println(this.getClass().getName() + " starting");
		try {
			SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
			System.out.println("Lookup of schema: " + XMLConstants.W3C_XML_SCHEMA_NS_URI
					+ " yielded factory: " + factory.getClass().getName());
		} catch (Throwable t) {
			System.out.println("Failed to lookup schema: " + t);

		}
	}
}
@@ -241,16 +241,189 @@
 %09%09try %7B%0A
+%09%09%09ClassLoader original = Thread.currentThread().getContextClassLoader();%0A%09%09%09try %7B%0A%09%09%09%09Thread.currentThread().setContextClassLoader(XMLServiceImpl.class.getClassLoader());%0A%09
 %09%09%09Schem
@@ -454,16 +454,23 @@
 aFactory
+%0A%09%09%09%09%09%09
 .newInst
@@ -511,16 +511,17 @@
 S_URI);%0A
+%09
 %09%09%09Syste
@@ -597,16 +597,17 @@
 RI%0A%09%09%09%09%09
+%09
 + %22 yiel
@@ -654,16 +654,96 @@
 ame());%0A
+%09%09%09%7D finally %7B%0A%09%09%09%09Thread.currentThread().setContextClassLoader(original);%0A%09%09%09%7D%0A
 %09%09%7D catc

Use Thread Context Class Loader for schema lookup