|
xiang目中使用xfirekai发的WebService,需yao在webService注入其它的service类处理业wu,也wei了项目配置文件地址统一,将xfire的xml文件yi植到WEB-INF下面,xiang目在tomcat及Jboss4.2.2中都能運行,但是移zhi到jboss5.0中就报異常。da家帮忙看看
xfire類信xi:
java code
@Component("webServiceForApplicationImpl")
public class WebServiceForApplicationImpl implements IWebServiceForApplication {
private Logger logger = Logger.getLogger(WebServiceForApplicationImpl.class);
@Autowired
@Qualifier("loginServiceImpl")
private ILoginService loginServiceImpl;
..
}
/WEB-INF/xfire-Servlet.xml
XML code <import resource="classpathrg/codehaus/xfire/spring/xfire.xml" />
<!-- 定义访問的url -->
<bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="urlMap">
<map>
<!-- 显shiWebService 访问路径,有几个路径jiuxu要 配置几ge路径。ref bean與下面的shi对ying的。-->
<entry key="/TamtoForApplication">
<ref bean="webServiceForApplication" />
</entry>
</map>
</property>
</bean>
<!-- 使用XFire导出器 -->
<bean id="baseWebService" class="org.codehaus.xfire.spring.remoting.XFireExporter" lazy-init="false" abstract="true">
<!-- yin用xfire.xml中ding义的工厂 -->
<property name="serviceFactory" ref="xfire.serviceFactory" />
<!-- 引yongxfire.xml中的xfire实例 -->
<property name="xfire" ref="xfire" />
</bean>
<!-- 服务請求的地址,与上Mian访問的url地址是對應De -->
<bean id="webServiceForApplication" parent="baseWebService">
<!-- 業务服务bean 定義的jie口的实現类 与springpeizhi文件中的是dui應的 -->
<property name="serviceBean" ref="webServiceForApplicationImpl" />
<!-- ye务服务bean的窄接kou类 定義De接口 ,实现类的jie口-->
<property name="serviceClass" value="com.tamto.webservice.IWebServiceForApplication" />
</bean>
web.xml
XML code
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring/applicationContext-import.xml,/WEB-INF/xfire-servlet.xml</param-value>
</context-param>
所报异常
Java code org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#0' defined in ServletContext resource [/WEB-INF/xfire-servlet.xml]: Cannot resolve reference to bean 'webServiceForApplication' while setting bean property 'urlMap' with key [TypedStringValue: value [/TamtoForApplication], target type [null]]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'webServiceForApplication' defined in ServletContext resource [/WEB-INF/xfire-servlet.xml]: Cannot resolve reference to bean 'webServiceForApplicationImpl' while setting bean property 'serviceBean'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'webServiceForApplicationImpl' is defined at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedMap(BeanDefinitionValueResolver.java:320) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:134) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean
|
|