From: Mathieu Baudier Date: Fri, 26 Sep 2008 08:19:56 +0000 (+0000) Subject: Use Activator's classloader X-Git-Tag: argeo-slc-2.1.7~2553 X-Git-Url: http://git.argeo.org/?a=commitdiff_plain;h=b2f23cc85abe3bc31711c04746b80244b43bd442;p=gpl%2Fargeo-slc.git Use Activator's classloader git-svn-id: https://svn.argeo.org/slc/trunk@1638 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc --- diff --git a/org.argeo.slc.autoui.launcher/pom.xml b/org.argeo.slc.autoui.launcher/pom.xml index 76d65cc15..8810f92d1 100644 --- a/org.argeo.slc.autoui.launcher/pom.xml +++ b/org.argeo.slc.autoui.launcher/pom.xml @@ -5,7 +5,7 @@ org.argeo.slc argeo-slc - 0.10.3-SNAPSHOT + 0.11.1-SNAPSHOT ../org.argeo.slc org.argeo.slc.autoui.launcher.launcher @@ -57,5 +57,10 @@ spring-beans 2.0.8 + + + xerces + xercesImpl + \ No newline at end of file diff --git a/sandbox/argeo.slc.jemmytest/src/main/java/org/argeo/slc/jemmytest/JemmyTestActivator.java b/sandbox/argeo.slc.jemmytest/src/main/java/org/argeo/slc/jemmytest/JemmyTestActivator.java index 5a06369c7..c8c0e357c 100644 --- a/sandbox/argeo.slc.jemmytest/src/main/java/org/argeo/slc/jemmytest/JemmyTestActivator.java +++ b/sandbox/argeo.slc.jemmytest/src/main/java/org/argeo/slc/jemmytest/JemmyTestActivator.java @@ -12,22 +12,22 @@ public class JemmyTestActivator implements BundleActivator { private AbstractApplicationContext applicationContext; public void start(BundleContext context) throws Exception { - // ClassLoader classLoader = context.getBundle().getClass() - // .getClassLoader(); - // - // Thread cur = Thread.currentThread(); - // ClassLoader save = cur.getContextClassLoader(); - // cur.setContextClassLoader(classLoader); - // - // try { - // // FIXME: make it more generic - // applicationContext = new ClassPathXmlApplicationContext( - // "/slc/conf/applicationContext.xml"); - // } catch (Exception e) { - // throw new Exception("Could not initialize application context", e); - // } finally { - // cur.setContextClassLoader(save); - // } + ClassLoader classLoader = getClass().getClassLoader(); + + Thread cur = Thread.currentThread(); + ClassLoader save = cur.getContextClassLoader(); + cur.setContextClassLoader(classLoader); + + try { + // FIXME: make it more generic + applicationContext = new ClassPathXmlApplicationContext( + "/slc/conf/applicationContext.xml"); + } catch (Exception e) { + e.printStackTrace(); + throw new Exception("Could not initialize application context"); + } finally { + cur.setContextClassLoader(save); + } // applicationContext = new GenericApplicationContext(); // XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader( @@ -43,10 +43,10 @@ public class JemmyTestActivator implements BundleActivator { // } Properties properties = new Properties(); - AutoUiApplicationJemmy applicationJemmy = new AutoUiApplicationJemmy(); - // AutoUiApplicationJemmy applicationJemmy = (AutoUiApplicationJemmy) - // applicationContext - // .getBean("jemmyTest"); + // AutoUiApplicationJemmy applicationJemmy = new + // AutoUiApplicationJemmy(); + AutoUiApplicationJemmy applicationJemmy = (AutoUiApplicationJemmy) applicationContext + .getBean("jemmyTest"); context.registerService(AutoUiApplication.class.getName(), applicationJemmy, properties); stdOut("JemmyTest started");