-
Notifications
You must be signed in to change notification settings - Fork 247
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
fix(java): module "<module name>" not found error #1906
Conversation
Struct proxies did not trigger loading of their parent module when passed as a parameter, which then causes the `@jsii/kernel` type checker to be unable to locate the struct type definition for checking pruposes, leading to a crash. This updatates the `JsiiSerializable` serialization process to proactively load the relevant modules (the call is idempotent and short circuits if the module is known to already be loaded). Fixes #1904
Labeled with |
/** | ||
* This is a struct, nested within a class. Normal. | ||
*/ | ||
export interface NestedStruct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ew... what.
Was this only triggered by nested structs for some reason? |
@MrArnoldPalmer yeah - the bottom line is that Java does not issue a The nesting might not add to the problem (but I had it to reproduce the original issue discovered, and I reckon this makes it a slightly more hostile pattern - meaning I have more chances to catch more issues with that :D). |
class loaders aren't necessarily URLClassLoaders.
48a4a86
to
de747c6
Compare
Thank you for contributing! ❤️ I will now look into making sure the PR is up-to-date, then proceed to try and merge it! |
Merging (with squash)... |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Merging (with squash)... |
Struct proxies did not trigger loading of their parent module when
passed as a parameter, which then causes the
@jsii/kernel
type checkerto be unable to locate the struct type definition for checking pruposes,
leading to a crash.
This updatates the
JsiiSerializable
serialization process toproactively load the relevant modules (the call is idempotent and short
circuits if the module is known to already be loaded).
Fixes #1904
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.