日期:2014-05-18  浏览次数:20912 次

急急急 考试中 这个sessionFactory总是为NULL
 <context:annotation-config/>
 <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
  <property name="driverClassName">
  <value>oracle.jdbc.driver.OracleDriver</value>
  </property>
  <property name="url">
  <value>jdbc:oracle:thin:@localhost:1521:orcl</value>
  </property>
  <property name="username">
  <value>scott</value>
  </property>
  <property name="password">
  <value>admin</value>
  </property>
 </bean>
 <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
  <property name="dataSource">
  <ref bean="dataSource"/>
  </property>
   <property name="hibernateProperties">
        <props>
      <prop key="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</prop>
      <prop key="hibernate.show_sql">true</prop>
        </props>
     </property>
     <property name="packagesToScan">
<value>com.entity</value>
</property>
 </bean>
SSH

------解决方案--------------------
楼主怎么取的SessionFactory呢?