]> git.argeo.org Git - gpl/argeo-slc.git/commitdiff
Use Activator's classloader
authorMathieu Baudier <mbaudier@argeo.org>
Fri, 26 Sep 2008 08:19:56 +0000 (08:19 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Fri, 26 Sep 2008 08:19:56 +0000 (08:19 +0000)
git-svn-id: https://svn.argeo.org/slc/trunk@1638 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

org.argeo.slc.autoui.launcher/pom.xml
sandbox/argeo.slc.jemmytest/src/main/java/org/argeo/slc/jemmytest/JemmyTestActivator.java

index 76d65cc15a1c3036e2cdc12b00dc2f7eac50d2db..8810f92d1c910a99d0458cb9ddae137b4a7964ee 100644 (file)
@@ -5,7 +5,7 @@
        <parent>
                <groupId>org.argeo.slc</groupId>
                <artifactId>argeo-slc</artifactId>
-               <version>0.10.3-SNAPSHOT</version>
+               <version>0.11.1-SNAPSHOT</version>
                <relativePath>../org.argeo.slc</relativePath>
        </parent>
        <artifactId>org.argeo.slc.autoui.launcher.launcher</artifactId>
                        <artifactId>spring-beans</artifactId>
                        <version>2.0.8</version>
                </dependency>
+
+                       <dependency>
+                               <groupId>xerces</groupId>
+                               <artifactId>xercesImpl</artifactId>
+                       </dependency>
        </dependencies>
 </project>
\ No newline at end of file
index 5a06369c72331c05ba182521d888dbbe51345427..c8c0e357c3cf4ee4407661a0d33c6fb6a9b63c2d 100644 (file)
@@ -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");