注入baseDAO失败,如图xfire springwebservicexfire 注入

解决方案 »

  1.   


    @Transactional
    public class OhShitWebServiceImpl extends OhShitBaseServiceImpl implements OhShitWebService {
    @Resource
    private UserDAO userDAO;
    @Resource
    InitService initService;
    @Resource
    private SessionFactory sessionFactory;
    @Resource
    ServletContext servletContext;
    @Resource
    LoginService loginService;
    配置:
    <bean id="OhShitWebServiceImpl" class="org.ohshit.common.xfire.webserviceimpl.OhShitWebServiceImpl" />
       <bean id="getDbWS" class="org.codehaus.xfire.spring.ServiceBean">
         <property name="serviceBean" ref="OhShitWebServiceImpl" />
         <property name="serviceClass" value="org.ohshit.common.xfire.webservice.OhShitWebService" />
         <property name="inHandlers">
             <list>
               <ref bean="addressingHandler" />
             </list>
         </property>
       </bean>            
      <bean id="addressingHandler" class="org.codehaus.xfire.addressing.AddressingInHandler" />
     <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath:applicationContext.xml,classpath:org/codehaus/xfire/spring/xfire.xml</param-value>
     </context-param>
     <listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
     </listener>