ITeye博客

xFire + Spring 实现客户端访问启动无法延时加载问题

fantasyeye · 2013-03-28 09:46 · webService · 编程语言 · Markdown

使用 xfire 配置 Webservice 客户端,会由于访问端无法访问,而造成 Spring 项目启动失败。需要在 Spring 配置中,设置该客户端为启动时不加载。

设置改类属性 lookupServiceOnStartup 为 false

 

<bean id="类编号" class="org.codehaus.xfire.spring.remoting.XFireClientFactoryBean">  
  <property name="serviceClass" value="类接口"/>   
  <property name="wsdlDocumentUrl" value="http://xxx/xxx?wsdl"/> 
  <property name="lookupServiceOnStartup"> <!-- 设置启动不加载 -->
   <value>false</value>  
  </property>  
 </bean> 

注:

一般此处配置 Spring 的 lazy-init="true" 不管用是,可以采用上面的方法。

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。