0
votes

I'm running application on a grails 2.0.3 with resource plugin 1.1.6.

I have missing resources when running 2 instances of the application

Running the first instance with:

grails clean; grails compile; grails -Ddisable.auto.recompile=true -Dserver.port=8081 run-app

The application is running well without any missing resource.

Compiling the second instance:

grails clean; grails compile

After this command I'm refreshing the first instance and I see that the resources(images, messages) are missing. Note that I'm running the applications with the same application name. I checked the .grails/2.0.3/project/ and it seems that the resources are being deleted when I run grails clean for the second instance.

How can I separate those 2 instances to not interfere?

My configuration Config.groovy for resources is:

grails.resources.adhoc.patterns = ['/images/*', '/css/*', '/js/*', '/plugins/*']

grails.resources.modules = {
'core' {
    defaultBundle 'core-ui'

    resource url: '/css/all.css', attrs: [ media: 'screen' ]
    resource url: '/css/lt7.css', attrs: [ media: 'screen' ],
             wrapper: { s -> "<!--[if lt IE 8]>$s<![endif]-->" }
}

'ui' {
    defaultBundle 'core-ui'

    resource url: '/js/main.js', disposition: 'head'
    resource url: '/js/datatable.js', disposition: 'head'
    resource url: '/js/slideBlock.js', disposition: 'head'
}

'input' {
    defaultBundle "input"

    resource url: '/js/form.js', disposition: 'head'
    resource url: '/js/checkbox.js', disposition: 'head'
    resource url: '/js/clearinput.js', disposition: 'head'
}

'panels' {
    defaultBundle 'panels'

    resource url: '/js/panels.js', disposition: 'head'
}

'jquery-validate' {
    defaultBundle "jquery-validate"

    resource url: '/js/jquery-validate/jquery.validate.min.js', disposition: 'head'
    resource url: '/js/jquery-validate/jquery.metadata.js', disposition: 'head'
    resource url: '/js/jquery-validate/additional-methods.min.js', disposition: 'head'
}

overrides {
    'jquery-theme' {
        resource id:'theme', url:'/jquery-ui/themes/app/jquery-ui-1.8.7.custom.css'
    }
}

}

Anyone experienced the same problem? I appreciate if someone can help me. Thanks

2

2 Answers

0
votes

Apparently this has nothing to do with using resources plugin. You probably need different app names, to run them on the same machine. As already pointed out, you need separate folders as well as separate app names for these two or more applications on the same machines to have separate folders.

0
votes

Try specifying a new working directory for each instance. The default is something like

<home>/.grails/

Try this ...

grails -Dgrails.work.dir=/home/instance2 -Dserver.port=8081 run-app