-
Notifications
You must be signed in to change notification settings - Fork 181
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
Erratic class loading behavior in Spring Boot #177
Comments
The same type name but different packages scenario is one of the main reasons that check is there :) That's a legitimate name collision that you should take care of. If two types end up sharing a name (which is what is happening), it will have totally unpredictable behavior. I.e. failing in ways not easy to diagnose. As for the class colliding with itself scenario, it's been reported once before but without any further info. Is the error message you show complete? I.e. is there no annotations mentioned in the log? Asking because the exact same class but with different annotations (e.g. annotations at the place of use) can easily end up mapped to different GraphQL types (think of |
I dont believe the class used in the other package is exposed in graphql, is the thing. But ill double check that. Also all warnings disappear and the queries work perfectly without the jvm param, which is what makes it truely suspect to me. |
With respect to same class, different annotations, are you referring to a case where I do something like this:
I'm sure I have cases like that in my schema. |
OK I have an update on this issue, firstly I was wrong! This does not have anything to do with |
For reference the issue was a buggy version of classgraph (an internal dependency of graphql-spqr), by simply upgrading to latest version of that the issues went away. |
Apart from updating ClassGraph, I also made sure to first try loading the concrete implementation classes using the same class loader that loaded the abstract super type. It delegate to ClassGraph only if this first attempt fails. It will also print a warning in this case. That should hopefully solve most if not all freak accidents like this one. |
#179 also adds class loader info to the log when a name collision is detected. If another freak incident like this occurs, it should at least be easier to trace than this time. |
I got these strange errors and I have no clue how to handle them:
|
Hi, did you find any solution for this warning? I'm also getting the same thing. Any idea how to fix it? |
@kicktipp @anita0711 These are false warnings, safe to ignore. Will be fixed in the next release. |
@kaqqao Thank you for your quick revert. I'm getting __typename for my query where I expect field names of a model. Could this issue be due to the above warning? I have below 2 models as below:
and
When I try to fetch the fields of CoResponse along resultMetadata field, instead of getting the field names(resourceId, resourceUrn, revisionId, etc.), I could see '__typename' something as follows:
I'm using graphql-spqr-spring-boot-starter library. Could you please suggest why am I not able to fetch the fields of resultMetadata? Any kind of help will be much appreciated. |
When using this JVM option, App Startup reports several warning messages of this type:
Note that sometimes the two types listed are the same type, and other times they're the same type name but different packages. Actual queries post-startup fail (not all, but some), and not in ways that are easy to diagnose.
Not suggesting this is necessarily something you should fix but at the very least this should be front and center in the README as a limitation.
The text was updated successfully, but these errors were encountered: