首页 新闻 会员 周边 捐助

不显示删除回复 显示所有回复 显示星级回复 显示得分回复 只显示楼主 收藏 整合SSHorg.springframework.be

0
悬赏园豆:80 [待解决问题]

2013-04-06 23:49:57,734  INFO (org.springframework.web.context.ContextLoader:189) - Root WebApplicationContext: initialization started
2013-04-06 23:49:57,875  INFO (org.springframework.web.context.support.XmlWebApplicationContext:412) - Refreshing org.springframework.web.context.support.XmlWebApplicationContext@87400: display name [Root WebApplicationContext]; startup date [Sat Apr 06 23:49:57 CST 2013]; root of context hierarchy
2013-04-06 23:49:58,125  INFO (org.springframework.beans.factory.xml.XmlBeanDefinitionReader:323) - Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext.xml]
2013-04-06 23:49:59,203  INFO (org.springframework.web.context.support.XmlWebApplicationContext:427) - Bean factory for application context [org.springframework.web.context.support.XmlWebApplicationContext@87400]: org.springframework.beans.factory.support.DefaultListableBeanFactory@1553d18
2013-04-06 23:49:59,734  INFO (org.springframework.beans.factory.support.DefaultListableBeanFactory:414) - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1553d18: defining beans [sessionFactory,AdminDAO,VoteDAO,VoterDAO,VoteContextDAO,adminService,VoteService,VoterService,VoteContextService,transactionManager,transactionInterceptor,ProxyCreator,login,logout,createAdmin]; root of factory hierarchy
2013-04-06 23:49:59,890  INFO (org.hibernate.cfg.Environment:514) - Hibernate 3.2.5
2013-04-06 23:49:59,890  INFO (org.hibernate.cfg.Environment:547) - hibernate.properties not found
2013-04-06 23:49:59,890  INFO (org.hibernate.cfg.Environment:681) - Bytecode provider name : cglib
2013-04-06 23:49:59,921  INFO (org.hibernate.cfg.Environment:598) - using JDK 1.4 java.sql.Timestamp handling
2013-04-06 23:50:00,187  INFO (org.hibernate.cfg.Configuration:1441) - configuring from url: file:/C:/Tomcat/webapps/toupiao/WEB-INF/classes/hibernate.cfg.xml
2013-04-06 23:50:00,437  INFO (org.hibernate.cfg.Configuration:553) - Reading mappings from resource : model/Admin.hbm.xml
2013-04-06 23:50:00,703  INFO (org.hibernate.cfg.HbmBinder:300) - Mapping class: model.Admin -> admin
2013-04-06 23:50:00,765  INFO (org.hibernate.cfg.Configuration:553) - Reading mappings from resource : model/Vote.hbm.xml
2013-04-06 23:50:00,796  INFO (org.hibernate.cfg.HbmBinder:300) - Mapping class: model.Vote -> vote
2013-04-06 23:50:00,796  INFO (org.hibernate.cfg.Configuration:553) - Reading mappings from resource : model/Votecontext.hbm.xml
2013-04-06 23:50:00,812  INFO (org.hibernate.cfg.HbmBinder:300) - Mapping class: model.Votecontext -> votecontext
2013-04-06 23:50:00,812  INFO (org.hibernate.cfg.Configuration:553) - Reading mappings from resource : model/Voter.hbm.xml
2013-04-06 23:50:00,828  INFO (org.hibernate.cfg.HbmBinder:300) - Mapping class: model.Voter -> voter
2013-04-06 23:50:00,828  INFO (org.hibernate.cfg.Configuration:1541) - Configured SessionFactory: null
2013-04-06 23:50:00,828  INFO (org.springframework.orm.hibernate3.LocalSessionFactoryBean:738) - Building new Hibernate SessionFactory
2013-04-06 23:50:01,078  INFO (org.hibernate.connection.DriverManagerConnectionProvider:41) - Using Hibernate built-in connection pool (not for production use!)
2013-04-06 23:50:01,078  INFO (org.hibernate.connection.DriverManagerConnectionProvider:42) - Hibernate connection pool size: 20
2013-04-06 23:50:01,078  INFO (org.hibernate.connection.DriverManagerConnectionProvider:45) - autocommit mode: false
2013-04-06 23:50:01,093  INFO (org.hibernate.connection.DriverManagerConnectionProvider:80) - using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost/vote
2013-04-06 23:50:01,093  INFO (org.hibernate.connection.DriverManagerConnectionProvider:86) - connection properties: {user=root, password=****, release_mode=on_close}
2013-04-06 23:50:01,437  INFO (org.hibernate.cfg.SettingsFactory:89) - RDBMS: MySQL, version: 5.1.47-community
2013-04-06 23:50:01,437  INFO (org.hibernate.cfg.SettingsFactory:90) - JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-3.1.14 ( $Date: 2006-10-18 17:40:15 +0200 (Wed, 18 Oct 2006) $, $Revision: 5888 $ )
2013-04-06 23:50:01,531  INFO (org.hibernate.dialect.Dialect:152) - Using dialect: org.hibernate.dialect.MySQLDialect
2013-04-06 23:50:01,562  INFO (org.hibernate.transaction.TransactionFactoryFactory:31) - Using default transaction strategy (direct JDBC transactions)
2013-04-06 23:50:01,562  INFO (org.hibernate.transaction.TransactionManagerLookupFactory:33) - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
2013-04-06 23:50:01,562  INFO (org.hibernate.cfg.SettingsFactory:143) - Automatic flush during beforeCompletion(): disabled
2013-04-06 23:50:01,562  INFO (org.hibernate.cfg.SettingsFactory:147) - Automatic session close at end of transaction: disabled
2013-04-06 23:50:01,562  INFO (org.hibernate.cfg.SettingsFactory:154) - JDBC batch size: 15
2013-04-06 23:50:01,562  INFO (org.hibernate.cfg.SettingsFactory:157) - JDBC batch updates for versioned data: disabled
2013-04-06 23:50:01,562  INFO (org.hibernate.cfg.SettingsFactory:162) - Scrollable result sets: enabled
2013-04-06 23:50:01,562  INFO (org.hibernate.cfg.SettingsFactory:170) - JDBC3 getGeneratedKeys(): enabled
2013-04-06 23:50:01,562  INFO (org.hibernate.cfg.SettingsFactory:178) - Connection release mode: on_close
2013-04-06 23:50:01,562  INFO (org.hibernate.cfg.SettingsFactory:202) - Maximum outer join fetch depth: 2
2013-04-06 23:50:01,562  INFO (org.hibernate.cfg.SettingsFactory:205) - Default batch fetch size: 1
2013-04-06 23:50:01,562  INFO (org.hibernate.cfg.SettingsFactory:209) - Generate SQL with comments: disabled
2013-04-06 23:50:01,562  INFO (org.hibernate.cfg.SettingsFactory:213) - Order SQL updates by primary key: disabled
2013-04-06 23:50:01,562  INFO (org.hibernate.cfg.SettingsFactory:217) - Order SQL inserts for batching: disabled
2013-04-06 23:50:01,562  INFO (org.hibernate.cfg.SettingsFactory:386) - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
2013-04-06 23:50:01,578  INFO (org.hibernate.hql.ast.ASTQueryTranslatorFactory:24) - Using ASTQueryTranslatorFactory
2013-04-06 23:50:01,578  INFO (org.hibernate.cfg.SettingsFactory:225) - Query language substitutions: {}
2013-04-06 23:50:01,578  INFO (org.hibernate.cfg.SettingsFactory:230) - JPA-QL strict compliance: disabled
2013-04-06 23:50:01,578  INFO (org.hibernate.cfg.SettingsFactory:235) - Second-level cache: enabled
2013-04-06 23:50:01,593  INFO (org.hibernate.cfg.SettingsFactory:239) - Query cache: disabled
2013-04-06 23:50:01,593  INFO (org.hibernate.cfg.SettingsFactory:373) - Cache provider: org.hibernate.cache.NoCacheProvider
2013-04-06 23:50:01,593  INFO (org.hibernate.cfg.SettingsFactory:254) - Optimize cache for minimal puts: disabled
2013-04-06 23:50:01,593  INFO (org.hibernate.cfg.SettingsFactory:263) - Structured second-level cache entries: disabled
2013-04-06 23:50:01,609  INFO (org.hibernate.cfg.SettingsFactory:283) - Echoing all SQL to stdout
2013-04-06 23:50:01,625  INFO (org.hibernate.cfg.SettingsFactory:290) - Statistics: disabled
2013-04-06 23:50:01,625  INFO (org.hibernate.cfg.SettingsFactory:294) - Deleted entity synthetic identifier rollback: disabled
2013-04-06 23:50:01,625  INFO (org.hibernate.cfg.SettingsFactory:309) - Default entity-mode: pojo
2013-04-06 23:50:01,625  INFO (org.hibernate.cfg.SettingsFactory:313) - Named query checking : enabled
2013-04-06 23:50:01,734  INFO (org.hibernate.impl.SessionFactoryImpl:161) - building session factory
2013-04-06 23:50:02,796  INFO (org.hibernate.impl.SessionFactoryObjectFactory:82) - Not binding factory to JNDI, no JNDI name configured
2013-04-06 23:50:03,031  INFO (org.springframework.beans.factory.support.DefaultListableBeanFactory:396) - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1553d18: defining beans [sessionFactory,AdminDAO,VoteDAO,VoterDAO,VoteContextDAO,adminService,VoteService,VoterService,VoteContextService,transactionManager,transactionInterceptor,ProxyCreator,login,logout,createAdmin]; root of factory hierarchy
2013-04-06 23:50:03,031  INFO (org.springframework.orm.hibernate3.LocalSessionFactoryBean:184) - Closing Hibernate SessionFactory
2013-04-06 23:50:03,031  INFO (org.hibernate.impl.SessionFactoryImpl:769) - closing
2013-04-06 23:50:03,031  INFO (org.hibernate.connection.DriverManagerConnectionProvider:147) - cleaning up connection pool: jdbc:mysql://localhost/vote
2013-04-06 23:50:03,031 ERROR (org.springframework.web.context.ContextLoader:215) - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'adminService' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: sessionFactory or hibernateTemplate is required

<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">


<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="configLocation"
value="classpath:hibernate.cfg.xml">
</property>
</bean>
<!-- dao -->
<bean id="AdminDAO" class="dao.impl.AdminImpl">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>

<!-- service -->
<bean id="adminService" class="service.impl.AdminServiceImpl">
<property name="ad">
<ref bean="AdminDAO" />
</property>
</bean>
</beans>
网上查了大半天资料,答案诸如此类:由于Spring中的“asm-2.2.3.jar”和Hibernate中的“asm.jar”包冲突。解决办法是移除Spring2.0 AOP Libraries中的“asm-2.2.3.jar”即可;缺少JAR包commons-pool.jar  ejb3-persistence.jar;我都照做了,问题依旧,请高人帮我查查错误处在哪啊...

ssh
IT‘民工’的主页 IT‘民工’ | 初学一级 | 园豆:122
提问于:2013-04-07 12:33
< >
分享
所有回答(2)
0

hdbjfbfb那你发到你粉嫩粉嫩粉嫩

没权限 | 园豆:202 (菜鸟二级) | 2013-04-07 14:00

....

支持(0) 反对(0) IT‘民工’ | 园豆:122 (初学一级) | 2013-04-07 14:01
0
public final Configuration getConfiguration()
Return the Configuration object used to build the SessionFactory. Allows access to configuration metadata stored there (rarely needed).

 

Throws:
IllegalStateException - if the Configuration object has not been initialized yet
目测是你classpath:hibernate.cfg.xml配置的问题!
Beyond-bit | 园豆:2885 (老鸟四级) | 2013-04-07 14:25

应该没问题,hibernate.cfg.xml在SRC目录下,是我添加hibernate框架时自动生成的路径

支持(0) 反对(0) IT‘民工’ | 园豆:122 (初学一级) | 2013-04-07 14:39
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册