(I'm running the spring.jar and spring-sandbox.jar updated from the Spring RCP CVS as of tonight)
In my standalone application test setup, I have this in order to load some DBUnit data set:
Upon loading this app context, I got a bean instantiation error because no matching constructors were found -Code:<bean id="data-set-input-stream" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean"> <property name="staticMethod"><value>java.lang.ClassLoader.getSystemResourceAsStream</value></property> <property name="arguments"> <list> <value>/default-dataset.xml</value> </list> </property> </bean> <bean id="direct-input-stream" class="java.io.FileInputStream"> <constructor-arg><value>E:\default-dataset.xml</value></constructor-arg> </bean> <bean id="data-set" class="org.dbunit.dataset.xml.FlatXmlDataSet"> <constructor-arg type="java.io.InputStream"><ref bean="data-set-input-stream"/></constructor-arg> <constructor-arg type="boolean"><value>false</value></constructor-arg> </bean>
However if I change the first constructor-arg reference to "direct-input-stream", the bean is instantiated successfully.Code:04 Nov 2004 22:14:56,953 DEBUG [main] org.springframework.beans.factory.support.DefaultListableBeanFactory - Ignoring constructor [public org.dbunit.dataset.xml.FlatXmlDataSet(java.io.File,boolean) throws java.io.IOException,org.dbunit.dataset.DataSetException] of bean 'data-set': could not satisfy dependencies. Detail: Error creating bean with name 'data-set' defined in class path resource [global-context.xml]: Unsatisfied dependency expressed through constructor argument with index 0 of type [java.io.File]: Did you specify the correct bean references as generic constructor arguments? 04 Nov 2004 22:14:56,953 DEBUG [main] org.springframework.beans.factory.support.DefaultListableBeanFactory - Ignoring constructor [public org.dbunit.dataset.xml.FlatXmlDataSet(java.net.URL,boolean) throws java.io.IOException,org.dbunit.dataset.DataSetException] of bean 'data-set': could not satisfy dependencies. Detail: Error creating bean with name 'data-set' defined in class path resource [global-context.xml]: Unsatisfied dependency expressed through constructor argument with index 0 of type [java.net.URL]: Did you specify the correct bean references as generic constructor arguments? 04 Nov 2004 22:14:56,953 DEBUG [main] org.springframework.beans.factory.support.DefaultListableBeanFactory - Ignoring constructor [public org.dbunit.dataset.xml.FlatXmlDataSet(java.io.Reader,boolean) throws java.io.IOException,org.dbunit.dataset.DataSetException] of bean 'data-set': could not satisfy dependencies. Detail: Error creating bean with name 'data-set' defined in class path resource [global-context.xml]: Unsatisfied dependency expressed through constructor argument with index 0 of type [java.io.Reader]: Did you specify the correct bean references as generic constructor arguments? 04 Nov 2004 22:14:56,953 DEBUG [main] org.springframework.beans.factory.support.DefaultListableBeanFactory - Ignoring constructor [public org.dbunit.dataset.xml.FlatXmlDataSet(java.io.Reader,java.io.Reader) throws java.io.IOException,org.dbunit.dataset.DataSetException] of bean 'data-set': could not satisfy dependencies. Detail: Error creating bean with name 'data-set' defined in class path resource [global-context.xml]: Unsatisfied dependency expressed through constructor argument with index 0 of type [java.io.Reader]: Did you specify the correct bean references as generic constructor arguments? 04 Nov 2004 22:14:56,953 DEBUG [main] org.springframework.beans.factory.support.DefaultListableBeanFactory - Ignoring constructor [public org.dbunit.dataset.xml.FlatXmlDataSet(java.io.Reader,org.dbunit.dataset.IDataSet) throws java.io.IOException,org.dbunit.dataset.DataSetException] of bean 'data-set': could not satisfy dependencies. Detail: Error creating bean with name 'data-set' defined in class path resource [global-context.xml]: Unsatisfied dependency expressed through constructor argument with index 0 of type [java.io.Reader]: Did you specify the correct bean references as generic constructor arguments? 04 Nov 2004 22:14:56,953 DEBUG [main] org.springframework.beans.factory.support.DefaultListableBeanFactory - Ignoring constructor [public org.dbunit.dataset.xml.FlatXmlDataSet(java.io.InputStream,boolean) throws java.io.IOException,org.dbunit.dataset.DataSetException] of bean 'data-set': could not satisfy dependencies. Detail: Failed to convert property value of type [org.springframework.util.MethodInvoker$VoidType] to required type [java.io.InputStream] 04 Nov 2004 22:14:56,953 DEBUG [main] org.springframework.beans.factory.support.DefaultListableBeanFactory - Ignoring constructor [public org.dbunit.dataset.xml.FlatXmlDataSet(java.io.InputStream,java.io.InputStream) throws java.io.IOException,org.dbunit.dataset.DataSetException] of bean 'data-set': could not satisfy dependencies. Detail: Failed to convert property value of type [org.springframework.util.MethodInvoker$VoidType] to required type [java.io.InputStream] 04 Nov 2004 22:14:56,953 DEBUG [main] org.springframework.beans.factory.support.DefaultListableBeanFactory - Ignoring constructor [public org.dbunit.dataset.xml.FlatXmlDataSet(java.io.InputStream,org.dbunit.dataset.IDataSet) throws java.io.IOException,org.dbunit.dataset.DataSetException] of bean 'data-set': could not satisfy dependencies. Detail: Failed to convert property value of type [org.springframework.util.MethodInvoker$VoidType] to required type [java.io.InputStream] 04 Nov 2004 22:14:56,953 DEBUG [main] org.springframework.beans.factory.support.DefaultListableBeanFactory - Ignoring constructor [public org.dbunit.dataset.xml.FlatXmlDataSet(org.xml.sax.InputSource) throws java.io.IOException,org.dbunit.dataset.DataSetException] of bean 'data-set': could not satisfy dependencies. Detail: Error creating bean with name 'data-set' defined in class path resource [global-context.xml]: 2 constructor arguments specified but no matching constructor found in bean 'data-set' (hint: specify index arguments for simple parameters to avoid type ambiguities) 04 Nov 2004 22:14:56,953 DEBUG [main] org.springframework.beans.factory.support.DefaultListableBeanFactory - Ignoring constructor [public org.dbunit.dataset.xml.FlatXmlDataSet(java.io.File) throws java.io.IOException,org.dbunit.dataset.DataSetException] of bean 'data-set': could not satisfy dependencies. Detail: Error creating bean with name 'data-set' defined in class path resource [global-context.xml]: 2 constructor arguments specified but no matching constructor found in bean 'data-set' (hint: specify index arguments for simple parameters to avoid type ambiguities) 04 Nov 2004 22:14:56,953 DEBUG [main] org.springframework.beans.factory.support.DefaultListableBeanFactory - Ignoring constructor [public org.dbunit.dataset.xml.FlatXmlDataSet(java.net.URL) throws java.io.IOException,org.dbunit.dataset.DataSetException] of bean 'data-set': could not satisfy dependencies. Detail: Error creating bean with name 'data-set' defined in class path resource [global-context.xml]: 2 constructor arguments specified but no matching constructor found in bean 'data-set' (hint: specify index arguments for simple parameters to avoid type ambiguities) 04 Nov 2004 22:14:56,953 DEBUG [main] org.springframework.beans.factory.support.DefaultListableBeanFactory - Ignoring constructor [public org.dbunit.dataset.xml.FlatXmlDataSet(java.io.Reader) throws java.io.IOException,org.dbunit.dataset.DataSetException] of bean 'data-set': could not satisfy dependencies. Detail: Error creating bean with name 'data-set' defined in class path resource [global-context.xml]: 2 constructor arguments specified but no matching constructor found in bean 'data-set' (hint: specify index arguments for simple parameters to avoid type ambiguities) 04 Nov 2004 22:14:56,953 DEBUG [main] org.springframework.beans.factory.support.DefaultListableBeanFactory - Ignoring constructor [public org.dbunit.dataset.xml.FlatXmlDataSet(java.io.InputStream) throws java.io.IOException,org.dbunit.dataset.DataSetException] of bean 'data-set': could not satisfy dependencies. Detail: Error creating bean with name 'data-set' defined in class path resource [global-context.xml]: 2 constructor arguments specified but no matching constructor found in bean 'data-set' (hint: specify index arguments for simple parameters to avoid type ambiguities)
I wonder what I'm missing here?
Thanks.


Reply With Quote