将 grails 2.0.3 应用程序部署到 cloudfoundry 而不使用 cloudfoundry grails-plugin?

Posted

技术标签:

【中文标题】将 grails 2.0.3 应用程序部署到 cloudfoundry 而不使用 cloudfoundry grails-plugin?【英文标题】:Deploying grails 2.0.3 application to cloudfoundry without cloud foundry grails-plugin? 【发布时间】:2012-05-13 12:33:14 【问题描述】:

我能够使用 Cloud Foundry grails 插件和 cf-push 将我的 grails 2.0.3 应用程序部署到云端,一切正常。

现在我想使用 sts/eclipse cloud Foundry 扩展来使用 eclipse 进行部署(而不是使用 grails 命令 cf-push!)并在服务器视图中查看服务器实例等等。

我使用 eclipse 插件创建了一个新的 cloudfoundry 实例,它部署但中止并显示错误消息:

May 14, 2012 10:39:21 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-19036
May 14, 2012 10:39:21 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 377 ms
May 14, 2012 10:39:21 AM org.apache.catalina.realm.JAASRealm setContainer
INFO: Set JAAS app name Catalina
May 14, 2012 10:39:21 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
May 14, 2012 10:39:21 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.35
May 14, 2012 10:39:21 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory ROOT

Configuring Spring Security Core ...
... finished configuring Spring Security Core

May 14, 2012 10:39:32 AM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
May 14, 2012 10:39:32 AM org.apache.catalina.core.StandardContext start
SEVERE: Context [] startup failed due to previous errors
May 14, 2012 10:39:32 AM org.apache.catalina.loader.WebappClassLoader         clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named    [net.sf.ehcache.CacheManager@1edb587] but has failed to stop it. This is very likely to create   a memory leak.
May 14, 2012 10:39:32 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [projectBee.Requestmap.data] but has failed to stop it. This is very likely to create a memory leak.
May 14, 2012 10:39:32 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [projectBee.Role.data] but has failed to stop it. This is very likely to create a memory leak.
May 14, 2012 10:39:32 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [org.hibernate.cache.UpdateTimestampsCache.data] but has failed to stop it. This is very likely to create a memory leak.
May 14, 2012 10:39:32 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [org.hibernate.cache.StandardQueryCache.data] but has failed to stop it. This is very likely to create a memory leak.

Stopping Tomcat because the context stopped.

这里有人知道这个问题的解决方案吗?谢谢!

【问题讨论】:

【参考方案1】:

您需要查看包含堆栈跟踪和详细错误消息的真实日志文件。使用 vmc 命令行客户端或 STS。有一个 /logs 文件夹可能没有你想要的,但也有一个 /tomcat/logs 可能有。另请查看 stacktrace.log。

【讨论】:

感谢 Burt,我将完整的堆栈跟踪日志添加到我的第一篇文章中。我找不到错误... 也许它与我的引导程序有关,我在其中创建了一些角色和请求映射? 如果我使用 sts-cf-plugin 创建的 mysql 服务使用 cf-push 进行部署,它不起作用(同样的错误)。使用由 cf-grails-plugin 创建的 mysql-service 可以正常工作!那么可能是mysql/service的问题? 你需要从other日志中找到真正的stacktrace;这只是说“发生了不好的事情”。通常 localhost.2012-05-14.log 文件有有用的信息,也可以查看 stacktrace.log 我也有这个问题。我实在想不通。无论我使用哪个插件,我都会得到相同的结果。

以上是关于将 grails 2.0.3 应用程序部署到 cloudfoundry 而不使用 cloudfoundry grails-plugin?的主要内容,如果未能解决你的问题,请参考以下文章

JBoss 6 迁移:部署 grails 应用程序时出错

在现有站点上使用 Tomcat 部署 Grails 应用程序

如何部署具有不同上下文路径的 grails 应用程序

错误 310:暂存部署失败 - Cloud Foundry 中的 Grails 应用程序

Grails:无需重启容器即可部署 Tomcat

升级后 Grails 验证不起作用