-
Notifications
You must be signed in to change notification settings - Fork 195
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
RestBuilder default constructor breaks JSON converters/marshallers since 6.0.5 #864
Comments
Can probably be worked around by simply using |
We were using Our workaround is to duplicate the
It solves the issue on our apps. |
If it can help, when turning on
|
The issue is caused because the |
Fixed by 0be3bea |
@jameskleeh FYI, Jeff's solution meant changing a lot of my tests to make them work with the API of this other RxRestBuilder thingy. So instead I went with @benorama's workaround and injected the solution in 0be3bea, and I got 15 out of 18 tests to pass again. The other 3 fail with another JSON related exception:
I'll continue to investigate. |
@sarbogast Feel free to open a new issue with a sample project in grails-data-mapping |
The root cause seems to be way deeper than that and it's harder to identify what's causing it. But I'll try:
|
OK, I really couldn't reproduce in a sample app. But I can confirm that your fix with lower priority marshallers does not fix this exception. I found the same exception report in old versions of Grails: http://grails.1312388.n4.nabble.com/Marshallers-are-blowing-up-in-2-3-5-anyone-else-td4653954.html Once I comment out this whole section in RestBuilder's constructor, my tests pass again. |
@sarbogast Without something to debug, I can't fix the issue. In the meantime I'll be adding an option to turn off the creation of the converters |
I know, but for the life of me I couldn't isolate what is going on and why it's failing. Apparently in my case it fails to call getClass() on an object of a class I don't even know of. And impossible to figure out what was common to those 3 failing tests compared to the 117 others. |
@benorama @sarbogast In the next version of GORM, you can do |
That's great! Would it be possible to have a global config parameter, since you might not control instances created from plugins? |
Run into the same issue. Solved by applying the registerConverters:false (Grails 3.3.9) |
Steps to Reproduce
compile 'org.grails:grails-datastore-rest-client'
dependencyrestBuilder(RestBuilder)
bean in your springresources.groovy
as JSON
)Expected Behaviour
It should render JSON.
Actual Behaviour
It throws a
StringIndexOutOfBoundsException
exception.Environment Information
Example Application
The text was updated successfully, but these errors were encountered: