You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@grails.apache.org by "codeconsole (via GitHub)" <gi...@apache.org> on 2025/10/19 00:03:14 UTC

[PR] Fix for #15147 [grails-core]

codeconsole opened a new pull request, #15153:
URL: https://github.com/apache/grails-core/pull/15153

   (no comment)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix for #15147 [grails-core]

Posted by "codeconsole (via GitHub)" <gi...@apache.org>.
codeconsole commented on PR #15153:
URL: https://github.com/apache/grails-core/pull/15153#issuecomment-3423212154

   @jdaugherty you should be able to replicate via a simple controller
   
   ```groovy
   package data.binding.bug
   
   import grails.converters.JSON
   
   class TestController {
   
       def show(String id) { // success
           render([success: true] as JSON)
       }
   
       def submit(long id, long imageId) { // error: Cannot cast object '###' with class 'java.lang.String' to class 'long'.
           render([success: true] as JSON)
       }
   
       def dq(Long id, Long imageId) {  // error: Cannot cast object '###' with class 'java.lang.String' to class 'long'.
           render([success: true] as JSON)
       }
   }
   ```
   
   ```
   curl "http://localhost:8080/test/submit/123456789.json?imageId=123456789"
   ```
   
   ```
   2025-10-20T11:07:28.035-07:00 ERROR 34235 --- [nio-8080-exec-4] o.g.web.errors.GrailsExceptionResolver   : GroovyCastException occurred when processing request: [GET] /test/submit/123456789.json - parameters:
   imageId: 123456789
   Cannot cast object '123456789' with class 'java.lang.String' to class 'long'. Stacktrace follows:
   
   java.lang.reflect.InvocationTargetException: null
           at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:110)
           at org.grails.core.DefaultGrailsControllerClass$ReflectionInvoker.invoke(DefaultGrailsControllerClass.java:215)
           at org.grails.core.DefaultGrailsControllerClass.invoke(DefaultGrailsControllerClass.java:192)
           at org.grails.web.mapping.mvc.UrlMappingsInfoHandlerAdapter.handle(UrlMappingsInfoHandlerAdapter.groovy:110)
           at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1089)
           at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:979)
           at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1014)
           at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:903)
           at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:885)
           at org.grails.web.servlet.mvc.GrailsWebRequestFilter.doFilterInternal(GrailsWebRequestFilter.java:80)
           at org.grails.web.filters.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:70)
           at java.base/java.lang.Thread.run(Thread.java:1447)
   Caused by: org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object '123456789' with class 'java.lang.String' to class 'long'
           at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
           ... 11 common frames omitted
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix for #15147 [grails-core]

Posted by "jdaugherty (via GitHub)" <gi...@apache.org>.
jdaugherty commented on PR #15153:
URL: https://github.com/apache/grails-core/pull/15153#issuecomment-3419980585

   Lets add a test for this to merge


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix for #15147 [grails-core]

Posted by "matrei (via GitHub)" <gi...@apache.org>.
matrei commented on PR #15153:
URL: https://github.com/apache/grails-core/pull/15153#issuecomment-3425239928

   Thank you @codeconsole!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix for #15147 [grails-core]

Posted by "matrei (via GitHub)" <gi...@apache.org>.
matrei merged PR #15153:
URL: https://github.com/apache/grails-core/pull/15153


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org