apache / apache/grails-core

Grails 4 allows Controller to extend a non-trait. Core dumps in Grails 5

Open
#12,443 8 comments 0 reactions 0 assignees View on GitHub
Dominant language
Groovy
Stars
2.9k
Forks
975
Avg merge
1d 22h
Merged PRs (30d)
92

Description

### Expected Behavior

Large application running without issuing with multiple controllers extending a BaseController (non-trait) in grails 4.

Expected to be able to upgrade to Grails 5 without it core dumping.

### Actual Behaviour

Core dump with difficult to interpret dump

`RAX=0x0000000000000000 is an unknown value
RBX={method} {0x000000012530a571} '' '()V' in 'java/lang/AbstractMethodError'
RCX=0x00000007ade5c620 is an oop
java.lang.IllegalStateException
- klass: 'java/lang/IllegalStateException'`

### Steps To Reproduce

Create controller in Grails 5 that extends a non-trait.

Watch as
`((GroovyObject)this).setProperty "modelAndView", new ModelAndView(viewUri, model)`
inside ResponseRenderer yields an AbstractMethodError but won't in Grails 4

### Environment Information

Temurin 1.8 b322

### Example Application

_No response_

### Version

5.1.4

Contributor guide

Open the contributing guide

Research direction

Start with the Grails 5 controller path described in the report, especially ResponseRenderer and the setProperty call for modelAndView. Reproduce the AbstractMethodError using a controller extending a non-trait under Temurin 1.8, then compare the same case with Grails 4. Done means the Grails 5 case no longer core dumps and produces the expected response behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy
Domain
backend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.