mirror of https://github.com/apache/activemq.git
https://issues.apache.org/jira/browse/AMQ-4905 - resolve by embedding spring xsd
This commit is contained in:
parent
7d98b32050
commit
eead6e5110
|
@ -115,6 +115,7 @@
|
||||||
<artifactItem>
|
<artifactItem>
|
||||||
<groupId>org.apache.activemq</groupId>
|
<groupId>org.apache.activemq</groupId>
|
||||||
<artifactId>activemq-spring</artifactId>
|
<artifactId>activemq-spring</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
<type>jar</type>
|
<type>jar</type>
|
||||||
<overWrite>true</overWrite>
|
<overWrite>true</overWrite>
|
||||||
<includes>activemq.xsd</includes>
|
<includes>activemq.xsd</includes>
|
||||||
|
@ -123,6 +124,26 @@
|
||||||
<outputDirectory>src/main/resources</outputDirectory>
|
<outputDirectory>src/main/resources</outputDirectory>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</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>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
|
|
|
@ -804,7 +804,7 @@ public class RuntimeConfigurationBroker extends BrokerFilter {
|
||||||
Object springBean = getClass().getClassLoader().loadClass(value).newInstance();
|
Object springBean = getClass().getClassLoader().loadClass(value).newInstance();
|
||||||
if (springBean instanceof FactoryBean) {
|
if (springBean instanceof FactoryBean) {
|
||||||
// can't access the factory or created properties from spring context so we got to recreate
|
// 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) {
|
} catch (Throwable e) {
|
||||||
LOG.debug("unexpected exception processing properties bean class: " + propertiesClazzes, 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>();
|
ArrayList<StreamSource> schemas = new ArrayList<StreamSource>();
|
||||||
schemas.add(new StreamSource(getClass().getResource("/activemq.xsd").toExternalForm()));
|
schemas.add(new StreamSource(getClass().getResource("/activemq.xsd").toExternalForm()));
|
||||||
|
schemas.add(new StreamSource(getClass().getResource("/org/springframework/beans/factory/xml/spring-beans-3.0.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"));
|
|
||||||
}
|
|
||||||
schema = schemaFactory.newSchema(schemas.toArray(new Source[]{}));
|
schema = schemaFactory.newSchema(schemas.toArray(new Source[]{}));
|
||||||
}
|
}
|
||||||
return schema;
|
return schema;
|
||||||
|
|
Loading…
Reference in New Issue