{"action":"created","issue":{"url":"https://api.github.com/repos/grails/grails-core/issues/9582","labels_url":"https://api.github.com/repos/grails/grails-core/issues/9582/labels{/name}","comments_url":"https://api.github.com/repos/grails/grails-core/issues/9582/comments","events_url":"https://api.github.com/repos/grails/grails-core/issues/9582/events","html_url":"https://github.com/grails/grails-core/issues/9582","id":128070911,"number":9582,"title":"Odd behavior with Jar","user":{"login":"bobbywarner","id":554961,"avatar_url":"https://avatars.githubusercontent.com/u/554961?v=3","gravatar_id":"","url":"https://api.github.com/users/bobbywarner","html_url":"https://github.com/bobbywarner","followers_url":"https://api.github.com/users/bobbywarner/followers","following_url":"https://api.github.com/users/bobbywarner/following{/other_user}","gists_url":"https://api.github.com/users/bobbywarner/gists{/gist_id}","starred_url":"https://api.github.com/users/bobbywarner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bobbywarner/subscriptions","organizations_url":"https://api.github.com/users/bobbywarner/orgs","repos_url":"https://api.github.com/users/bobbywarner/repos","events_url":"https://api.github.com/users/bobbywarner/events{/privacy}","received_events_url":"https://api.github.com/users/bobbywarner/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-22T02:48:03Z","updated_at":"2016-01-22T07:45:46Z","closed_at":null,"body":"I am seeing some odd behavior between Grails 3.0.11 and 3.0.12.  In particular, the odd behavior seems to happen when running the app in production as a fat-jar.  Everything seems fine when running the war though.  Did something change related to this?\r\n\r\n```\r\ngrails create-app urlmappings\r\ncd urlmappings/\r\ngrails create-controller foobar\r\n```\r\nvi grails-app/controllers/urlmappings/FoobarController.groovy\r\n```\r\npackage urlmappings\r\nclass FoobarController {\r\n    def index() {\r\n        render 'foobar'\r\n    }\r\n}\r\n```\r\n\r\nvi grails-app/controllers/UrlMappings.groovy \r\n```\r\nclass UrlMappings {\r\n\r\n    static mappings = {\r\n        \"/\"(controller: \"foobar\", action: \"index\")\r\n    }\r\n}\r\n```\r\n\r\nThis works find and renders \"foobar\"\r\n```\r\n./gradlew bootRun\r\nview http://localhost:8080 in browser\r\n```\r\nThis does NOT work and throws an error\r\n```\r\n./gradlew assemble\r\njava -jar build/libs/urlmappings-0.1.jar\r\nview http://localhost:8080 in browser\r\n```\r\nRunning the War as a Jar does work though and renders \"foobar\"\r\n```\r\njava -jar build/libs/urlmappings-0.1.war\r\nview http://localhost:8080 in browser\r\n```\r\n\r\nAny thoughts why running the assembled Jar no longer works with 3.0.12 (but running the assembled War does work)?"},"comment":{"url":"https://api.github.com/repos/grails/grails-core/issues/comments/173836160","html_url":"https://github.com/grails/grails-core/issues/9582#issuecomment-173836160","issue_url":"https://api.github.com/repos/grails/grails-core/issues/9582","id":173836160,"user":{"login":"graemerocher","id":66626,"avatar_url":"https://avatars.githubusercontent.com/u/66626?v=3","gravatar_id":"","url":"https://api.github.com/users/graemerocher","html_url":"https://github.com/graemerocher","followers_url":"https://api.github.com/users/graemerocher/followers","following_url":"https://api.github.com/users/graemerocher/following{/other_user}","gists_url":"https://api.github.com/users/graemerocher/gists{/gist_id}","starred_url":"https://api.github.com/users/graemerocher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/graemerocher/subscriptions","organizations_url":"https://api.github.com/users/graemerocher/orgs","repos_url":"https://api.github.com/users/graemerocher/repos","events_url":"https://api.github.com/users/graemerocher/events{/privacy}","received_events_url":"https://api.github.com/users/graemerocher/received_events","type":"User","site_admin":false},"created_at":"2016-01-22T07:45:46Z","updated_at":"2016-01-22T07:45:46Z","body":"This is probably due to the changes we made to improve startup time. A large amount of time was consumed scanning the classpath for classes and in order to  improve that we limited classpath scanning to only application classes. This may not be working as expected for JAR files, which is an issue.\r\n\r\nHowever, you can probably work around this in your application by modifying your `Application` class and adding the following method:\r\n\r\n    @Override\r\n    protected boolean limitScanningToApplication() {\r\n        return false\r\n    }"}}