我的网络项目工作正常,它包括: spring3 和 hibernate3 。在 eclipse重构的帮助下重命名 eclipse 中的某些字段后, tomcat 无法启动。它挂在下面的这些日志中:
......
......
......
2012-03-15 15:55:48,131 INFO [org.hibernate.connection.ConnectionProviderFactory] [newConnectionProvider] - <Initializing connection provider: org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider>
2012-03-15 15:55:53,763 INFO [org.hibernate.cfg.SettingsFactory] [buildSettings] - <RDBMS: MySQL, version: 5.0.77>
2012-03-15 15:55:53,778 INFO [org.hibernate.cfg.SettingsFactory] [buildSettings] - <JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.1.15 ( Revision: ${bzr.revision-id} )>
2012-03-15 15:55:53,825 INFO [org.hibernate.dialect.Dialect] [<init>] - <Using dialect: org.hibernate.dialect.MySQLDialect>
2012-03-15 15:55:53,825 INFO [org.hibernate.transaction.TransactionFactoryFactory] [buildTransactionFactory] - <Transaction strategy: org.springframework.orm.hibernate3.SpringTransactionFactory>
2012-03-15 15:55:53,841 INFO [org.hibernate.transaction.TransactionManagerLookupFactory] [getTransactionManagerLookup] - <No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)>
2012-03-15 15:55:53,841 INFO [org.hibernate.cfg.SettingsFactory] [buildSettings] - <Automatic flush during beforeCompletion(): disabled>
2012-03-15 15:55:53,841 INFO [org.hibernate.cfg.SettingsFactory] [buildSettings] - <Automatic session close at end of transaction: disabled>
2012-03-15 15:55:53,841 INFO [org.hibernate.cfg.SettingsFactory] [buildSettings] - <JDBC batch size: 15>
2012-03-15 15:55:53,841 INFO [org.hibernate.cfg.SettingsFactory] [buildSettings] - <JDBC batch updates for versioned data: disabled>
2012-03-15 15:55:53,856 INFO [org.hibernate.cfg.SettingsFactory] [buildSettings] - <Scrollable result sets: enabled>
2012-03-15 15:55:53,856 INFO [org.hibernate.cfg.SettingsFactory] [buildSettings] - <JDBC3 getGeneratedKeys(): enabled>
2012-03-15 15:55:53,856 INFO [org.hibernate.cfg.SettingsFactory] [buildSettings] - <Connection release mode: auto>
2012-03-15 15:55:53,856 INFO [org.hibernate.cfg.SettingsFactory] [buildSettings] - <Maximum outer join fetch depth: 2>
2012-03-15 15:55:53,872 INFO [org.hibernate.cfg.SettingsFactory] [buildSettings] - <Default batch fetch size: 1>
2012-03-15 15:55:53,872 INFO [org.hibernate.cfg.SettingsFactory] [buildSettings] - <Generate SQL with comments: disabled>
2012-03-15 15:55:53,872 INFO [org.hibernate.cfg.SettingsFactory] [buildSettings] - <Order SQL updates by primary key: disabled>
2012-03-15 15:55:53,872 INFO [org.hibernate.cfg.SettingsFactory] [buildSettings] - <Order SQL inserts for batching: disabled>
2012-03-15 15:55:53,872 INFO [org.hibernate.cfg.SettingsFactory] [createQueryTranslatorFactory] - <Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory>
2012-03-15 15:55:53,887 INFO [org.hibernate.hql.ast.ASTQueryTranslatorFactory] [<init>] - <Using ASTQueryTranslatorFactory>
2012-03-15 15:55:53,887 INFO [org.hibernate.cfg.SettingsFactory] [buildSettings] - <Query language substitutions: {}>
2012-03-15 15:55:53,887 INFO [org.hibernate.cfg.SettingsFactory] [buildSettings] - <JPA-QL strict compliance: disabled>
2012-03-15 15:55:53,887 INFO [org.hibernate.cfg.SettingsFactory] [buildSettings] - <Second-level cache: enabled>
2012-03-15 15:55:53,903 INFO [org.hibernate.cfg.SettingsFactory] [buildSettings] - <Query cache: disabled>
2012-03-15 15:55:53,903 INFO [org.hibernate.cfg.SettingsFactory] [createRegionFactory] - <Cache region factory : org.hibernate.cache.impl.NoCachingRegionFactory>
2012-03-15 15:55:53,903 INFO [org.hibernate.cfg.SettingsFactory] [buildSettings] - <Optimize cache for minimal puts: disabled>
2012-03-15 15:55:53,903 INFO [org.hibernate.cfg.SettingsFactory] [buildSettings] - <Structured second-level cache entries: disabled>
2012-03-15 15:55:53,919 INFO [org.hibernate.cfg.SettingsFactory] [buildSettings] - <Statistics: disabled>
2012-03-15 15:55:53,919 INFO [org.hibernate.cfg.SettingsFactory] [buildSettings] - <Deleted entity synthetic identifier rollback: disabled>
2012-03-15 15:55:53,919 INFO [org.hibernate.cfg.SettingsFactory] [buildSettings] - <Default entity-mode: pojo>
2012-03-15 15:55:53,919 INFO [org.hibernate.cfg.SettingsFactory] [buildSettings] - <Named query checking : enabled>
2012-03-15 15:55:54,090 INFO [org.hibernate.impl.SessionFactoryImpl] [<init>] - <building session factory>
2012-03-15 15:55:54,714 INFO [org.hibernate.impl.SessionFactoryObjectFactory] [addInstance] - <Not binding factory to JNDI, no JNDI name configured>
2012-03-15 15:55:54,933 INFO [org.springframework.orm.hibernate3.HibernateTransactionManager] [afterPropertiesSet] - <Using DataSource [org.apache.commons.dbcp.BasicDataSource@d99277] of Hibernate SessionFactory for HibernateTransactionManager>
在重构日志之前,如下所示:
2012-02-29 07:52:39,822 INFO [org.springframework.ws.soap.saaj.SaajSoapMessageFactory] [afterPropertiesSet] - <Creating SAAJ 1.3 MessageFactory with SOAP 1.1 Protocol>
2012-02-29 07:52:39,853 INFO [org.springframework.oxm.jaxb.Jaxb2Marshaller] [createJaxbContextFromContextPath] - <Creating JAXBContext with context path [aheeva.webService.oxm]>
2012-02-29 07:52:40,571 INFO [org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping] [registerHandler] - <Mapped URL path [
.......
.......
.......
奇怪的是没有任何错误! Spring有没有bug?为什么不告诉扫描或任何其他进程是否有问题,我无法得到它。 Eclipse中的所有东西看起来都很好,但是Tomcat挂了,这真是荒谬!
答案 0 :(得分:2)
要解决您的问题,请执行以下步骤:
如果上述步骤无法帮助您执行这些步骤:
答案 1 :(得分:2)
这是一个非常奇怪的问题,我不得不花费数小时来调试这个......你可以尝试一些步骤:
<强>更新强>
清理项目目录可以解决此问题。要么做CVS / SVN清理,要么手动删除所有类/构建文件。
更新2
我发现了另外一个问题。我有一个cron时间表
@Scheduled(cron = "0 0/1 * * * ?")
工作正常
@Scheduled(cron = "0 0/0 * * * ?")
失败!!!
答案 2 :(得分:1)
好的,如果你在eclipse中遇到这个问题,你需要使用eclipse IDE,这是无法逃脱的。 我建议你开始使用以下作为春季网络应用的初创公司:
答案 3 :(得分:0)
我解决了这个问题。好吧, Spring 需要 自动连接 字段与其类名称相同,并且 spring-config.xml 文件的bean'ids。因此,如果必须对这三个名称中的任何一个进行任何更改:
其他两个也必须更改,因此三个对象始终具有相同的名称。 这就是 Spring 的工作方式; - )