-
Notifications
You must be signed in to change notification settings - Fork 949
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
5.0.0-RC3 BUG - Controllers Render as Content-Type: application/xhtml depending on random Service Injection #12057
Closed
Comments
Example updated to Grails 5.0.0-RC3 |
codeconsole
changed the title
5.0.0.RC2 BUG - Controllers Render as Content-Type: application/xhtml depending on random Service Injection
5.0.0-RC3 BUG - Controllers Render as Content-Type: application/xhtml depending on random Service Injection
Sep 12, 2021
puneetbehl
added a commit
to grails/grails-data-mapping
that referenced
this issue
Oct 1, 2021
Previously, the getObjectType method was returning NULL because the closure in AbstractDatastoreInitializer is not called earlier in the bean processing. So, in order to resolve the type the AbstractBeanFactory initialize the MethodInvokingFactoryBean which results in initializing objectDefinitionSource(AnnotaionFilterInvocationDefinition) early before creating servletContext. Fixes grails/grails-core#12057
puneetbehl
added a commit
to grails/gorm-hibernate5
that referenced
this issue
Oct 1, 2021
Pass serviceClass to the constructor while loading DataService because sometime the closure is not evaluated early enough to set it in the arguments which causes grails/grails-core#12057.
puneetbehl
added a commit
to grails/gorm-mongodb
that referenced
this issue
Oct 1, 2021
Pass serviceClass to the constructor while loading DataService because sometime the closure is not evaluated early enough to set it in the arguments which causes grails/grails-core#12057.
puneetbehl
added a commit
to grails/gorm-neo4j
that referenced
this issue
Oct 1, 2021
Pass serviceClass to the constructor while loading DataService because sometime the closure is not evaluated early enough to set it in the arguments which causes grails/grails-core#12057.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
At first I thought this issue had to do with the hibernate plugin, but now I believe it is much more serious and based on the order of dependency injection.
Controllers will respond as Content-Type: application/xhtml and the browser will render it as such by showing a bunch of xml.
This Example App demonstrates the issue
https://github.com/codeconsole/gormbug
Using Chrome or Safari in a private window
http://localhost:8080/link
Notice page is sent with content type xhtml
Next, do either of the following:
or edit
./grails-app/services/org/pilotaid/MainService.groovy
and just comment out the following linethen
Using Chrome or Safari in a private window
http://localhost:8080/link
and notice the problem went away and the page renders correctly.
The text was updated successfully, but these errors were encountered: