0

我正在使用 grails 2.4.7。现在我切换到 grails 3.2.3。我正在尝试在 ubuntu 服务器的 tomcat7 中部署我的项目 war 文件。我收到 404 错误。我添加了所有可能的插件,包括这个

   provided "org.springframework.boot:spring-boot-starter-tomcat" 

受够了我用 ROOT 名称建立战争但仍然有同样的问题。任何人都可以给我一些可能的解决方案。这是我的 application.yml 代码。

environments:
    development:
        grails:
            serverURL: http://localhost:8080
        dataSource:
            dbCreate: create
            url: jdbc:mysql://localhost/somedb
            username: ****
            password:
            dialect: org.hibernate.dialect.MySQL5InnoDBDialect
            #url: jdbc:h2:mem:devDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
    test:
        grails:
            serverURL: http://localhost:8080
        dataSource:
            dbCreate: update
            url: jdbc:h2:mem:testDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
    production:
        grails:
            serverURL: http://ipaddress:8080
        dataSource:
            dbCreate: create
            url: jdbc:mysql://localhost/somedb
            username: *****
            password: *******
            dialect: org.hibernate.dialect.MySQL5InnoDBDialect
           # url: jdbc:h2:./prodDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
            properties:
                jmxEnabled: true
                initialSize: 5
                maxActive: 50
                minIdle: 5
                maxIdle: 25
                maxWait: 10000
                maxAge: 600000
                timeBetweenEvictionRunsMillis: 5000
                minEvictableIdleTimeMillis: 60000
                validationQuery: SELECT 1
                validationQueryTimeout: 3
                validationInterval: 15000
                testOnBorrow: true
                testWhileIdle: true
                testOnReturn: false
                jdbcInterceptors: ConnectionState
                defaultTransactionIsolation: 2 
4

1 回答 1

0

您的 build.gradle 文件中可能缺少以下内容:

ext['tomcat.version'] = '7.0.54'

将版本号替换为您正在使用的 Tomcat 版本。

Grails 3 可与 Tomcat 8 一起使用,您需要在 build.gradle 文件中指定 Tomcat 版本才能使其与 Tomcat 7 一起使用。

有关更多详细信息,请参阅部署应用程序

于 2017-04-28T00:18:32.387 回答