Many thanks... your factory bean idea is brilliant.
Code:
<bean id="jmsFactory" class="org.mr.api.jms.MantaConnectionFactory" >
<property name="configuration">
<bean class="org.apache.commons.io.IOUtils" factory-method="toString">
<constructor-arg type="java.io.InputStream" value="classpath:mantaray_config.xml"/>
</bean>
</property>
</bean>
I have one wrinkle to cure. There are two ways to push the xml file contents into this jms bean and both use the same named 'configuration' property...
* the first has 'configuration' as a string and will take the xml file content
* the second has 'configuration' as an XML Element and will take a DOM model as its parameter.
When I run a standalone test app then the 'IOUtils' factory bean idea works perfectly, as the spring bean application context file parser finds 'configuration' as a string property.
However, when I run my Spring web app the same code fails as the bean xml parser is finding configuration as the Element parameter, see...
Code:
aused by: java.lang.IllegalArgumentException: Cannot convert value of type [java.lang.String] to required type [org.w3c.dom.Element] for property 'configuration': no matching editors or conversion strategy found
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:231)
Is it possible to define the 'configuration' type parameter type as string only?