geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r440858 - in /geronimo/xbean/trunk: xbean-server/src/main/java/org/apache/xbean/server/deployer/ xbean-spring-common/src/main/java/org/apache/xbean/spring/context/ xbean-spring-v1/src/main/java/org/apache/xbean/spring/context/v1/ xbean-spri...
Date Wed, 06 Sep 2006 20:29:30 GMT
Author: gnodet
Date: Wed Sep  6 13:29:29 2006
New Revision: 440858

URL: http://svn.apache.org/viewvc?view=rev&rev=440858
Log:
XBEAN-51: XBean may not be able to load xbean mappings when booting from xbean-server
Also fix a double refresh

Modified:
    geronimo/xbean/trunk/xbean-server/src/main/java/org/apache/xbean/server/deployer/FileDeployer.java
    geronimo/xbean/trunk/xbean-spring-common/src/main/java/org/apache/xbean/spring/context/ResourceXmlApplicationContext.java
    geronimo/xbean/trunk/xbean-spring-v1/src/main/java/org/apache/xbean/spring/context/v1/XBeanXmlBeanDefinitionParser.java
    geronimo/xbean/trunk/xbean-spring-v2a/src/main/java/org/apache/xbean/spring/context/v2a/XBeanNamespaceHandler.java
    geronimo/xbean/trunk/xbean-spring-v2b/src/main/java/org/apache/xbean/spring/context/v2b/XBeanNamespaceHandler.java

Modified: geronimo/xbean/trunk/xbean-server/src/main/java/org/apache/xbean/server/deployer/FileDeployer.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-server/src/main/java/org/apache/xbean/server/deployer/FileDeployer.java?view=diff&rev=440858&r1=440857&r2=440858
==============================================================================
--- geronimo/xbean/trunk/xbean-server/src/main/java/org/apache/xbean/server/deployer/FileDeployer.java
(original)
+++ geronimo/xbean/trunk/xbean-server/src/main/java/org/apache/xbean/server/deployer/FileDeployer.java
Wed Sep  6 13:29:29 2006
@@ -339,8 +339,9 @@
             Thread.currentThread().setContextClassLoader(classLoader);
             log.debug("Loading file: " + file + " using classLoader: " + classLoader);
             try {
-                SpringApplicationContext applicationContext = new ResourceXmlApplicationContext(new
FileSystemResource(file), xmlPreprocessors, parentContext, beanFactoryPostProcessors);
+                SpringApplicationContext applicationContext = new ResourceXmlApplicationContext(new
FileSystemResource(file), xmlPreprocessors, parentContext, beanFactoryPostProcessors, false);
                 applicationContext.setDisplayName(name);
+                applicationContext.setClassLoader(classLoader);
 
                 ServiceFactory serviceFactory = new SpringConfigurationServiceFactory(applicationContext);
 

Modified: geronimo/xbean/trunk/xbean-spring-common/src/main/java/org/apache/xbean/spring/context/ResourceXmlApplicationContext.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-spring-common/src/main/java/org/apache/xbean/spring/context/ResourceXmlApplicationContext.java?view=diff&rev=440858&r1=440857&r2=440858
==============================================================================
--- geronimo/xbean/trunk/xbean-spring-common/src/main/java/org/apache/xbean/spring/context/ResourceXmlApplicationContext.java
(original)
+++ geronimo/xbean/trunk/xbean-spring-common/src/main/java/org/apache/xbean/spring/context/ResourceXmlApplicationContext.java
Wed Sep  6 13:29:29 2006
@@ -73,6 +73,10 @@
     }
     
     public ResourceXmlApplicationContext(Resource resource,  List xmlPreprocessors, ApplicationContext
parent, List beanPostProcessors) {
+        this(resource, xmlPreprocessors, parent, beanPostProcessors, true);
+    }
+
+    public ResourceXmlApplicationContext(Resource resource,  List xmlPreprocessors, ApplicationContext
parent, List beanPostProcessors, boolean refresh) {
         super(parent);
         this.xmlPreprocessors = xmlPreprocessors;
         this.resource = resource;
@@ -80,7 +84,9 @@
             BeanFactoryPostProcessor processor =  (BeanFactoryPostProcessor) iter.next();
             addBeanFactoryPostProcessor(processor);
         }
-        refresh();
+        if (refresh) {
+            refresh();
+        }
     }
 
     protected void loadBeanDefinitions(DefaultListableBeanFactory beanFactory) throws IOException
{

Modified: geronimo/xbean/trunk/xbean-spring-v1/src/main/java/org/apache/xbean/spring/context/v1/XBeanXmlBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-spring-v1/src/main/java/org/apache/xbean/spring/context/v1/XBeanXmlBeanDefinitionParser.java?view=diff&rev=440858&r1=440857&r2=440858
==============================================================================
--- geronimo/xbean/trunk/xbean-spring-v1/src/main/java/org/apache/xbean/spring/context/v1/XBeanXmlBeanDefinitionParser.java
(original)
+++ geronimo/xbean/trunk/xbean-spring-v1/src/main/java/org/apache/xbean/spring/context/v1/XBeanXmlBeanDefinitionParser.java
Wed Sep  6 13:29:29 2006
@@ -698,9 +698,15 @@
         // lets try the thread context class loader first
         InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream(uri);
         if (in == null) {
-            in = getClass().getClassLoader().getResourceAsStream(uri);
+            ClassLoader cl = getBeanDefinitionReader().getBeanClassLoader();
+            if (cl != null) {
+                in = cl.getResourceAsStream(uri);
+            }
             if (in == null) {
-                logger.debug("Could not find resource: " + uri);
+                in = getClass().getClassLoader().getResourceAsStream(uri);
+                if (in == null) {
+                    logger.debug("Could not find resource: " + uri);
+                }
             }
         }
         return in;

Modified: geronimo/xbean/trunk/xbean-spring-v2a/src/main/java/org/apache/xbean/spring/context/v2a/XBeanNamespaceHandler.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-spring-v2a/src/main/java/org/apache/xbean/spring/context/v2a/XBeanNamespaceHandler.java?view=diff&rev=440858&r1=440857&r2=440858
==============================================================================
--- geronimo/xbean/trunk/xbean-spring-v2a/src/main/java/org/apache/xbean/spring/context/v2a/XBeanNamespaceHandler.java
(original)
+++ geronimo/xbean/trunk/xbean-spring-v2a/src/main/java/org/apache/xbean/spring/context/v2a/XBeanNamespaceHandler.java
Wed Sep  6 13:29:29 2006
@@ -726,9 +726,15 @@
         // lets try the thread context class loader first
         InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream(uri);
         if (in == null) {
-            in = getClass().getClassLoader().getResourceAsStream(uri);
+            ClassLoader cl = parserContext.getReaderContext().getReader().getBeanClassLoader();
+            if (cl != null) {
+                in = cl.getResourceAsStream(uri);
+            }
             if (in == null) {
-                log.debug("Could not find resource: " + uri);
+                in = getClass().getClassLoader().getResourceAsStream(uri);
+                if (in == null) {
+                    log.debug("Could not find resource: " + uri);
+                }
             }
         }
         return in;

Modified: geronimo/xbean/trunk/xbean-spring-v2b/src/main/java/org/apache/xbean/spring/context/v2b/XBeanNamespaceHandler.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-spring-v2b/src/main/java/org/apache/xbean/spring/context/v2b/XBeanNamespaceHandler.java?view=diff&rev=440858&r1=440857&r2=440858
==============================================================================
--- geronimo/xbean/trunk/xbean-spring-v2b/src/main/java/org/apache/xbean/spring/context/v2b/XBeanNamespaceHandler.java
(original)
+++ geronimo/xbean/trunk/xbean-spring-v2b/src/main/java/org/apache/xbean/spring/context/v2b/XBeanNamespaceHandler.java
Wed Sep  6 13:29:29 2006
@@ -726,9 +726,15 @@
         // lets try the thread context class loader first
         InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream(uri);
         if (in == null) {
-            in = getClass().getClassLoader().getResourceAsStream(uri);
+            ClassLoader cl = parserContext.getReaderContext().getReader().getBeanClassLoader();
+            if (cl != null) {
+                in = cl.getResourceAsStream(uri);
+            }
             if (in == null) {
-                log.debug("Could not find resource: " + uri);
+                in = getClass().getClassLoader().getResourceAsStream(uri);
+                if (in == null) {
+                    log.debug("Could not find resource: " + uri);
+                }
             }
         }
         return in;



Mime
View raw message