gpt4 book ai didi

java - 将 grails 3 应用程序部署到 openshift

转载 作者:行者123 更新时间:2023-11-30 08:36:00 24 4
gpt4 key购买 nike

我已经创建了一个 grails 3 应用程序并配置了生产环境如下:

environments {
production {
dataSource {
dbCreate = "update"
driverClassName = "org.postgresql.Driver"
dialect= CustomPostgresDialect
uri = new URI(System.getenv("OPENSHIFT_POSTGRESQL_DB_URL"))
url = "jdbc:postgresql://" + uri.host + ":" + uri.port + "/" + System.getenv("OPENSHIFT_APP_NAME")
username = System.getenv("OPENSHIFT_POSTGRESQL_DB_USERNAME")
password = System.getenv("OPENSHIFT_POSTGRESQL_DB_PASSWORD")
}
}
}

我按照以下步骤操作:https://blog.openshift.com/day-6-rapid-web-development-on-the-jvm-with-grails/

但是当我尝试访问应用程序 URL 时,我得到了 404。

而且我无法从日志中找出问题所在:

In app-root/logs/postgresql.log

2016-06-20 12:16:20 GMT LOG: database system is shut down
2016-06-20 12:16:29 GMT LOG: could not bind socket for statistics collector: Permission denied
2016-06-20 12:16:29 GMT LOG: trying another address for the statistics collector
2016-06-20 12:16:29 GMT LOG: could not bind socket for statistics collector: Cannot assign requested address
2016-06-20 12:16:29 GMT LOG: disabling statistics collector for lack of working socket
2016-06-20 12:16:29 GMT WARNING: autovacuum not started because of misconfiguration
2016-06-20 12:16:29 GMT HINT: Enable the "track_counts" option.
2016-06-20 12:16:29 GMT LOG: database system was shut down at 2016-06-20 12:16:20 GMT
2016-06-20 12:16:29 GMT FATAL: the database system is starting up
2016-06-20 12:16:29 GMT LOG: database system is ready to accept connections

In app-root/logs/jbossews.log

Jun 20, 2016 8:16:36 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.54
Jun 20, 2016 8:16:36 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive /var/lib/openshift/5767c8e30c1e6699f90000eb/app-root/runtime/dependencies/jbossews/webapps/ROOT.war
Jun 20, 2016 8:17:06 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deployment of web application archive /var/lib/openshift/5767c8e30c1e6699f90000eb/app-root/runtime/dependencies/jbossews/webapps/ROOT.war has finished in 29,596 ms
Jun 20, 2016 8:17:06 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-127.12.216.1-8080"]
Jun 20, 2016 8:17:06 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 29969 ms

我错过了什么?

最佳答案

错误与 spring security 的设置有关。默认情况下,spring security 重定向到我不支持的 URL。

通过查看文档,我发现该设置可以按如下方式覆盖:

grails.plugin.springsecurity.auth.loginFormUrl = '/api/login'

如果未指定,spring security 将使用默认值:/login/auth

Spring security defaults

关于java - 将 grails 3 应用程序部署到 openshift,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37922643/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com