Random response with ajax queries (grails version 2.2.0)

classic Classic list List threaded Threaded
2 messages Options
lla
Reply | Threaded
Open this post in threaded view
|

Random response with ajax queries (grails version 2.2.0)

lla
Hi folks,

I'm calling a controller action from jquery so as to set bookmarks on domain object.
Randomly, i get an error on the identifier that is sent to the controller action (that is to say the id, which i cast as a long before sending it to a service logic which is handling  ACL) :

def setBookmark() {
        Files file = filesService.getById(params.id as Long)
        def jsonResp = [:]
        jsonResp.id = file.id
        if (!file.isBookMarked) {
             file.setIsBookMarked(true)
             jsonResp.useBookmark = 'true'
        } else {
            file.setIsBookMarked(false)
        }
        render jsonResp as JSON
    }


here is the   stacktrace that appears from time to time, really weird :
2013-02-22 18:45:48,645 ERROR [GrailsExceptionResolver] - IllegalArgumentException occurred when processing request: [GET] /xxxxxx/files/setBookmark - parameters:
id: 2
identifier required. Stacktrace follows:
java.lang.IllegalArgumentException: identifier required
        at xxxxxxxxxxxxxxFilesController$$ENyDH2GO.setBookmark(FilesController.groovy:347)
        at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:195)
        at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
        at net.bull.javamelody.JspWrapper.invoke(JspWrapper.java:149)
        at net.bull.javamelody.JdbcWrapper$DelegatingInvocationHandler.invoke(JdbcWrapper.java:259)
        at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:202)
        at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:175)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:680)
errors.error403: [id:2, action:error403, controller:errors]
grails> 2013-02-22 18:45:48,693 DEBUG [ExceptionTranslationFilter] - Chain processed normally
| Compiling 1 source files.


Any idea ?

Cheers
Reply | Threaded
Open this post in threaded view
|

Re: Random response with ajax queries (grails version 2.2.0)

sergiomichels
What you have in the line 347?

(FilesController.groovy:347)

--
Sérgio Michels


On Fri, Feb 22, 2013 at 7:01 PM, lla <[hidden email]> wrote:
Hi folks,

I'm calling a controller action from jquery so as to set bookmarks on domain
object.
Randomly, i get an error on the identifier that is sent to the controller
action (that is to say the id, which i cast as a long before sending it to a
service logic which is handling  ACL) :

def setBookmark() {
        Files file = filesService.getById(params.id as Long)
        def jsonResp = [:]
        jsonResp.id = file.id
        if (!file.isBookMarked) {
             file.setIsBookMarked(true)
             jsonResp.useBookmark = 'true'
        } else {
            file.setIsBookMarked(false)
        }
        render jsonResp as JSON
    }


here is the   stacktrace that appears from time to time, really weird :
2013-02-22 18:45:48,645 ERROR [GrailsExceptionResolver] -
IllegalArgumentException occurred when processing request: [GET]
/xxxxxx/files/setBookmark - parameters:
id: 2
identifier required. Stacktrace follows:
java.lang.IllegalArgumentException: identifier required
        at
xxxxxxxxxxxxxxFilesController$$ENyDH2GO.setBookmark(FilesController.groovy:347)
        at
grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:195)
        at
grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
        at net.bull.javamelody.JspWrapper.invoke(JspWrapper.java:149)
        at
net.bull.javamelody.JdbcWrapper$DelegatingInvocationHandler.invoke(JdbcWrapper.java:259)
        at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:202)
        at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:175)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:680)
errors.error403: [id:2, action:error403, controller:errors]
grails> 2013-02-22 18:45:48,693 DEBUG [ExceptionTranslationFilter] - Chain
processed normally
| Compiling 1 source files.


Any idea ?

Cheers




--
View this message in context: http://grails.1312388.n4.nabble.com/Random-response-with-ajax-queries-grails-version-2-2-0-tp4641738.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email