同一个项目,在windows和linux下用tomcat发布,windows下一切顺利无异常,但linux中tomcat显示如下错误:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name '/getSite' defined in ServletContext resource [/WEB-INF/classes/spring_action.xml]: Can't resolve reference to bean 'getsitebo' while setting property 'getsitebo'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'getsitebo' is defined我已查看[spring_action.xml],该文件存,求解?

解决方案 »

  1.   

    spring_action.xml 如下<?xml version="1.0" encoding="gbk"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
    <beans>
    <bean name="/track" class="com.****.struts.action.TrackAction">
    <property name="bo" ref="customerServicebo"></property>
    </bean>

    <!-- 上传图片 -->
    <bean name="/uploadImage" class="com.****.struts.action.UploadImageAction">
    </bean>

    <!-- 获取站点信息 -->
    <bean name="/getSite" class="com.****.struts.action.GetSiteAction">
    <property name="getsitebo" ref="getsitebo"></property>
    </bean>

    </beans>
      

  2.   

    <bean name="/getSite" class="com.****.struts.action.GetSiteAction"> 
    <property name="getsitebo" ref="getsitebo"> </property> 
    </bean> 
    这个ref="getsitebo"定义了没有啊?
    你关联这个bean就得先定义这个bean啊,比如
    <bean name="/getsitebo" class="com.****.struts.action.GetSiteBean"/> 
      

  3.   

    spring的bean是分多个文件了吧,看看这些spring的xml文件,在配置文件中的大小写都对吗?尤其是配置getsitebo的xml文件是否大小写正确,windows是大小写不敏感的,linux不行。如果大小写不对,linux找不到配置文件,自然无法初始化getsitebo