在openshift上部署grails war文件后显示空白页面

时间:2016-04-20 15:18:50

标签: mysql tomcat grails openshift war

在使用以下指南(deploy war file using git)创建tomcat 7(JBoss EWS 2.0)应用程序后,我将war文件部署到openshift 但在部署我的应用程序后,它只显示一个空白页面。这是我使用 rhc tail 命令获得的日志。

==> app-root/logs/jbossews.log <==
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
der.java:1571)
        at net.sf.ehcache.util.concurrent.ConcurrentHashMap$ValuesView.iterator(
ConcurrentHashMap.java:3252)
        at net.sf.ehcache.statistics.extended.ExtendedStatisticsImpl$1.run(Exten
dedStatisticsImpl.java:104)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:47
1)
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.
access$301(ScheduledThreadPoolExecutor.java:178)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.
run(ScheduledThreadPoolExecutor.java:293)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:615)
        at java.lang.Thread.run(Thread.java:745)

==> app-root/logs/mysql.log <==
160420 10:20:46 InnoDB: highest supported file format is Barracuda.
160420 10:20:46  InnoDB: Waiting for the background threads to start
160420 10:20:47 InnoDB: 5.5.45 started; log sequence number 1595675
160420 10:20:47 [Note] Server hostname (bind-address): '127.9.179.2'; port: 3306

160420 10:20:47 [Note]   - '127.9.179.2' resolves to '127.9.179.2';
160420 10:20:47 [Note] Server socket created on IP: '127.9.179.2'.
160420 10:20:47 [Warning] 'proxies_priv' entry '@ root@ex-std-node563.prod.rhclo
ud.com' ignored in --skip-name-resolve mode.
160420 10:20:47 [Note] Event Scheduler: Loaded 0 events
160420 10:20:47 [Note] /opt/rh/mysql55/root/usr/libexec/mysqld: ready for connec
tions.
Version: '5.5.45'  socket: '/var/lib/openshift/571649900c1e669c5c00017c/mysql//s
ocket/mysql.sock'  port: 3306  MySQL Community Server (GPL)

==> app-root/logs/phpmyadmin.log <==
[Tue Apr 19 11:24:41 2016] [notice] Apache/2.2.15 (Unix) PHP/5.3.3 configured --
 resuming normal operations
[Tue Apr 19 12:27:32 2016] [notice] SIGHUP received.  Attempting to restart
[Tue Apr 19 12:27:32 2016] [notice] Digest: generating secret for digest authent
ication ...
[Tue Apr 19 12:27:32 2016] [notice] Digest: done
[Tue Apr 19 12:27:32 2016] [notice] Apache/2.2.15 (Unix) PHP/5.3.3 configured --
 resuming normal operations
[Wed Apr 20 10:20:38 2016] [notice] caught SIGWINCH, shutting down gracefully
[Wed Apr 20 10:21:05 2016] [notice] SELinux policy enabled; httpd running as con
text unconfined_u:system_r:openshift_t:s0:c4,c884
[Wed Apr 20 10:21:05 2016] [notice] Digest: generating secret for digest authent
ication ...
[Wed Apr 20 10:21:05 2016] [notice] Digest: done
[Wed Apr 20 10:21:05 2016] [notice] Apache/2.2.15 (Unix) PHP/5.3.3 configured --
 resuming normal operations

我部署的war文件的名称是 ROOT.war ,使用git push并且它已成功部署。我正在使用mysql数据库和phpmyadmin盒式磁带。 我只是想弄清楚为什么当我尝试访问我的应用程序的URL时它向我显示一个空白页面。

提前感谢。

2 个答案:

答案 0 :(得分:1)

您提供的日志根本没有帮助,因为它没有填满,我甚至无法看到抛出的异常。

这是关于在OpenShift上部署grails应用程序的最佳文章,它将为您提供很多帮助: Grails on Openshift

如果您使用ftp查看服务器上发生了什么,那么故障排除会更有效率 Using FileZilla and SFTP on Windows with OpenShift

答案 1 :(得分:0)

我已经通过@Taras Kohut的帮助解决了这个问题。我将以下行添加到BuildConfig.groovy文件中。

 grails.project.war.exploded.dir = "/yourLocalPathToClonedOpenshiftFile/webapps/ROOT"
 grails.war.exploded=true

以上行将在webapps文件夹中的openshift应用程序中生成爆炸的war文件 接下来,我再次在webapps目录中添加了 ROOT.war.deploy 文件。这是一个文件,它指示jboss在推送之后它必须占用ROOT文件夹并将其部署在Tomcat上(由JBoss模拟) )好像它是一个战争档案。 之后,我提交并推送了我的更改,应用程序已成功部署,一切正常。