Grails debug port not persisting

Answered

I'm attempting to debug two Grails 2.5.4 projects on my machine simultaneously using remote configurations. The first one is using 5005 (the default port) and is able to debug successfully. However, when I try to spin up the second one, using the VM arguments from the Remote configuration, it starts out using 5006 as I specified, but then after the Grails project is packaged, reverts to using 5005. Is there a setting I'm missing that is preventing the change to 5006 from persisting past the Grails packaging? Screenshots:

Remote config:

Grails config:

Message in console:

0
4 comments

Since you need to debug forked process, use 

grails.project.fork

options to customize jvmArgs, see

https://youtrack.jetbrains.com/issue/IDEA-139709#comment=27-1011680 and https://stackoverflow.com/a/23502098/2000323

for examples.

Do not forget to synchronize IDE project structure after BuildConfigu.goory file changes.

0
Avatar
Permanently deleted user

Did that, now it's giving me a different error:

I added this to my BuildConfig.groovy as specified in the links you provided:

grails.project.fork = [
run : [maxMemory: 4096, minMemory: 1024, debug: false, maxPerm: 1024, forkReserve: false, jvmArgs: ['-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5006']]
]

but now it's giving me the following error when I try to run it:

0

Try to configure forked debug only in BuildConfig, remove --debug-fork from Run/Debug Configuration.

0
Avatar
Permanently deleted user

Did that and it worked. Thanks!

0

Please sign in to leave a comment.