所用的jar包已经引入,log4j.properties设置也没问题,可就是在控制台上不输出信息 spring
试了试发现,在applicationContext.xml文件中设置的hibernateProperties名称写完整,也就是加上hibernate的前缀,结果就OK了。 sql
正常的在hibernate中配置相关的属性时,前缀hibernate是能够省略的。 session
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource" ref="dataSource" /> <property name="mappingResources"> <list> <value>com/bjsxt/registration/model/User.hbm.xml</value> </list> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect"> org.hibernate.dialect.MySQLDialect </prop> <prop key="hibernate.current_session_context_class">thread</prop> <prop key="hibernate.cache.provider_class"> org.hibernate.cache.EhCacheProvider </prop> <prop key="hibernate.show_sql">true</prop> <prop key="hibernate.format_sql">true</prop> </props> </property> </bean>