在服务器中部署 Spring 应用程序时 Tomcat 崩溃:“信息:初始化 Spring 根 WebApplicationContext”
我正在尝试在具有 tomcat 6.0.29 服务器的服务器计算机中部署我的 spring 应用程序。但是tomcat服务器在提取战争时自动停止。
在 Catalina Log 中,我有以下内容:
Jan 27, 2012 3:02:44 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive application.war
在 localhost.log 中,
Jan 27, 2012 3:03:21 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
没有任何堆栈跟踪。
我尝试重新启动 tomcat,但服务器在提取 war 文件时停止。我尝试将 JVM 内存增加到 1024MB。还是同样的问题。
我在另一个测试服务器上部署了同样的战争,并且运行良好。
任何帮助...
I am trying to deploy my spring application in a server machine which having the tomcat 6.0.29 server. But tomcat server getting stop automatically while extracting the war.
In Catalina Log I have the following:
Jan 27, 2012 3:02:44 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive application.war
In localhost.log
Jan 27, 2012 3:03:21 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
There is no any stacktrace.
I tried to restart the tomcat but server getting stop while extracting the war file. I tried by increasing the JVM memory to 1024MB. Still same problem.
I have deployed the same war in my another testing server and it is working fine.
Any help...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您是否看到类似“严重:错误监听器启动”的内容?或者日志中没有。
如果 Tomcat 失败,启动目录中应该有线程转储和/或堆转储。
另请检查操作系统/防火墙中可用于绑定的端口。
启用调试日志记录可能会有所帮助。 (将下面的日志文件中的日志级别更改为 DEBUG 而不是 INFO)
启用 Tomcat 调试日志:
参考:如何在Tomcat中将级别日志记录设置为DEBUG 6?
启用Spring调试日志:
您可以通过在您的文件中添加
logging.properties
(名称应该完全匹配)来启用Spring调试日志记录模式(为什么它无法部署Web应用程序) WEB-INF/classes 目录请参阅:严重:监听器启动时出错
Are you seeing something like this "SEVERE: Error listenerStart"? or none in the logs.
If Tomcat fails there should be a thread dump and/or a heap dump in the startup directory.
Also check the ports available from OS/firewall to bind with.
Enabling debug logging might help. (Change the log levels to DEBUG instead of INFO in the log files below)
Enabling Tomcat debug log:
Refer to : How to set level logging to DEBUG in Tomcat 6?
Enabling Spring debug log:
You can enable spring debug logging mode (why its failing to deploy the webapp) by adding the
logging.properties
(name should match exactly) in your WEB-INF/classes directoryRefer to : SEVERE: Error listenerStart
你如何启动 Tomcat?这是什么操作系统?我自己过去在 CentOS 上使用启动脚本启动 Tomcat 时也遇到过这个问题。通常与文件和/或 selinux 的安全设置有关,阻止写入/读取磁盘上的某些文件空间。
尝试使用 ./catalina.sh run 从控制台运行,看看它是否在服务器上运行(假设它是 *nix 服务器)。如果是这样,请检查所有文件的所有权和读/写权限。暂时禁用 selinux(如果当前已启用)以查看是否有任何区别。
当您没有任何进一步的调试信息可用时,这是一系列的试验和错误。
How are you launching Tomcat? What OS is this? I have encountered this problem myself in the past when launching Tomcat on CentOS using a startup script. Usually had something to do with security settings of the files and/or of selinux preventing the writing/reading of certain filespaces on the disk.
Try running from the console using ./catalina.sh run and see if that works on the server (assuming it is a *nix server). If so, check ownership of all files and read/write permissions. Disable selinux (if currently enabled) momentarily to see if that makes any difference.
It's a bunch of trial and error when you don't have any further debug information available.
上次我遇到这个问题是因为我认为我正在使用 h2database,而配置是使用 mysql,当然没有可连接的 mysql 服务器。
后,我的所有更改才生效
我在 Eclipse 中使用了 Maven 项目,直到我执行了Project Properties-> 。 Maven->更新项目,然后在
服务器选项卡中右键单击服务器名称并发布。
检查 webapp 中的 jdbc.properties 文件(在我的例子中,它位于 /.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/ 文件夹中的某个位置)而不是在源代码中,以查看最终的结果数据库连接参数。
Last time I faced this problem it was due to the fact I was thinking that I am using h2database while the configurations were such that it was using mysql and of course there was no mysql server to connect to.
I was using a maven project in eclipse and none of my changes were taking effect until I did
Project Properties-> Maven-> Update Project and then in
Servers Tab right click on the server name and Publish.
Check the jdbc.properties file in the webapp (in my case it was somewhere inside /.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/ folder) not in source code to see what are the final parameters for database connection.