【问题标题】:Unable to Start Tomcat 7.0 in Eclipse Luna无法在 Eclipse Luna 中启动 Tomcat 7.0
【发布时间】:2014-11-20 23:23:01
【问题描述】:

我必须开始处理我安装了 Eclipse Luna 和 Tomcat 7.0 的网络应用程序项目。该环境也有 JRE 8。但是每当我启动服务器时,它就会超时!

在控制台中我得到:

nov. 20, 2014 11:08:20 PM org.apache.catalina.core.AprLifecycleListener init
INFOS: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre8\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Android;C:\Program Files\Java\jre8\bin;C:\Program Files\Java\jdk1.8.0\bin;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files (x86)\Windows Kits\8.0\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\ooc\bin;C:\JacORB1_4\bin;;.
nov. 20, 2014 11:08:21 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
AVERTISSEMENT: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:GestionDesFormationsWebAppMavenized' did not find a matching property.
nov. 20, 2014 11:08:21 PM org.apache.coyote.AbstractProtocol init
INFOS: Initializing ProtocolHandler ["http-bio-8080"]
nov. 20, 2014 11:08:21 PM org.apache.coyote.AbstractProtocol init
INFOS: Initializing ProtocolHandler ["ajp-bio-8009"]
nov. 20, 2014 11:08:21 PM org.apache.catalina.startup.Catalina load
INFOS: Initialization processed in 567 ms
nov. 20, 2014 11:08:21 PM org.apache.catalina.core.StandardService startInternal
INFOS: Démarrage du service Catalina
nov. 20, 2014 11:08:21 PM org.apache.catalina.core.StandardEngine startInternal
INFOS: Starting Servlet Engine: Apache Tomcat/7.0.56
nov. 20, 2014 11:08:22 PM org.apache.catalina.core.ApplicationContext log
INFOS: Set web app root system property: 'webapp.root' = [C:\Users\Meriem\workspaceJEE\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\GestionDesFormationsWebAppMavenized\]
nov. 20, 2014 11:08:22 PM org.apache.catalina.core.ApplicationContext log
INFOS: Initializing log4j from [classpath:log4j.xml]
nov. 20, 2014 11:08:22 PM org.apache.catalina.core.ApplicationContext log
INFOS: Initializing Spring FrameworkServlet 'spring'
INFO : org.springframework.web.servlet.DispatcherServlet - FrameworkServlet 'spring': initialization started
INFO : org.springframework.web.context.support.XmlWebApplicationContext - Refreshing WebApplicationContext for namespace 'spring-servlet': startup date [Thu Nov 20 23:08:22 WET 2014]; root of context hierarchy
INFO : org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from ServletContext resource [/WEB-INF/spring-servlet.xml]
INFO : org.springframework.context.annotation.ClassPathBeanDefinitionScanner - JSR-250 'javax.annotation.ManagedBean' found and supported for component scanning
INFO : org.springframework.beans.factory.config.PropertyPlaceholderConfigurer - Loading properties file from ServletContext resource [/WEB-INF/jdbc.properties]
INFO : org.springframework.beans.factory.support.DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@721bcc07: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,studentController,studentDaoImpl,studentServiceImpl,propertyConfigurer,dataSource,sessionFactory,viewResolver,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor,transactionManager]; root of factory hierarchy

我已经尝试过此论坛上其他问题中提出的解决方案,例如延长超时期限、更改端口号、卸载和重新安装 Tomcat、更改服务器的“发布”选项,但似乎没有任何效果。

任何帮助将不胜感激。

【问题讨论】:

    标签: mysql eclipse jakarta-ee timeout tomcat7


    【解决方案1】:

    超时意味着 Tomcat 没有进入您的应用程序已完成启动的阶段。否则,它将向 Eclipse 发出成功或失败的信号。由于最后一行是关于 Spring 初始化许多 bean,我的第一个想法是你有一些构造后初始化程序(@PostConstruct,InitializingBean.afterPropertiesSet)挂在无限循环或死锁上。

    检查您自己的 bean(studentController、studentDaoImpl、studentServiceImpl)是否有挂起的初始化程序。也许创建一些初始化程序(使用@PostConstruct,它更简单)并添加一些日志输出以确保您的 bean 实际被初始化。如果您可能不得不将超时设置为 20-30 分钟或更长时间,请获取您正在使用的版本的 Spring 源代码,并实际逐步执行 Spring 的初始化代码。看起来它甚至没有进入 sessionFactory(我假设它是用于 Hibernate)。

    【讨论】:

    • 谢谢你的回答,但我在另一台笔记本电脑上用相同版本的tomcat和eclipse测试了相同的代码,它可以工作。我不认为代码中的问题。
    猜你喜欢
    • 2015-06-02
    • 2012-03-31
    • 2014-11-25
    • 1970-01-01
    • 2014-12-05
    • 2012-08-21
    • 1970-01-01
    • 2015-07-12
    • 2014-07-10
    相关资源
    最近更新 更多