Skip to content
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

Implementing an interface from Java does not work #1003

Closed
1 of 4 tasks
skinny85 opened this issue Nov 18, 2019 · 4 comments · Fixed by #1009
Closed
1 of 4 tasks

Implementing an interface from Java does not work #1003

skinny85 opened this issue Nov 18, 2019 · 4 comments · Fixed by #1009
Labels
bug This issue is a bug.

Comments

@skinny85
Copy link
Contributor

🐛 Bug Report

Affected Languages

  • TypeScript or Javascript
  • Python
  • Java
  • .NET (C#, F#, ...)

General Information

  • JSII Version: 0.20.6
  • Platform: Darwin 186590cdb71d.ant.amazon.com 18.7.0 Darwin Kernel Version 18.7.0: Tue Aug 20 16:57:14 PDT 2019; root:xnu-4903.271.2~2/RELEASE_X86_64 x86_64

What is the problem?

import software.amazon.awscdk.core.Construct;
import software.amazon.awscdk.services.ec2.IMachineImage;
import software.amazon.awscdk.services.ec2.MachineImageConfig;
import software.amazon.awscdk.services.ec2.OperatingSystemType;

public class MyMachineImage implements IMachineImage {
    @Override
    public MachineImageConfig getImage(Construct construct) {
        return MachineImageConfig.builder()
                .imageId("ami-12345")
                .osType(OperatingSystemType.LINUX)
                .build();
    }
}

Full repro: https://github.com/rix0rrr/jsii-test-drive/tree/master/java/implement-interface

Verbose Log

[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:java (default-cli) on project implement-interface: An exception occured while executing the Java class. Resolution error: Resolution error: Resolution error: Cannot read property 'render' of undefined.
[ERROR] Object creation stack:
[ERROR]   at new LazyBase (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/lazy.js:30:44)
[ERROR]   at new LazyString (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/lazy.js:46:9)
[ERROR]   at Function.stringValue (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/lazy.js:13:39)
[ERROR]   at new AutoScalingGroup (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/aws-autoscaling/lib/auto-scaling-group.js:110:43)
[ERROR]   at obj._wrapSandboxCode (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:7741:49)
[ERROR]   at Kernel._wrapSandboxCode (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:8194:20)
[ERROR]   at Kernel._create (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:7741:26)
[ERROR]   at Kernel.create (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:7495:21)
[ERROR]   at KernelHost.processRequest (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:7285:28)
[ERROR]   at KernelHost.run (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:7225:14)
[ERROR]   at Immediate.setImmediate [as _onImmediate] (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:7228:37)
[ERROR]   at runCallback (timers.js:705:18)
[ERROR]   at tryOnImmediate (timers.js:676:5)
[ERROR]   at processImmediate (timers.js:658:5).
[ERROR] Object creation stack:
[ERROR]   at new Intrinsic (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/private/intrinsic.js:20:44)
[ERROR]   at new PostResolveToken (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/util.js:72:9)
[ERROR]   at Object.ignoreEmpty (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/util.js:32:12)
[ERROR]   at CfnLaunchConfiguration._toCloudFormation (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/cfn-resource.js:197:44)
[ERROR]   at tokens.push.resolve_1.findTokens (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/stack.js:740:76)
[ERROR]   at Object.findTokens (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/private/resolve.js:126:13)
[ERROR]   at Stack.findTokens (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/stack.js:740:42)
[ERROR]   at Stack.prepare (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/stack.js:452:29)
[ERROR]   at Function.prepare (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/construct.js:87:27)
[ERROR]   at Function.synth (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/construct.js:51:14)
[ERROR]   at App.synth (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/app.js:71:52)
[ERROR]   at _wrapSandboxCode (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:7574:51)
[ERROR]   at Kernel._wrapSandboxCode (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:8194:20)
[ERROR]   at ret._ensureSync (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:7574:25)
[ERROR]   at Kernel._ensureSync (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:8170:20)
[ERROR]   at Kernel.invoke (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:7573:26)
[ERROR]   at KernelHost.processRequest (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:7285:28)
[ERROR]   at KernelHost.run (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:7225:14)
[ERROR]   at Immediate.setImmediate [as _onImmediate] (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:7228:37)
[ERROR]   at runCallback (timers.js:705:18)
[ERROR]   at tryOnImmediate (timers.js:676:5)
[ERROR]   at processImmediate (timers.js:658:5).
[ERROR] Object creation stack:
[ERROR]   at new Intrinsic (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/private/intrinsic.js:20:44)
[ERROR]   at new PostResolveToken (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/util.js:72:9)
[ERROR]   at CfnLaunchConfiguration._toCloudFormation (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/cfn-resource.js:195:39)
[ERROR]   at tokens.push.resolve_1.findTokens (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/stack.js:740:76)
[ERROR]   at Object.findTokens (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/private/resolve.js:126:13)
[ERROR]   at Stack.findTokens (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/stack.js:740:42)
[ERROR]   at Stack.prepare (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/stack.js:452:29)
[ERROR]   at Function.prepare (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/construct.js:87:27)
[ERROR]   at Function.synth (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/construct.js:51:14)
[ERROR]   at App.synth (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/app.js:71:52)
[ERROR]   at _wrapSandboxCode (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:7574:51)
[ERROR]   at Kernel._wrapSandboxCode (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:8194:20)
[ERROR]   at ret._ensureSync (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:7574:25)
[ERROR]   at Kernel._ensureSync (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:8170:20)
[ERROR]   at Kernel.invoke (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:7573:26)
[ERROR]   at KernelHost.processRequest (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:7285:28)
[ERROR]   at KernelHost.run (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:7225:14)
[ERROR]   at Immediate.setImmediate [as _onImmediate] (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:7228:37)
[ERROR]   at runCallback (timers.js:705:18)
[ERROR]   at tryOnImmediate (timers.js:676:5)
[ERROR]   at processImmediate (timers.js:658:5)
[ERROR] TypeError: Resolution error: Resolution error: Resolution error: Cannot read property 'render' of undefined.
[ERROR] Object creation stack:
[ERROR]   at new LazyBase (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/lazy.js:30:44)
[ERROR]   at new LazyString (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/lazy.js:46:9)
[ERROR]   at Function.stringValue (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/lazy.js:13:39)
[ERROR]   at new AutoScalingGroup (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/aws-autoscaling/lib/auto-scaling-group.js:110:43)
[ERROR]   at obj._wrapSandboxCode (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:7741:49)
[ERROR]   at Kernel._wrapSandboxCode (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:8194:20)
[ERROR]   at Kernel._create (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:7741:26)
[ERROR]   at Kernel.create (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:7495:21)
[ERROR]   at KernelHost.processRequest (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:7285:28)
[ERROR]   at KernelHost.run (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:7225:14)
[ERROR]   at Immediate.setImmediate [as _onImmediate] (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:7228:37)
[ERROR]   at runCallback (timers.js:705:18)
[ERROR]   at tryOnImmediate (timers.js:676:5)
[ERROR]   at processImmediate (timers.js:658:5).
[ERROR] Object creation stack:
[ERROR]   at new Intrinsic (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/private/intrinsic.js:20:44)
[ERROR]   at new PostResolveToken (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/util.js:72:9)
[ERROR]   at Object.ignoreEmpty (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/util.js:32:12)
[ERROR]   at CfnLaunchConfiguration._toCloudFormation (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/cfn-resource.js:197:44)
[ERROR]   at tokens.push.resolve_1.findTokens (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/stack.js:740:76)
[ERROR]   at Object.findTokens (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/private/resolve.js:126:13)
[ERROR]   at Stack.findTokens (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/stack.js:740:42)
[ERROR]   at Stack.prepare (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/stack.js:452:29)
[ERROR]   at Function.prepare (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/construct.js:87:27)
[ERROR]   at Function.synth (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/construct.js:51:14)
[ERROR]   at App.synth (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/app.js:71:52)
[ERROR]   at _wrapSandboxCode (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:7574:51)
[ERROR]   at Kernel._wrapSandboxCode (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:8194:20)
[ERROR]   at ret._ensureSync (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:7574:25)
[ERROR]   at Kernel._ensureSync (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:8170:20)
[ERROR]   at Kernel.invoke (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:7573:26)
[ERROR]   at KernelHost.processRequest (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:7285:28)
[ERROR]   at KernelHost.run (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:7225:14)
[ERROR]   at Immediate.setImmediate [as _onImmediate] (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:7228:37)
[ERROR]   at runCallback (timers.js:705:18)
[ERROR]   at tryOnImmediate (timers.js:676:5)
[ERROR]   at processImmediate (timers.js:658:5).
[ERROR] Object creation stack:
[ERROR]   at new Intrinsic (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/private/intrinsic.js:20:44)
[ERROR]   at new PostResolveToken (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/util.js:72:9)
[ERROR]   at CfnLaunchConfiguration._toCloudFormation (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/cfn-resource.js:195:39)
[ERROR]   at tokens.push.resolve_1.findTokens (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/stack.js:740:76)
[ERROR]   at Object.findTokens (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/private/resolve.js:126:13)
[ERROR]   at Stack.findTokens (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/stack.js:740:42)
[ERROR]   at Stack.prepare (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/stack.js:452:29)
[ERROR]   at Function.prepare (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/construct.js:87:27)
[ERROR]   at Function.synth (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/construct.js:51:14)
[ERROR]   at App.synth (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/app.js:71:52)
[ERROR]   at _wrapSandboxCode (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:7574:51)
[ERROR]   at Kernel._wrapSandboxCode (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:8194:20)
[ERROR]   at ret._ensureSync (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:7574:25)
[ERROR]   at Kernel._ensureSync (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:8170:20)
[ERROR]   at Kernel.invoke (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:7573:26)
[ERROR]   at KernelHost.processRequest (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:7285:28)
[ERROR]   at KernelHost.run (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:7225:14)
[ERROR]   at Immediate.setImmediate [as _onImmediate] (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:7228:37)
[ERROR]   at runCallback (timers.js:705:18)
[ERROR]   at tryOnImmediate (timers.js:676:5)
[ERROR]   at processImmediate (timers.js:658:5)
[ERROR]     at Object.produce (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/aws-autoscaling/lib/auto-scaling-group.js:110:103)
[ERROR]     at LazyString.resolve (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/lazy.js:50:30)
[ERROR]     at RememberingTokenResolver.resolveToken (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/resolvable.js:39:30)
[ERROR]     at RememberingTokenResolver.resolveToken (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/private/resolve.js:140:22)
[ERROR]     at resolve (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/private/resolve.js:94:33)
[ERROR]     at Object.resolve [as mapToken] (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/private/resolve.js:28:33)
[ERROR]     at TokenizedStringFragments.mapTokens (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/string-fragments.js:56:43)
[ERROR]     at RememberingTokenResolver.resolveString (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/resolvable.js:58:26)
[ERROR]     at RememberingTokenResolver.resolveString (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-kernel-cXFEt9/node_modules/@aws-cdk/core/lib/private/resolve.js:143:27)
[ERROR]     at Kernel._wrapSandboxCode (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:8197:19)
[ERROR]     at ret._ensureSync (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:7574:25)
[ERROR]     at Kernel._ensureSync (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:8170:20)
[ERROR]     at Kernel.invoke (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:7573:26)
[ERROR]     at KernelHost.processRequest (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:7285:28)
[ERROR]     at KernelHost.run (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:7225:14)
[ERROR]     at Immediate.setImmediate [as _onImmediate] (/private/var/folders/gl/mhgz0kz11lqgc0dklyry83xnyfk1zw/T/jsii-java-runtime4113182848482488597/jsii-runtime.js:7228:37)
[ERROR]     at runCallback (timers.js:705:18)
[ERROR]     at tryOnImmediate (timers.js:676:5)
[ERROR]     at processImmediate (timers.js:658:5)
@skinny85 skinny85 added the bug This issue is a bug. label Nov 18, 2019
@RomainMuller
Copy link
Contributor

The interface implementation needs to inherit from JsiiObject here (there is otherwise no way to track it's ObjectID once it was sent to JS-land). We needto make sure this gets documented.

Additionally, the constructor should look like:

public MyMachineImage() {
    super(InitializationMode.JSII);
   JsiiEngine.getInstance().createNewObject(this);
}

However even when adding this, it does not work (and it registers a number of overrides it shouldn't be registering). There appears to be a bug in that interface discovery is not performed at all here...

@RomainMuller
Copy link
Contributor

Actually - scratch the previous comment about having to descend from JsiiObject - this is in fact not necessary.

@RomainMuller
Copy link
Contributor

Also it looks this bug can only trigger because of the presence of another bug (which has already been fixed, but is yet to release).

RomainMuller added a commit that referenced this issue Nov 19, 2019
When moving out of callbacks, the result was not turned into a reference
before being passed out to the jsii kernel, causing TypeErrors when
attempting to turn structs (and probably other non-primitive types) to
JSON.

Discovered while attempting to reproduce #1003, which can no longer
trigger as it depended on returning a Struct through and `any` and being
hit with the bug fixed in #997... the fix also removed the conditions
that make leveraging the cause possible (or at the very least I could
not come up with a reproduction, and have verified that the original bug
report no longer reproduces once #997 is in).

That being said, still introduced the necessary changes to address the
cause by properly discovering interfaces and adding the relevant
overrides filtering, as this may improve the performance and reliability
of the jsii runtime for Java.

Fixes #1003
RomainMuller added a commit that referenced this issue Nov 19, 2019
When moving out of callbacks, the result was not turned into a reference
before being passed out to the jsii kernel, causing TypeErrors when
attempting to turn structs (and probably other non-primitive types) to
JSON.

Discovered while attempting to reproduce #1003, which can no longer
trigger as it depended on returning a Struct through and `any` and being
hit with the bug fixed in #997... the fix also removed the conditions
that make leveraging the cause possible (or at the very least I could
not come up with a reproduction, and have verified that the original bug
report no longer reproduces once #997 is in).

That being said, still introduced the necessary changes to address the
cause by properly discovering interfaces and adding the relevant
overrides filtering, as this may improve the performance and reliability
of the jsii runtime for Java.

Fixes #1003
@skinny85
Copy link
Contributor Author

Confirming this is fixed in 1.17.0 and 0.20.7. Resolving.

mergify bot pushed a commit that referenced this issue Nov 28, 2019
* fix(python): correctly handle structs out of callbacks

When moving out of callbacks, the result was not turned into a reference
before being passed out to the jsii kernel, causing TypeErrors when
attempting to turn structs (and probably other non-primitive types) to
JSON.

Discovered while attempting to reproduce #1003, which can no longer
trigger as it depended on returning a Struct through and `any` and being
hit with the bug fixed in #997... the fix also removed the conditions
that make leveraging the cause possible (or at the very least I could
not come up with a reproduction, and have verified that the original bug
report no longer reproduces once #997 is in).

That being said, still introduced the necessary changes to address the
cause by properly discovering interfaces and adding the relevant
overrides filtering, as this may improve the performance and reliability
of the jsii runtime for Java.

Fixes #1003

* improve documentation & test coverage

* fixup

* inline-fy doc

* remove spurious 'final'

* Add missing fget

* add type annotation to make MyPy happy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants