Tapan Upadhyay
Tapan Upadhyay

Reputation: 101

Spring - bean wiring

Can we wire the bean through jar file, I created Jar file of one of my module and put it into lib directory of WEB-INF folder this jar file contains Action, Bo, DM classes in respective folders, now i am trying to access the to map Action, BO and DM classes in Struts.xml and applicationContaxt.xml file but its giving me an error

Below is a code in Struts.xml file

<action name="abc" class="abcAction">
    <result name="success">/jsp/ABC/ABC.jsp</result>
</action> 

Below is a code in ApplicationContect.xml

<bean id="abcAction" class="main.java.com.iws.erik.abc.action.ABCAction"/>

I am doing wiring via

 <context:annotation-config/>
 <context:component-scan base-package="main.java.com.<projectName>"/> 

These classes exist in Jar file name ABC.jar but when i am trying to start the server is not able to access those action class and giving below error

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ABCAction': Injection of autowired dependencies failed;

can anybody help me how to map this action file (which is in Jar file) in struts.xml and applicationContext.xml.

Upvotes: 0

Views: 489

Answers (1)

ayengin
ayengin

Reputation: 1596

Are you sure package of class main.java.com.iws.erik.abc.action may be you confuse ide folder layout with package declaration.May be your package name com.iws.erik.abc.action

Upvotes: 2

Related Questions