1
votes

I am following the instructions in the chapter 1 in book "Grails in Action, second edition".

What is on my machine? | Grails Version: 3.2.0 | Groovy Version: 2.4.7 | JVM Version: 1.8.0_101

Are GRAILS_HOME and JAVA_HOME configured? YES

/home/myName/.sdkman/candidates/grails/current/bin:/home/myName/software/jdk1.8.0_101//bin:/home/myName/bin:/home/myName/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

I follow the below given commands in terminal

grails create-app qotd cd qotd grails run-app

The script runs and gives me the following message (message 1)

Grails application running at http://localhost:8080 in environment: development

however the expected message (message 2) after executing the script is;

Server running. Browse to http://localhost:8080/qotd

The message 1 link is active while the message 2 link gives me following message on the server.

Page Not Found

Error: Page Not Found (404)
Path: /qotd

yes, I tried the solution where they ask to add following code in application.yml file server: 'context-path': '/qotd'

the result of implementing that solution is given below

Grails application running at message 1/qotd in environment: development.

Further I am not able to click on the links created by controllers and the "view/controller_name" folders are empty (No index.gsp files created)

I get "SLF4J" warnings on executing the run-app command, however I do not think it will have anything related to the problem.

1
Does Grails in Action cover grails 3 or 2 ? Grails 3 to Grails 2 significant change thereV H
@vahid The book covers grails 2 (very specific: Grails 2.3)user4189696
Well then What is on my machine? | Grails Version: 3.2.0 stops there so far as why you are seeing http://localhost:8080 vs http://localhost:8080/qotd two very different technologies Grails 3 vs 2 docs.grails.org/3.0.x/guide/upgrading.html gives you an idea - Grails 3 is spring boot appV H
@vahid that answered my question. Thank you :)user4189696

1 Answers

0
votes

try changing the following

server:
    'context-path': '/qotd'

to this in your application.yml

server:
    contextPath: '/qotd'

Do not add quotes around contextPath.