提交表单的时候没有执行相应操作,而是返回原来的页面,出现以下信息:
[org.springframework.context.support.FileSystemXmlApplicationContext]-[INFO] Refreshing org.[email protected]fb2ac4: display name [org.[email protected]fb2ac4]; startup date [Wed Oct 28 18:40:35 CST 2009]; root of context hierarchy
2009-10-28 18:40:35,390 [org.springframework.beans.factory.xml.XmlBeanDefinitionReader]-[INFO] Loading XML bean definitions from file [E:\workspace\.metadata\.plugins\com.genuitec.eclipse.easie.tomcat.myeclipse\tomcat\webapps\shop\WEB-INF\applicationContext.xml]
2009-10-28 18:40:35,906 [org.springframework.context.support.FileSystemXmlApplicationContext]-[INFO] Bean factory for application context [org.[email protected]fb2ac4]: org.s[email protected]b9459c
2009-10-28 18:40:35,921 [org.springframework.context.support.FileSystemXmlApplicationContext]-[INFO] Bean 'org.springframework.aop.config.internalAutoProxyCreator' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2009-10-28 18:40:35,937 [org.springframework.beans.factory.support.DefaultListableBeanFactory]-[INFO] Pre-instantiating singletons in org.s[email protected]b9459c: defining beans [dataSource,sessionFactory,txmanager,txAdvice,org.springframework.aop.config.internalAutoProxyCreator,Service,org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor,userdao,userserivce,productdao,productserivce,orderdao,orderserivce,orderitemdao,orderitemserivce,salesrecorddao,myshopdao,myshopserivce,logbean]; root of factory hierarchy
2009-10-28 18:40:36,359 [org.hibernate.cfg.HbmBinder]-[INFO] Mapping class: com.shop.bean.Comments -> comments
2009-10-28 18:40:36,453 [org.hibernate.cfg.HbmBinder]-[INFO] Mapping class: com.shop.bean.Orderitem -> orderitem
2009-10-28 18:40:36,546 [org.hibernate.cfg.HbmBinder]-[INFO] Mapping class: com.shop.bean.Product -> product
2009-10-28 18:40:36,640 [org.hibernate.cfg.HbmBinder]-[INFO] Mapping class: com.shop.bean.User -> user
2009-10-28 18:40:36,703 [org.hibernate.cfg.HbmBinder]-[INFO] Mapping class: com.shop.bean.Orders -> orders
2009-10-28 18:40:36,765 [org.hibernate.cfg.HbmBinder]-[INFO] Mapping class: com.shop.bean.Myshop -> myshop
2009-10-28 18:40:36,765 [org.springframework.orm.hibernate3.LocalSessionFactoryBean]-[INFO] Building new Hibernate SessionFactory
2009-10-28 18:40:36,781 [org.hibernate.connection.ConnectionProviderFactory]-[INFO] Initializing connection provider: org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider
2009-10-28 18:40:37,203 [org.hibernate.cfg.SettingsFactory]-[INFO] RDBMS: MySQL, version: 5.0.85-community-nt
2009-10-28 18:40:37,203 [org.hibernate.cfg.SettingsFactory]-[INFO] JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.1.7 ( Revision: ${svn.Revision} )
2009-10-28 18:40:37,203 [org.hibernate.dialect.Dialect]-[INFO] Using dialect: org.hibernate.dialect.MySQLDialect
2009-10-28 18:40:37,218 [org.hibernate.transaction.TransactionFactoryFactory]-[INFO] Using default transaction strategy (direct JDBC transactions)
2009-10-28 18:40:37,218 [org.hibernate.transaction.TransactionManagerLookupFactory]-[INFO] No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
2009-10-28 18:40:37,218 [org.hibernate.cfg.SettingsFactory]-[INFO] Automatic flush during beforeCompletion(): disabled
2009-10-28 18:40:37,218 [org.hibernate.cfg.SettingsFactory]-[INFO] Automatic session close at end of transaction: disabled
2009-10-28 18:40:37,218 [org.hibernate.cfg.SettingsFactory]-[INFO] JDBC batch size: 15
2009-10-28 18:40:37,218 [org.hibernate.cfg.SettingsFactory]-[INFO] JDBC batch updates for versioned data: disabled
2009-10-28 18:40:37,218 [org.hibernate.cfg.SettingsFactory]-[INFO] Scrollable result sets: enabled
2009-10-28 18:40:37,218 [org.hibernate.cfg.SettingsFactory]-[INFO] JDBC3 getGeneratedKeys(): enabled
2009-10-28 18:40:37,218 [org.hibernate.cfg.SettingsFactory]-[INFO] Connection release mode: on_close
2009-10-28 18:40:37,218 [org.hibernate.cfg.SettingsFactory]-[INFO] Maximum outer join fetch depth: 2
2009-10-28 18:40:37,218 [org.hibernate.cfg.SettingsFactory]-[INFO] Default batch fetch size: 1
2009-10-28 18:40:37,218 [org.hibernate.cfg.SettingsFactory]-[INFO] Generate SQL with comments: disabled
2009-10-28 18:40:37,234 [org.hibernate.cfg.SettingsFactory]-[INFO] Order SQL updates by primary key: disabled
2009-10-28 18:40:37,234 [org.hibernate.cfg.SettingsFactory]-[INFO] Order SQL inserts for batching: disabled
2009-10-28 18:40:37,234 [org.hibernate.cfg.SettingsFactory]-[INFO] Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
2009-10-28 18:40:37,234 [org.hibernate.hql.ast.ASTQueryTranslatorFactory]-[INFO] Using ASTQueryTranslatorFactory
2009-10-28 18:40:37,234 [org.hibernate.cfg.SettingsFactory]-[INFO] Query language substitutions: {}
2009-10-28 18:40:37,234 [org.hibernate.cfg.SettingsFactory]-[INFO] JPA-QL strict compliance: disabled
2009-10-28 18:40:37,234 [org.hibernate.cfg.SettingsFactory]-[INFO] Second-level cache: enabled
2009-10-28 18:40:37,234 [org.hibernate.cfg.SettingsFactory]-[INFO] Query cache: enabled
2009-10-28 18:40:37,234 [org.hibernate.cfg.SettingsFactory]-[INFO] Cache provider: org.hibernate.cache.EhCacheProvider
2009-10-28 18:40:37,234 [org.hibernate.cfg.SettingsFactory]-[INFO] Optimize cache for minimal puts: disabled
2009-10-28 18:40:37,250 [org.hibernate.cfg.SettingsFactory]-[INFO] Structured second-level cache entries: disabled
2009-10-28 18:40:37,250 [org.hibernate.cfg.SettingsFactory]-[INFO] Query cache factory: org.hibernate.cache.StandardQueryCacheFactory
2009-10-28 18:40:37,250 [org.hibernate.cfg.SettingsFactory]-[INFO] Echoing all SQL to stdout
2009-10-28 18:40:37,250 [org.hibernate.cfg.SettingsFactory]-[INFO] Statistics: disabled
2009-10-28 18:40:37,250 [org.hibernate.cfg.SettingsFactory]-[INFO] Deleted entity synthetic identifier rollback: disabled
2009-10-28 18:40:37,281 [org.hibernate.cfg.SettingsFactory]-[INFO] Default entity-mode: pojo
2009-10-28 18:40:37,281 [org.hibernate.cfg.SettingsFactory]-[INFO] Named query checking : enabled
2009-10-28 18:40:37,453 [org.hibernate.impl.SessionFactoryImpl]-[INFO] building session factory
2009-10-28 18:40:37,453 [net.sf.ehcache.config.ConfigurationFactory]-[WARN] No configuration found. Configuring ehcache from ehcache-failsafe.xml  found in the classpath: jar:file:/E:/workspace/.metadata/.plugins/com.genuitec.eclipse.easie.tomcat.myeclipse/tomcat/webapps/shop/WEB-INF/lib/ehcache-1.2.3.jar!/ehcache-failsafe.xml
2009-10-28 18:40:37,484 [net.sf.ehcache.CacheManager]-[WARN] Creating a new instance of CacheManager using the diskStorePath "E:\workspace\.metadata\.plugins\com.genuitec.eclipse.easie.tomcat.myeclipse\tomcat\temp" which is already used by an existing CacheManager.
The source of the configuration was classpath.
The diskStore path for this CacheManager will be set to E:\workspace\.metadata\.plugins\com.genuitec.eclipse.easie.tomcat.myeclipse\tomcat\temp\ehcache_auto_created_1256726437484.
To avoid this warning consider using the CacheManager factory methods to create a singleton CacheManager or specifying a separate ehcache configuration (ehcache.xml) for each CacheManager instance.
2009-10-28 18:40:37,718 [org.hibernate.impl.SessionFactoryObjectFactory]-[INFO] Not binding factory to JNDI, no JNDI name configured
2009-10-28 18:40:37,718 [org.hibernate.cache.UpdateTimestampsCache]-[INFO] starting update timestamps cache at region: org.hibernate.cache.UpdateTimestampsCache
2009-10-28 18:40:37,718 [org.hibernate.cache.EhCacheProvider]-[WARN] Could not find configuration [org.hibernate.cache.UpdateTimestampsCache]; using defaults.
2009-10-28 18:40:37,750 [org.hibernate.cache.StandardQueryCache]-[INFO] starting query cache at region: org.hibernate.cache.StandardQueryCache
2009-10-28 18:40:37,750 [org.hibernate.cache.EhCacheProvider]-[WARN] Could not find configuration [org.hibernate.cache.StandardQueryCache]; using defaults.
2009-10-28 18:40:38,296 [org.springframework.orm.hibernate3.HibernateTransactionManager]-[INFO] Using DataSource [[email protected]] of Hibernate SessionFactory for HibernateTransactionManager望高手解救!

解决方案 »

  1.   

    楼主你的问题好像是hibernate的工厂问题,也就是说很可能是你的hql的问题,或者创建工厂的时候
      

  2.   

    错误是由于你的类路径里有ehcache-0.9.jar这个文件(这个是hibernate用的二级cache的实现,hibernate支持多种二级cache的实现,包括ehcache等),但是你又没有通过配置二级cache。应该把这个文件删除就可以了。
    http://www.cjsdn.net/post/print?bid=2&id=126575http://hi.baidu.com/zhangkun_012/blog/item/e98c6f170a592658f2de3222.html
      

  3.   

    Not binding factory to JNDI, no JNDI name configured 
    没有设置JNDI?
      

  4.   

    问题自己解决了,原因是出现类型转换错误,就是classcast什么的,没有把异常贴出来的原因是因为在代码里确实没有什么类型转换错误,这里涉及到spring getBean的问题,getBean返回的类必须用接口代理,不然就会出现classcast异常,谢谢各位!