{"action":"created","issue":{"url":"https://api.github.com/repos/lmivan/grails-url-shortener/issues/6","labels_url":"https://api.github.com/repos/lmivan/grails-url-shortener/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/lmivan/grails-url-shortener/issues/6/comments","events_url":"https://api.github.com/repos/lmivan/grails-url-shortener/issues/6/events","html_url":"https://github.com/lmivan/grails-url-shortener/issues/6","id":54604014,"number":6,"title":"Cannot invoke method getNextNumber() on null object","user":{"login":"confile","id":64265,"avatar_url":"https://avatars.githubusercontent.com/u/64265?v=3","gravatar_id":"","url":"https://api.github.com/users/confile","html_url":"https://github.com/confile","followers_url":"https://api.github.com/users/confile/followers","following_url":"https://api.github.com/users/confile/following{/other_user}","gists_url":"https://api.github.com/users/confile/gists{/gist_id}","starred_url":"https://api.github.com/users/confile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/confile/subscriptions","organizations_url":"https://api.github.com/users/confile/orgs","repos_url":"https://api.github.com/users/confile/repos","events_url":"https://api.github.com/users/confile/events{/privacy}","received_events_url":"https://api.github.com/users/confile/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"lmivan","id":559192,"avatar_url":"https://avatars.githubusercontent.com/u/559192?v=3","gravatar_id":"","url":"https://api.github.com/users/lmivan","html_url":"https://github.com/lmivan","followers_url":"https://api.github.com/users/lmivan/followers","following_url":"https://api.github.com/users/lmivan/following{/other_user}","gists_url":"https://api.github.com/users/lmivan/gists{/gist_id}","starred_url":"https://api.github.com/users/lmivan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmivan/subscriptions","organizations_url":"https://api.github.com/users/lmivan/orgs","repos_url":"https://api.github.com/users/lmivan/repos","events_url":"https://api.github.com/users/lmivan/events{/privacy}","received_events_url":"https://api.github.com/users/lmivan/received_events","type":"User","site_admin":false},"milestone":null,"comments":4,"created_at":"2015-01-16T17:48:39Z","updated_at":"2015-01-17T22:50:39Z","closed_at":null,"body":"I tried the following controller action: \r\n\r\n```\r\n  def urlShortenerService\r\n\r\n\r\n  def lala() {\r\n\r\n    println \"urlShortenerService: \"+urlShortenerService\r\n    \r\n    String shortUrl = urlShortenerService.shortUrl(\"http://kaleidos.net\")\r\n    println \"shortUrl: \"+shortUrl\r\n\r\n    render \"OK\"\r\n  }\r\n```\r\n\r\nand got the following error: \r\n\r\n```\r\n2015-01-16 18:47:22,511 [http-nio-8080-exec-5] ERROR errors.GrailsExceptionResolver  - NullPointerException occurred when processing request: [GET] /test/home/lala\r\nCannot invoke method getNextNumber() on null object. Stacktrace follows:\r\nMessage: Cannot invoke method getNextNumber() on null object\r\n    Line | Method\r\n->>   48 | shortUrl           in net.kaleidos.shortener.UrlShortenerService\r\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \r\n|     68 | shortUrlFullDomain in     ''\r\n|     25 | lala . . . . . . . in test.HomeController$$EP1YPA88\r\n|    198 | doFilter           in grails.plugin.cache.web.filter.PageFragmentCachingFilter\r\n|     63 | doFilter . . . . . in grails.plugin.cache.web.filter.AbstractFilter\r\n|     53 | doFilter           in grails.plugin.springsecurity.web.filter.GrailsAnonymousAuthenticationFilter\r\n|     49 | doFilter . . . . . in grails.plugin.springsecurity.web.authentication.RequestHolderAuthenticationFilter\r\n|     82 | doFilter           in grails.plugin.springsecurity.web.authentication.logout.MutableLogoutFilter\r\n|     46 | doFilterInternal . in org.grails.jaxrs.web.JaxrsFilter\r\n|   1142 | runWorker          in java.util.concurrent.ThreadPoolExecutor\r\n|    617 | run . . . . . . .  in java.util.concurrent.ThreadPoolExecutor$Worker\r\n^    745 | run                in java.lang.Thread\r\n......\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/lmivan/grails-url-shortener/issues/comments/70388001","html_url":"https://github.com/lmivan/grails-url-shortener/issues/6#issuecomment-70388001","issue_url":"https://api.github.com/repos/lmivan/grails-url-shortener/issues/6","id":70388001,"user":{"login":"goeh","id":322721,"avatar_url":"https://avatars.githubusercontent.com/u/322721?v=3","gravatar_id":"","url":"https://api.github.com/users/goeh","html_url":"https://github.com/goeh","followers_url":"https://api.github.com/users/goeh/followers","following_url":"https://api.github.com/users/goeh/following{/other_user}","gists_url":"https://api.github.com/users/goeh/gists{/gist_id}","starred_url":"https://api.github.com/users/goeh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goeh/subscriptions","organizations_url":"https://api.github.com/users/goeh/orgs","repos_url":"https://api.github.com/users/goeh/repos","events_url":"https://api.github.com/users/goeh/events{/privacy}","received_events_url":"https://api.github.com/users/goeh/received_events","type":"User","site_admin":false},"created_at":"2015-01-17T22:50:39Z","updated_at":"2015-01-17T22:50:39Z","body":"I could not find a problem with adding back the default/dummy sequence generator in doWithSpring. \r\n\r\nDuring development of version 0.2 I removed it from the plugin descriptor and placed in in resources.groovy. I later found a better implementation but forgot to move it back.\r\n\r\nI created a pull request to fix this. The fix is tested in two applications that uses url-shortener and they worked ok."}}