You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by gt...@apache.org on 2013/11/27 17:05:21 UTC

git commit: https://issues.apache.org/jira/browse/AMQ-4905 - resolve by embedding spring xsd

Updated Branches:
  refs/heads/trunk 7d98b3205 -> eead6e511


https://issues.apache.org/jira/browse/AMQ-4905 - resolve by embedding spring xsd


Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/eead6e51
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/eead6e51
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/eead6e51

Branch: refs/heads/trunk
Commit: eead6e511083fa1c1a9595f8671a722630afb1e2
Parents: 7d98b32
Author: gtully <ga...@gmail.com>
Authored: Wed Nov 27 16:04:14 2013 +0000
Committer: gtully <ga...@gmail.com>
Committed: Wed Nov 27 16:04:14 2013 +0000

----------------------------------------------------------------------
 activemq-runtime-config/pom.xml                 | 21 ++++++++++++++++++++
 .../plugin/RuntimeConfigurationBroker.java      | 17 ++--------------
 2 files changed, 23 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/eead6e51/activemq-runtime-config/pom.xml
----------------------------------------------------------------------
diff --git a/activemq-runtime-config/pom.xml b/activemq-runtime-config/pom.xml
index eead4ad..d66656f 100755
--- a/activemq-runtime-config/pom.xml
+++ b/activemq-runtime-config/pom.xml
@@ -115,6 +115,7 @@
                 <artifactItem>
                   <groupId>org.apache.activemq</groupId>
                   <artifactId>activemq-spring</artifactId>
+                  <version>${project.version}</version>
                   <type>jar</type>
                   <overWrite>true</overWrite>
                   <includes>activemq.xsd</includes>
@@ -123,6 +124,26 @@
               <outputDirectory>src/main/resources</outputDirectory>
             </configuration>
           </execution>
+          <execution>
+            <id>unpack-spring-xsd</id>
+            <phase>generate-sources</phase>
+            <goals>
+              <goal>unpack</goal>
+            </goals>
+            <configuration>
+              <artifactItems>
+                <artifactItem>
+                  <groupId>org.springframework</groupId>
+                  <artifactId>spring-beans</artifactId>
+                  <version>${spring-version}</version>
+                  <type>jar</type>
+                  <overWrite>true</overWrite>
+                  <includes>org/springframework/beans/factory/xml/spring-beans-3.0.xsd</includes>
+                </artifactItem>
+              </artifactItems>
+              <outputDirectory>src/main/resources</outputDirectory>
+            </configuration>
+          </execution>
         </executions>
       </plugin>
       <plugin>

http://git-wip-us.apache.org/repos/asf/activemq/blob/eead6e51/activemq-runtime-config/src/main/java/org/apache/activemq/plugin/RuntimeConfigurationBroker.java
----------------------------------------------------------------------
diff --git a/activemq-runtime-config/src/main/java/org/apache/activemq/plugin/RuntimeConfigurationBroker.java b/activemq-runtime-config/src/main/java/org/apache/activemq/plugin/RuntimeConfigurationBroker.java
index ce26534..90dba00 100644
--- a/activemq-runtime-config/src/main/java/org/apache/activemq/plugin/RuntimeConfigurationBroker.java
+++ b/activemq-runtime-config/src/main/java/org/apache/activemq/plugin/RuntimeConfigurationBroker.java
@@ -804,7 +804,7 @@ public class RuntimeConfigurationBroker extends BrokerFilter {
                 Object springBean = getClass().getClassLoader().loadClass(value).newInstance();
                 if (springBean instanceof FactoryBean) {
                     // can't access the factory or created properties from spring context so we got to recreate
-                    initialProperties.putAll((Properties) FactoryBean.class.getMethod("getObject", null).invoke(springBean));
+                    initialProperties.putAll((Properties) FactoryBean.class.getMethod("getObject", (Class<?>[]) null).invoke(springBean));
                 }
             } catch (Throwable e) {
                 LOG.debug("unexpected exception processing properties bean class: " + propertiesClazzes, e);
@@ -851,20 +851,7 @@ public class RuntimeConfigurationBroker extends BrokerFilter {
 
             ArrayList<StreamSource> schemas = new ArrayList<StreamSource>();
             schemas.add(new StreamSource(getClass().getResource("/activemq.xsd").toExternalForm()));
-
-            // avoid going to the net to pull down the spring schema,
-            // REVISIT may need to be smarter in osgi
-            final PluggableSchemaResolver springResolver =
-                    new PluggableSchemaResolver(getClass().getClassLoader());
-            final InputSource beanInputSource =
-                    springResolver.resolveEntity(
-                            "http://www.springframework.org/schema/beans",
-                            "http://www.springframework.org/schema/beans/spring-beans.xsd");
-            if (beanInputSource != null) {
-                schemas.add(new StreamSource(beanInputSource.getByteStream()));
-            } else {
-                schemas.add(new StreamSource("http://www.springframework.org/schema/beans/spring-beans.xsd"));
-            }
+            schemas.add(new StreamSource(getClass().getResource("/org/springframework/beans/factory/xml/spring-beans-3.0.xsd").toExternalForm()));
             schema = schemaFactory.newSchema(schemas.toArray(new Source[]{}));
         }
         return schema;