写了个小程序,用测试类测试时出现错误,如下:2013-4-29 20:54:05 org.springframework.context.support.AbstractApplicationContext prepareRefresh
信息: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@167d940: startup date [Mon Apr 29 20:54:05 CST 2013]; root of context hierarchy
2013-4-29 20:54:05 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
信息: Loading XML bean definitions from class path resource [beans.xml]
2013-4-29 20:54:06 org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
信息: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@177b3cd: defining beans [student,studao,stuservice,stuaction]; root of factory hierarchy
2013-4-29 20:54:06 org.springframework.beans.factory.support.DefaultSingletonBeanRegistry destroySingletons
信息: Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@177b3cd: defining beans [student,studao,stuservice,stuaction]; root of factory hierarchy
这是什么问题啊,初学spring ,求高手指点指点!

解决方案 »

  1.   

    我的XML代码如下:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans
    xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:p="http://www.springframework.org/schema/p"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
           <bean id="student" class="cn.com.spring.model.Student">
               <property name="stuname" value="abc"/>
               <property name="stusno" value="123456"/>
           </bean>
           <bean id="studao" class="cn.com.spring.dao.Studao"/>
           <bean id="stuservice" class="cn.com.spring.service.Stuservice" >      
                <property name="studao" ref="studao"></property>
           </bean>
           <bean id="stuaction" class="cn.com.spring.action.Stuaction" >      
             <property name="student" ref="student"></property>
            <property name="stuservice" ref="stuserice"></property> 
           </bean> 
    </beans>
    估计应该是这句<property name="stuservice" ref="stuserice"></property> 有问题。因为我把这句注释了,然后测试其他没有问题,加上就有问题了。不知道怎么回事啊,感觉没错嘛