在運行爲J單元測試情況下,我收到以下錯誤:java.lang.IllegalStateException:無法加載的ApplicationContext
java.lang.IllegalStateException: Failed to load ApplicationContext Caused by:
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean
named 'dataSource' is defined
我有定義數據源作爲"com.mchange.v2.c3p0.ComboPooledDataSource"
在.xml文件。
請問有什麼理由請幫忙。
請顯示您的測試類和您的xml配置。 – flash
您可能沒有在您的上下文中包含所有必需的xml文件。 –
@ [surendra](http://stackoverflow.com/users/977207/surendra)你可以[接受](http://meta.stackexchange.com/questions/16721/how-does-accept-rate-work)如果它解決了你的問題的答案。 – Jaguar