0

When deployed to our production server(AWS Linux, Tomcat 8, Grails 3.3.3, Java 1.8) the app cannot find the view. When running locally (grails prod run-app, grails run-app, Java 1.8) there is no issue.

View(alive.gson)

import java.time.Instant
json{
   dateTime Instant.now().toEpochMilli()
   version config.getProperty("info.app.version", String, null)
}

URL Mappings

"/apistatus"(view:"alive")

URLS

http://localhost:8080/cf/apistatus (works without issue)
https://my.domain.com/cf/apistatus (throws exception - javax.servlet.ServletException: Could not resolve view with name 'alive' in servlet with name 'grailsDispatcherServlet')

Update

I've configured the app according to this issue which has not worked

kuda
  • 68
  • 4
  • Are you using Elastic beanstalk or tomcat on EC2 directly? Can you access tomcat logs? catalina logs. Should have clue in that. – srikanth Nutigattu Aug 06 '18 at 16:56
  • Tomcat on EC2. The exception is coming from the tomcat log. The page renders "HTTP Status 500 - Request processing failed; nested exception is org.springframework.expression.spel.SpelEvaluationException: EL1008E: Property or field 'timestamp' cannot be found on object of type 'java.util.HashMap' - maybe not public?" with an exception report. I believe the page is rendering a secondary error as Grails is using a default template since it cannot find the correct template. – kuda Aug 06 '18 at 17:05
  • verify your JDK version of local and that of EC2.. – srikanth Nutigattu Aug 06 '18 at 21:34
  • Try to log you values in gson, think that problem can be with they – Koloritnij Aug 07 '18 at 07:22
  • @Koloritnij I cannot 'log' the values in gson as it cannot find the gson template – kuda Aug 08 '18 at 11:08
  • @srikanthNutigattu Java 1.8 for prod and local – kuda Aug 08 '18 at 11:08
  • Are you using the latest Tomcat 8, i.e., 8.5.32 or 8.0.53? I had a fun little bug in a Grails app caused by a bug in Tomcat itself. – doelleri Aug 08 '18 at 14:30
  • @doelleri I am using Tomcat 8.0.50 – kuda Aug 08 '18 at 17:31
  • @kuda I meaned to check values that they are not null in action.. – Koloritnij Aug 09 '18 at 08:15

0 Answers0