Spring FrameWork: How to pass InputStream while initializing bean
898032Jun 12 2012 — edited Jun 12 2012I have a bean class: HelloWorld.java with this constructor
...
public HelloWorld(InputStream is){
//Do SOMETHING!!
}
...
i have a config xml that has
<bean id="SpringHelloWorldBean"
class="com.utd.greet.HelloWorld">
<constructor-arg value="<<what-should-i-give-here>>/test.properties" type="java.io.InputStream">
</constructor-arg>
</bean>
I am getting following error:
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'SpringHelloWorldBean' defined in class path resource [SpringHelloWorld.xml]: Unsatisfied dependency expressed through constructor argument with index 0 of type [java.lang.String]: Ambiguous constructor argument types - did you specify the correct bean references as constructor arguments?
Any help would be appreciated!
PEACE,
Sandeep