问题:"session-factory" 的内容必须匹配 "(property*,mapping*,(class-cache|collection-cache)*,event*,listener*)"

出现这样的错误原因很多,我的问题是property写在mapping之后了,正确写法

<property name="cache.region.factory_class">org.hibernate.cache.EhCacheRegionFactory</property>  
    	
   		<!-- 把Student加入在cfg.xml中 -->
   		<mapping resource="com/po/Student.hbm.xml"/>
   		
   		<!-- 
    	配置哪些实体类的对象需要二级缓存  
        usage属性为缓存策略   -->
    	<class-cache usage="read-only" class="com.po.Student"/>

按照此顺序可行