A grails application i work on can not start on debug mode. During start up, the application waits endlessly after the first "Running Grails application" message. Waited for a very long time but no error message is given. What can i do to find the source of the problem? With debug mode turned off, project starts. Tried with grails 2.3.6 and 2.4.1.
The application is probably waiting for the remote debugger to connect. That is by design. Once you connect the remote debugger the process should continue the startup procedure.
Related
I had been using Grails 3.3.2 for about 3-4 years now and never had this issue. I just recently started migrating our apps to Grails 5 and now this started happening. Everytime I save a change to a file (gson, groovy, etc) the app redeploys and I have to wait a good 5-6 seconds before I can test it (url becomes available).
In Grails 5 my console looks like this when I make changes:
Grails application running at http://localhost:8081 in environment: development
File C:\Workspaces\Intellij\ecpp\grails-app\controllers\ecpp\service\LookupSvcController.groovy changed, recompiling...
Grails application running at http://localhost:8081 in environment: development
File C:\Workspaces\Intellij\ecpp\grails-app\controllers\ecpp\service\LookupSvcController.groovy changed, recompiling...
Grails application running at http://localhost:8081 in environment: development
File C:\Workspaces\Intellij\ecpp\grails-app\controllers\ecpp\service\LookupSvcController.groovy changed, recompiling...
Grails application running at http://localhost:8081 in environment: development
Each one of those Grails application running [...] lines is a 5+ second delay I have to wait through before the app comes back up
When I would work on my 3.3.2 projects my console would look like this during changes
Grails application running at http://localhost:8081 in environment: development
File C:\Workspaces\Intellij\ecpp\grails-app\controllers\ecpp\service\LookupSvcController.groovy changed, recompiling...
File C:\Workspaces\Intellij\ecpp\grails-app\controllers\ecpp\service\LookupSvcController.groovy changed, recompiling...
File C:\Workspaces\Intellij\ecpp\grails-app\controllers\ecpp\service\LookupSvcController.groovy changed, recompiling...
I never had to wait, I could immediately refresh the page and see the changes. Needless to say, my DEV time has taken a hit having to stop and wait for a redeploy. Is there some configuration I missed while upgrading that I can set to resolve this?
This happens while running the app with gradlew bootRun as well as grailsw run-app
Grails 5.1.7
JDK: 11.0.13
I just recently started migrating our apps to Grails 5 and now this
started happening. Everytime I save a change to a file (gson, groovy,
etc) the app redeploys and I have to wait a good 5-6 seconds before I
can test it (url becomes available).
The behavior you described is expected and by design.
Older versions of Grails were configured by default with a reloading agent. Grails 5 is not. The default behavior you will get with Grails 5 is a recompile and restart. If you don't want that behavior you can remove the devtools from your build.
You didn't ask about configuring a reloading agent but if you are interested, see the Spring Boot Developer Tools and Spring Loaded section at https://docs.grails.org/5.1.7/guide/single.html#upgrading33x.
I have run into a very serious problem where I can longer deploy a war of a Grails 2.2.5 web application on Tomcat. The build (with 'grails war') proceeds without a problem, and I deploy it to Tomcat. I retsart Tomcat, and the web application simply does not run. It comes up with the deploying message, but clearly doesn't get as far as running Bootstrap.groovy, because logging from there doesn't show up in the log. No error messages are given, but the web app is simply not running.
I ran into a similar problem a few days ago on a different server which I solved by upgrading to Tomcat 7, but this one is already running Tomcat 7. I have no idea why this has started happening, unless it is something obscure to do with the recent change in Maven where only TLS 1.2 connections are allowed (a change which occurred a week or so ago).
So what could be happening? Is there some way I can log what is happening as the web app starts up, such that I might be able to see where the problem is occurring?
If it is of any relevance, it works OK when I do 'grails run-war' on my development machine.
An application can start the Thin web server
rails s
However, launching the console
rails c
hangs and never returns to a prompt.
Obviously, I need it to run!
note 1: I believe this is a consequence of an external disk that houses the application, that lost its connection to the main computer
note 2: I had read incidentally that the spring gem has some un-robust behaviours. Could this be a motive?
run following command & it should be fix
spring stop
i want to debug Grails application in the eclipse kepler,i tried Debug As in eclipse and added break points but it runs normally as it in normal run mode , how i do that ?
Thanks
Burt's answer from here
You can start a Grails app (one that has an Eclipse Grails nature,
i.e. it was created in STS or was converted via Configure | Convert to
Grails Project) in STS in debug mode using Run | Debug As | Grails
Command (run-app)
You can also attach to any app that you start from the commandline via
"grails-debug run-app" by creating a Debug Configuration. Go to Run |
Debug Configurations and select Remote Java Application. Click the
'New' button or right-click the Remote Java Application node and
select New. Select the project that you're debugging and give the
configuration a meaningful name (I usually call them "attach
"). Change the port from 8000 to 5005, and I always check
the "Allow termination of remote VM" checkbox so I can kill the app
from the IDE, but that's optional. Click Debug and it'll attach. Note
that this will work for any Grails project that's in your workspace,
not just ones that have a Grails nature.
Burt
in order to allow eclipse or any other debugger to connect to an external grails app running you need to start grails in debug mode:
grails-debug run-app
Doing this grails has to pause and wait for a remote debugger to connect.
The grails-debug appears to be deprecated. Nowadays use:
grails --debug-fork run-app
I am new to Ruby on Rails, but I managed to install it using the RailsInstaller and I am using Aptana Studio 3 as a text editor. I am on a Windows 7 x64.
Last week I managed to create a simple Hello world project, and it worked as it should when starting and stopping the rails server. To start the server I used the command rails server and to stop it I used CTRL+C.
Somehow, this week, when I'm trying to start the server it says "A server is already running". But, when I go to the correct page in a web browser it doesn't work. I get the error "Google Chrome could not connect to localhost:3010". So, this makes it seem like the server is not working, even though it supposedly is running.
So, I then try to stop the server from running, but CTRL+C doesn't seem to do anything. It doesn't give any kind of message at all when I input that, it just skips to a new line in the terminal window.
the standard port is 3000.
You can kill the server in the task manager and start it from new..
There is probably a rails process still running but bugged out/crashed. Try looking at the processes in the windows task manager to for a rails process, and cancel it. Additionally you can start a rails process on a different port with rails server -p PORT