2013-03-21 20:11:07 [日志信息] Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@fbb7cb: display name [org.springframework.context.support.ClassPathXmlApplicationContext@fbb7cb]; startup date [Thu Mar 21 20:11:07 CST 2013]; root of context hierarchy
2013-03-21 20:11:07 [日志信息] Loading XML bean definitions from class path resource [applicationContext.xml]
2013-03-21 20:11:07 [日志信息] Bean factory for application context [org.springframework.context.support.ClassPathXmlApplicationContext@fbb7cb]: org.springframework.beans.factory.support.DefaultListableBeanFactory@1eec35
2013-03-21 20:11:07 [日志信息] Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1eec35: defining beans [dataSource,sessionFactory,transactionManager,org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator#0,dao,StudentService,studentManageAction]; root of factory hierarchy
2013-03-21 20:11:07 [日志信息] MLog clients using log4j logging.
2013-03-21 20:11:08 [日志信息] Initializing c3p0-0.9.1.2 [built 21-May-2007 15:04:56; debug? true; trace: 10]
2013-03-21 20:11:08 [日志信息] Hibernate 3.3.2.GA
2013-03-21 20:11:08 [日志信息] hibernate.properties not found
2013-03-21 20:11:08 [日志信息] Bytecode provider name : javassist
2013-03-21 20:11:08 [日志信息] using JDK 1.4 java.sql.Timestamp handling
2013-03-21 20:11:08 [日志信息] Mapping class: org.usc.beans.Student -> student
2013-03-21 20:11:08 [日志信息] Building new Hibernate SessionFactory
2013-03-21 20:11:08 [日志信息] Initializing connection provider: org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider
2013-03-21 20:11:09 [日志信息] Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> 2s06jg8t1330bygjiwi3u|2b323e, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.jdbc.Driver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 2s06jg8t1330bygjiwi3u|2b323e, idleConnectionTestPeriod -> 0, initialPoolSize -> 2, jdbcUrl -> jdbc:mysql://localhost:3306/stdata?useUnicode=true&characterEncoding=utf-8, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 20, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 20, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 2, numHelperThreads -> 3, numThreadsAwaitingCheckoutDefaultUser -> 0, preferredTestQuery -> null, properties -> {user=******, password=******}, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false ]
2013-03-21 20:11:09 [日志信息] RDBMS: MySQL, version: 5.5.17
2013-03-21 20:11:09 [日志信息] JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.1.7 ( Revision: ${svn.Revision} )
2013-03-21 20:11:09 [日志信息] Using dialect: org.hibernate.dialect.MySQLDialect
2013-03-21 20:11:09 [日志信息] Transaction strategy: org.springframework.orm.hibernate3.SpringTransactionFactory
2013-03-21 20:11:09 [日志信息] No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
2013-03-21 20:11:09 [日志信息] Automatic flush during beforeCompletion(): disabled
2013-03-21 20:11:09 [日志信息] Automatic session close at end of transaction: disabled
2013-03-21 20:11:09 [日志信息] JDBC batch size: 50
2013-03-21 20:11:09 [日志信息] JDBC batch updates for versioned data: disabled
2013-03-21 20:11:09 [日志信息] Scrollable result sets: enabled
2013-03-21 20:11:09 [日志信息] JDBC3 getGeneratedKeys(): enabled
2013-03-21 20:11:09 [日志信息] Connection release mode: auto
2013-03-21 20:11:09 [日志信息] Maximum outer join fetch depth: 2
2013-03-21 20:11:09 [日志信息] Default batch fetch size: 1
2013-03-21 20:11:09 [日志信息] Generate SQL with comments: disabled
2013-03-21 20:11:09 [日志信息] Order SQL updates by primary key: disabled
2013-03-21 20:11:09 [日志信息] Order SQL inserts for batching: disabled
2013-03-21 20:11:09 [日志信息] Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
2013-03-21 20:11:09 [日志信息] Using ASTQueryTranslatorFactory
2013-03-21 20:11:09 [日志信息] Query language substitutions: {}
2013-03-21 20:11:09 [日志信息] JPA-QL strict compliance: disabled
2013-03-21 20:11:09 [日志信息] Second-level cache: enabled
2013-03-21 20:11:09 [日志信息] Query cache: disabled
2013-03-21 20:11:09 [日志信息] Cache region factory : org.hibernate.cache.impl.NoCachingRegionFactory
2013-03-21 20:11:09 [日志信息] Optimize cache for minimal puts: disabled
2013-03-21 20:11:09 [日志信息] Structured second-level cache entries: disabled
2013-03-21 20:11:09 [日志信息] Statistics: disabled
2013-03-21 20:11:09 [日志信息] Deleted entity synthetic identifier rollback: disabled
2013-03-21 20:11:09 [日志信息] Default entity-mode: pojo
2013-03-21 20:11:09 [日志信息] Named query checking : enabled
2013-03-21 20:11:09 [日志信息] building session factory
2013-03-21 20:11:10 [日志信息] Not binding factory to JNDI, no JNDI name configured
2013-03-21 20:11:10 [日志信息] Using DataSource [com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> 2s06jg8t1330bygjiwi3u|2b323e, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.jdbc.Driver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 2s06jg8t1330bygjiwi3u|2b323e, idleConnectionTestPeriod -> 0, initialPoolSize -> 2, jdbcUrl -> jdbc:mysql://localhost:3306/stdata?useUnicode=true&characterEncoding=utf-8, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 20, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 20, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 2, numHelperThreads -> 3, numThreadsAwaitingCheckoutDefaultUser -> 0, preferredTestQuery -> null, properties -> {user=******, password=******}, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false ]] of Hibernate SessionFactory for HibernateTransactionManager
2013-03-21 20:11:10 [日志信息] Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1eec35: defining beans [dataSource,sessionFactory,transactionManager,org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator#0,dao,StudentService,studentManageAction]; root of factory hierarchy
2013-03-21 20:11:10 [日志信息] Closing Hibernate SessionFactory
2013-03-21 20:11:10 [日志信息] closing
8 个解决方案
#1
给的信息太少了,说实在的我不会看日志,一般我都是看控制台里的信息。
你看看你项目里的web.xml文件里有没有类似的话吧。
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>文件路径+applicationContext.xml</param-value>
</context-param>
<!-- Spring提供的过滤器-打开和关闭session -->
<filter>
<filter-name>openSessionInViewFilter</filter-name>
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
<init-param>
你看看你项目里的web.xml文件里有没有类似的话吧。
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>文件路径+applicationContext.xml</param-value>
</context-param>
<!-- Spring提供的过滤器-打开和关闭session -->
<filter>
<filter-name>openSessionInViewFilter</filter-name>
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
<init-param>
#2
信息不足。只有 output 日志, what's your input?
只能就事论事,就日志论日志
"hibernate.properties not found"
检查一下你的 hibernate.properties 在哪儿?
"Not binding factory to JNDI, no JNDI name"
这可能是由于 hibernate.properties 没找到。
#3
+1
#4
这日志也没说那个bean不能建立啊。。。。。。
#5
那个配置文件我已经整合到applicationContext.xml里了
#6
你应该把配置文件的代码发出来的
#7
applicationContext.xml文件代码
<!--配置文件导入 -->
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location">
<value>classpath:dataSource.properties</value>
</property>
</bean>
<!--数据源 -->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName" value="${mysql.database.driver}"></property>
<property name="url" value="${mysql.database.url}"></property>
<property name="username" value="${mysql.database.user}"></property>
<property name="password" value="${mysql.database.password}"></property>
<property name="maxActive" value="${mysql.database.maxActive}"></property>
<property name="maxIdle" value="${mysql.database.maxIdle}"></property>
<property name="maxWait" value="${mysql.database.maxWait}"></property>
</bean>
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</prop>
</props>
</property>
<property name="mappingResources">
<list>
<value>org/usc/beans/Student.hbm.xml</value>
</list>
</property>
</bean>
<bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate">
<constructor-arg>
<ref local="sessionFactory" />
</constructor-arg>
</bean>
<!-- 配置事务管理器 -->
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="StudentService" class="org.usc.services.student.impl.StudentServiceBean">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
<!--配置文件导入 -->
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location">
<value>classpath:dataSource.properties</value>
</property>
</bean>
<!--数据源 -->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName" value="${mysql.database.driver}"></property>
<property name="url" value="${mysql.database.url}"></property>
<property name="username" value="${mysql.database.user}"></property>
<property name="password" value="${mysql.database.password}"></property>
<property name="maxActive" value="${mysql.database.maxActive}"></property>
<property name="maxIdle" value="${mysql.database.maxIdle}"></property>
<property name="maxWait" value="${mysql.database.maxWait}"></property>
</bean>
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</prop>
</props>
</property>
<property name="mappingResources">
<list>
<value>org/usc/beans/Student.hbm.xml</value>
</list>
</property>
</bean>
<bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate">
<constructor-arg>
<ref local="sessionFactory" />
</constructor-arg>
</bean>
<!-- 配置事务管理器 -->
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="StudentService" class="org.usc.services.student.impl.StudentServiceBean">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
#8
这个是web.xml文件
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:applicationContext-*.xml</param-value>
</context-param>
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>/WEB-INF/classes/log4j.properties</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>
<filter>
<filter-name>Spring character encoding filter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>utf8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>Spring character encoding filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:applicationContext-*.xml</param-value>
</context-param>
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>/WEB-INF/classes/log4j.properties</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>
<filter>
<filter-name>Spring character encoding filter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>utf8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>Spring character encoding filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
#1
给的信息太少了,说实在的我不会看日志,一般我都是看控制台里的信息。
你看看你项目里的web.xml文件里有没有类似的话吧。
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>文件路径+applicationContext.xml</param-value>
</context-param>
<!-- Spring提供的过滤器-打开和关闭session -->
<filter>
<filter-name>openSessionInViewFilter</filter-name>
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
<init-param>
你看看你项目里的web.xml文件里有没有类似的话吧。
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>文件路径+applicationContext.xml</param-value>
</context-param>
<!-- Spring提供的过滤器-打开和关闭session -->
<filter>
<filter-name>openSessionInViewFilter</filter-name>
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
<init-param>
#2
信息不足。只有 output 日志, what's your input?
只能就事论事,就日志论日志
"hibernate.properties not found"
检查一下你的 hibernate.properties 在哪儿?
"Not binding factory to JNDI, no JNDI name"
这可能是由于 hibernate.properties 没找到。
#3
+1
#4
这日志也没说那个bean不能建立啊。。。。。。
#5
那个配置文件我已经整合到applicationContext.xml里了
#6
你应该把配置文件的代码发出来的
#7
applicationContext.xml文件代码
<!--配置文件导入 -->
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location">
<value>classpath:dataSource.properties</value>
</property>
</bean>
<!--数据源 -->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName" value="${mysql.database.driver}"></property>
<property name="url" value="${mysql.database.url}"></property>
<property name="username" value="${mysql.database.user}"></property>
<property name="password" value="${mysql.database.password}"></property>
<property name="maxActive" value="${mysql.database.maxActive}"></property>
<property name="maxIdle" value="${mysql.database.maxIdle}"></property>
<property name="maxWait" value="${mysql.database.maxWait}"></property>
</bean>
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</prop>
</props>
</property>
<property name="mappingResources">
<list>
<value>org/usc/beans/Student.hbm.xml</value>
</list>
</property>
</bean>
<bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate">
<constructor-arg>
<ref local="sessionFactory" />
</constructor-arg>
</bean>
<!-- 配置事务管理器 -->
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="StudentService" class="org.usc.services.student.impl.StudentServiceBean">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
<!--配置文件导入 -->
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location">
<value>classpath:dataSource.properties</value>
</property>
</bean>
<!--数据源 -->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName" value="${mysql.database.driver}"></property>
<property name="url" value="${mysql.database.url}"></property>
<property name="username" value="${mysql.database.user}"></property>
<property name="password" value="${mysql.database.password}"></property>
<property name="maxActive" value="${mysql.database.maxActive}"></property>
<property name="maxIdle" value="${mysql.database.maxIdle}"></property>
<property name="maxWait" value="${mysql.database.maxWait}"></property>
</bean>
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</prop>
</props>
</property>
<property name="mappingResources">
<list>
<value>org/usc/beans/Student.hbm.xml</value>
</list>
</property>
</bean>
<bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate">
<constructor-arg>
<ref local="sessionFactory" />
</constructor-arg>
</bean>
<!-- 配置事务管理器 -->
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="StudentService" class="org.usc.services.student.impl.StudentServiceBean">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
#8
这个是web.xml文件
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:applicationContext-*.xml</param-value>
</context-param>
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>/WEB-INF/classes/log4j.properties</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>
<filter>
<filter-name>Spring character encoding filter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>utf8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>Spring character encoding filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:applicationContext-*.xml</param-value>
</context-param>
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>/WEB-INF/classes/log4j.properties</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>
<filter>
<filter-name>Spring character encoding filter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>utf8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>Spring character encoding filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>