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>
|
||||
<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>
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue