-
Notifications
You must be signed in to change notification settings - Fork 72
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
BROKEN >= 7.0.4 Causes Resource Controllers to Render as Content-Type: application/xhtml #303
Comments
Stepping into with a debugger, I am finding using 7.0.3
but when I switch to 7.0.4
MimeType { name=application/xhtml+xml,extension=html,parameters=[q:1.0] } Digging deeper:
from which comes from which appears to be set here after
Any idea how exactly |
I built the same app as an executable jar using 7.0.3 and 7.0.4 and ran both of them. Only 7.0.4 experienced the issue.
I also ran a grails dependencyReport on the 2 configurations which also resulted in the same result. Apparently I was looking at the wrong code base. The breaking changes are here: https://github.com/grails/gorm-hibernate5/compare/v7.0.3..v7.0.4
So the breaking changes would have to be in either HibernateDatastoreSpringInitializer.groovy, Application.groovy or HibernateGrailsPlugin.groovy |
Update:
Verified WORKING I built and used the 7.0.4 jar:
Verified NOT WORKING I built a jar using the latest on the 7.0.x branch
Verified NOT WORKING Using the latest 7.0.x branch, I made the following changes
Verified WORKING I then checked out master and applied those same changes to master
Therefore, the following code is 100% causing the issue:
Perhaps it is changing the loading of services which is overwriting the mime types that are available? I have no idea. All I know is it works when that code is reverted to
https://github.com/grails/gorm-hibernate5/compare/v7.0.3..v7.0.4 |
Sample App that replicates |
@codeconsole Thank you for the great debugging effort, I will look into this soon. |
@puneetbehl I've updated the sample to 5.0.0.RC1 https://github.com/codeconsole/gormbug |
@codeconsole Did you see this issue in Grails 4? if yes, could you please share a sample application? I am not able to replicate it with Grails 4. |
@puneetbehl It's not in Grails 4. Only Grails 5. It has nothing to do with that mentioned issue. Sorry for linking that to the ticket. |
I think it might be related to the same underline issue. But, let me verify. Do you have a sample application for this? |
@puneetbehl I noticed it when I upgraded from Grails 4.x to Grails 5.x. Would you like me to create a 4.x sample app to verify? |
Yes, please share a 4.0.x sample application. |
Grails 4.0.12 - Confirmed not working.
|
@puneetbehl I can confirm using 7.1.0-SNAPSHOT on 5.0.0.RC3 fixes the issue. Out of curiosity, why was it affecting the mime types? |
Changing a working app from
implementation "org.grails.plugins:hibernate5:7.0.3
to any version >= 7.0.4 results in Resources controllers rendered as:
Content-Type: application/xhtml+xml;charset=UTF-8
and the browser no longer displays them properly.
Using any version <= 7.0.3 results in controllers rendering pages as
Content-Type: text/html;charset=UTF-8
What changed with this plugin between 7.0.3 to 7.0.4 that affected choosing the correct mime type??
https://github.com/grails/grails-data-mapping/compare/v7.0.3..v7.0.4
https://github.com/grails/grails-data-mapping/compare/v7.0.3..7.0.4
And which tag represent 7.0.4 that is in https://repo.grails.org/grails/core/org/grails/plugins/hibernate5/7.0.4/ ?
The text was updated successfully, but these errors were encountered: