java - Accessing bean definition xml files from jar to main context file of war -


i have beans.xml file inside servics.jar @ meta-inf\spring location,servics.jar present inside web-inf\lib. trying access beans.xml in appcontext.xml using below import tag

<import resource="classpath*:meta-inf/spring/beans.xml" /> 

but after starting server getting "no bean named 'mybean' defined" error. here mybean defined in beans.xml. have set contextconfiglocation in web.xml below

 <context-param>         <param-name>contextconfiglocation</param-name>         <param-value>/web-inf/classes/appcontext.xml</param-value>     </context-param> 

as per error description bit confused whether beans.xml loaded or not. if loaded why giving "no bean defined error". can 1 explain how access bean definition file jar main appcontext.xml.

<import resource="classpath:/meta-inf/spring/beans.xml" />  

did work me.for difference between classpath* vs classpath please refer question spring classpath prefix difference


Comments