Announcement Announcement Module
Collapse
No announcement yet.
Apache CXF @Autowire problem Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Apache CXF @Autowire problem

    I am having some problem with @Autowire annotation. I am using apache cxf for the web service publisher. The problem is that when I try to autowire a bean to my service implementation, i get this exception:

    org.springframework.beans.factory.NoSuchBeanDefini tionException

    The surprising thing is that the bean that I want to autowire to my web service, but failed .... is easily getting autowired to other dependent beans. My configurations are as follows.


    SEI
    Code:
    @WebService
    public interface KYCONE_WS_SEI {
    	public String validateDocuments(String documents);
    
    }
    IMPL
    Code:
    @WebService(endpointInterface="com.tcs.sbi.kycone.ws.KYCONE_WS_SEI")
    public class KYCONE_WS  implements KYCONE_WS_SEI  {
    	Logger logger = Logger.getLogger(KYCONE_WS.class);
    
    @Autowired
    	private WSIntegrationService wsIntegrationService;
    
    @Override
    	@WebMethod
    	public String validateDocuments(String documents) {
    		logger.info("Incoming request for document validation : "+documents);
    
                    wsIntegrationService.doSomething();
    		
    		if(documents==null || documents.equals("")) return "MESSAGE NOT ACCEPTED. AS THE MESSAGE PROVIDED   IS = "+documents;
    		
    		
    		return "INVALID";
    	}
    
    }
    spring-ws.xml
    Code:
    <context:component-scan base-package="com.tcs.sbi.kycone.ws">
    	<context:include-filter type="annotation" expression="javax.jws.WebService" />
    	</context:component-scan>
    
    	<import resource="classpath:META-INF/cxf/cxf.xml" />
    	<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
    	<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
    	
    	<bean id="kyconeWebService" class="com.tcs.sbi.kycone.ws.KYCONE_WS"/>
    
    	<jaxws:endpoint id="kyconeWebServiceEndpoint"
    	implementor="#kyconeWebService"  
    	address="/KYCONE" 
    	implementorClass="com.tcs.sbi.kycone.ws.KYCONE_WS" 
    	/>
    Please tell me where am I doing the error...

  • #2
    How did you resolve this issue?

    Thank you.

    Comment

    Working...
    X