xfire1.2.6不能访问互联网环境下的问题及解决方案
前几天用xfire开发了个接口,本来在工程可以访问互联网的情况下没有任何问题的,但昨天部署到客户的内网环境就出问题了,异常如下:
javax.faces.FacesException: java.net.UnknownHostException: www.springframework.org
找不到主机www.springframework.org,因为不能访问互联网
找到问题出处,在xfire的配置文件/WEB-INF/xfire-servlet.xml,该文件内容如下:
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"><beans><!-- 引入XFire预配置信息 --><import resource="classpath:org/codehaus/xfire/spring/xfire.xml" /><!-- 定义访问的url --><bean/></entry></map></property></bean><!-- 使用XFire导出器 --><bean id="baseWebService"abstract="true"><!-- 引用xfire.xml中定义的工厂 --><property name="serviceFactory" ref="xfire.serviceFactory" /><!-- 引用xfire.xml中的xfire实例 --><property name="xfire" ref="xfire" /></bean><bean id="WSPersonsInfoService" parent="baseWebService"><!-- 业务服务bean --><property name="serviceBean" ref="WSPersonsInfoImp" /><!-- 业务服务bean的窄接口类 --><property name="serviceClass"value="com.ws.yxjsry.IWSPersonsInfo" /></bean><bean id="WSPersonsInfoImp"/></beans>
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE beans SYSTEM "spring-beans.dtd"><!-- 引入XFire预配置信息 --><bean id="xfire.customEditorConfigurer"/></bean></entry></map></property></bean><bean id="xfire.serviceRegistry"/><bean id="xfire.transportManager"init-method="initialize" destroy-method="dispose"></bean><bean id="xfire" /></constructor-arg><constructor-arg index="1"><ref bean="xfire.transportManager" /></constructor-arg></bean><bean id="xfire.typeMappingRegistry"scope="singleton"></bean><bean id="xfire.aegisBindingProvider"/></constructor-arg></bean><bean id="xfire.serviceFactory"/></constructor-arg><constructor-arg index="1"><ref bean="xfire.aegisBindingProvider" /></constructor-arg></bean><bean id="xfire.servletController"/></constructor-arg></bean><bean id="xfire.messageServiceFactory"ref="xfire.transportManager" /><constructor-arg index="1" ref="xfire.messageBindingProvider" /><property name="style" value="message" /></bean><bean id="xfire.messageBindingProvider"/><!-- 定义访问的url --><bean/></entry></map></property></bean><!-- 使用XFire导出器 --><bean id="baseWebService"abstract="true"><!-- 引用xfire.xml中定义的工厂 --><property name="serviceFactory" ref="xfire.serviceFactory" /><!-- 引用xfire.xml中的xfire实例 --><property name="xfire" ref="xfire" /></bean><bean id="WSPersonsInfoService" parent="baseWebService"><!-- 业务服务bean --><property name="serviceBean" ref="WSPersonsInfoImp" /><!-- 业务服务bean的窄接口类 --><property name="serviceClass"value="com.ws.yxjsry.IWSPersonsInfo" /></bean><bean id="WSPersonsInfoImp"/></beans>
<beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
<beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">