1

i have beans.xml file inside servics.jar at META-INF\Spring location,servics.jar present inside WEB-INF\lib. now i am trying to access that beans.xml in my appcontext.xml using below import tag

<import resource="classpath*:META-INF/spring/beans.xml" />

but after starting server i am getting "No bean named 'mybean' is defined" error. here mybean is defined in beans.xml. i have set contextConfigLocation in web.xml as below

 <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/classes/appContext.xml</param-value>
    </context-param>

as per error description i am bit confused whether beans.xml get loaded or not. if loaded why it giving "No bean defined error". can some one explain how to access bean definition file from jar to main appContext.xml.

sandy
  • 97
  • 2
  • 14

1 Answers1

0
<import resource="classpath:/META-INF/spring/beans.xml" /> 

did the work for me.For difference between classpath* vs classpath please refer question Spring classpath prefix difference

Community
  • 1
  • 1
sandy
  • 97
  • 2
  • 14