2017-04-27 108 views
0

我正在使用grails 2.4.7。現在我切換到grails 3.2.3。我試圖在tomcat7中將我的項目war文件部署到ubuntu服務器中。我得到了404 error.I添加了所有可能的插件包括本無法在Tomcat 7和Ubuntu中部署grails 3 war - 404錯誤

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

夠了後,我建立與根名稱的戰爭,但仍然有同樣的problem.Can任何人給我一些可能的解決方案。這裏是我的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 
+0

看着錯誤的地方,看看卡塔利娜,在tomcat日誌文件夾中找出你爲什麼得到404。 – Vahid

回答

0

你可能會丟失你的build.gradle文件中的以下內容:

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

與你使用的是Tomcat版本替換版本號。

Grails的3件作品在Tomcat 8開箱即用,你需要指定的文件的build.gradle版本的Tomcat爲它使用Tomcat 7的工作

參考Deploying an application瞭解更多詳情。