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/3444c89f Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/3444c89f Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/3444c89f Branch: refs/heads/activemq-5.9 Commit: 3444c89fd8cddfde9f08cb1e101c65f6824b3f27 Parents: 77b4d70 Author: gtully <[email protected]> Authored: Wed Nov 27 16:04:14 2013 +0000 Committer: Hadrian Zbarcea <[email protected]> Committed: Wed Mar 12 13:10:50 2014 -0400 ---------------------------------------------------------------------- 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/3444c89f/activemq-runtime-config/pom.xml ---------------------------------------------------------------------- diff --git a/activemq-runtime-config/pom.xml b/activemq-runtime-config/pom.xml index 6e3ea16..a49b3a2 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/3444c89f/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 82a5ee3..1879b1c 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 @@ -809,7 +809,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); @@ -856,20 +856,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;
