grails-core icon indicating copy to clipboard operation
grails-core copied to clipboard

Grails 6.2.0 - Cast Exception if Action takes Command

Open jdaugherty opened this issue 2 months ago • 6 comments

Expected Behavior

After upgrading to Grails 6.2.0, one of our controllers started to error. I was able to reproduce this issue in a sample application. Visiting http://localhost:8080/example/list should render the list action renders without issue. Instead an exception is thrown.

Changing a variable name in an unrelated action fixes the issue.

Actual Behaviour

A class cast exception occurs:

Cannot cast object 'brokenBinding.ExampleSearchCommand@116e5496' with class 'brokenBinding.ExampleSearchCommand' to class 'brokenBinding.ExampleCommand'

Steps To Reproduce

Details in README.md

  1. Launch grails app
  2. Visit http://localhost:8080/example/list

Environment Information

  • Operating System: Mac OS 14.4.1 & Latest Stable Linux (Debian)
  • JDK: 11.0.22 Liberica (.sdkmanrc has version in example project)

Example Application

https://github.com/jdaugherty/grails-broken-binding

Version

6.2.0

jdaugherty avatar Apr 25 '24 14:04 jdaugherty