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

cloud-assembly-schema: MetadataEntryData type missing boolean | number #4742

Closed
1 task done
matusfaro opened this issue Jan 4, 2025 · 8 comments · Fixed by cdklabs/cloud-assembly-schema#121
Closed
1 task done
Assignees
Labels
bug This issue is a bug. effort/medium Medium work item – a couple days of effort p1 potential-regression Marking this issue as a potential regression to be checked by team member

Comments

@matusfaro
Copy link

matusfaro commented Jan 4, 2025

Describe the bug

Bumping to latest dependencies and going from cloud schema 36.0.0 to 38.0.1, I get the following error:

[ERROR] Failed to execute goal io.dataspray:aws-cdk-maven-plugin:2.3.1-SNAPSHOT:synth (run-cdk-synth) on project dataspray-package:
   Unable to initialize interface proxy software.amazon.awscdk.cloud_assembly_schema.AssemblyManifest.Jsii$Proxy: InvocationTargetException:
   Unable to initialize interface proxy software.amazon.awscdk.cloud_assembly_schema.ArtifactManifest.Jsii$Proxy:
   Unable to initialize interface proxy software.amazon.awscdk.cloud_assembly_schema.MetadataEntry.Jsii$Proxy: Of property Object.data:
   Unable to serialize value as string | aws-cdk-lib.cloud_assembly_schema.FileAssetMetadataEntry | aws-cdk-lib.cloud_assembly_schema.ContainerImageAssetMetadataEntry | array<aws-cdk-lib.cloud_assembly_schema.Tag> | undefined
[ERROR] ├── 🛑 Failing value is a boolean
[ERROR] │      true
[ERROR] ╰── 🔍 Failure reason(s):
[ERROR]     ├─ [as string] Value is not a string
[ERROR]     ├─ [as array<aws-cdk-lib.cloud_assembly_schema.Tag>] Value is not an array
[ERROR]     ├─ [as aws-cdk-lib.cloud_assembly_schema.FileAssetMetadataEntry] Value is not an object
[ERROR]     ╰─ [as aws-cdk-lib.cloud_assembly_schema.ContainerImageAssetMetadataEntry] Value is not an object
[ERROR] @jsii/kernel.SerializationError: Of property Object.data: Unable to serialize value as string | aws-cdk-lib.cloud_assembly_schema.FileAssetMetadataEntry | aws-cdk-lib.cloud_assembly_schema.ContainerImageAssetMetadataEntry | array<aws-cdk-lib.cloud_assembly_schema.Tag> | undefined
[ERROR] ├── 🛑 Failing value is a boolean
[ERROR] │      true
[ERROR] ╰── 🔍 Failure reason(s):
[ERROR]     ├─ [as string] Value is not a string
[ERROR]     ├─ [as array<aws-cdk-lib.cloud_assembly_schema.Tag>] Value is not an array
[ERROR]     ├─ [as aws-cdk-lib.cloud_assembly_schema.FileAssetMetadataEntry] Value is not an object
[ERROR]     ╰─ [as aws-cdk-lib.cloud_assembly_schema.ContainerImageAssetMetadataEntry] Value is not an object
[ERROR]     at Object.process (/private/var/folders/jk/0lz5v5jj33g0p8x5xmyhvwz80000gn/T/jsii-java-runtime1036786840231922344/lib/program.js:10485:19)
[ERROR]     at Kernel._Kernel_fromSandbox (/private/var/folders/jk/0lz5v5jj33g0p8x5xmyhvwz80000gn/T/jsii-java-runtime1036786840231922344/lib/program.js:9465:25)
[ERROR]     at Kernel.get (/private/var/folders/jk/0lz5v5jj33g0p8x5xmyhvwz80000gn/T/jsii-java-runtime1036786840231922344/lib/program.js:8846:103)
[ERROR]     at KernelHost.processRequest (/private/var/folders/jk/0lz5v5jj33g0p8x5xmyhvwz80000gn/T/jsii-java-runtime1036786840231922344/lib/program.js:10715:36)
[ERROR]     at KernelHost.run (/private/var/folders/jk/0lz5v5jj33g0p8x5xmyhvwz80000gn/T/jsii-java-runtime1036786840231922344/lib/program.js:10675:22)
[ERROR]     at Immediate._onImmediate (/private/var/folders/jk/0lz5v5jj33g0p8x5xmyhvwz80000gn/T/jsii-java-runtime1036786840231922344/lib/program.js:10676:46)
[ERROR]     at process.processImmediate (node:internal/timers:478:21)

Notice that the data type is expected to be string | aws-cdk-lib.cloud_assembly_schema.FileAssetMetadataEntry | aws-cdk-lib.cloud_assembly_schema.ContainerImageAssetMetadataEntry | array<aws-cdk-lib.cloud_assembly_schema.Tag> | undefined.

This is because as part of the change introduced here:

expr.directCode(`this.addMetadata('${CUSTOM_RESOURCE_SINGLETON}', true)`),
expr.directCode(`this.addMetadata('${CUSTOM_RESOURCE_RUNTIME_FAMILY}', this.runtime.family)`),

The value of the data field may now be a number and boolean. But the type defined in cloud schema MetadataEntryType is not updated with these types here

export type MetadataEntryData =
  | AssetMetadataEntry // FileAssetMetadataEntry | ContainerImageAssetMetadataEntry
  | LogMessageMetadataEntry // string
  | LogicalIdMetadataEntry // string
  | StackTagsMetadataEntry; // Tag[]

Notice these are the types from the error message.

Below is a snippet of the generated manifest.json with this issue:

...
        "/dataspray-site-landing-test/Custom::CDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C": [
          {
            "type": "aws:cdk:is-custom-resource-handler-singleton",
            "data": true
          },
          {
            "type": "aws:cdk:is-custom-resource-handler-runtime-family",
            "data": 2
          },
          {
            "type": "aws:cdk:is-custom-resource-handler-singleton",
            "data": true
          },
          {
            "type": "aws:cdk:is-custom-resource-handler-runtime-family",
            "data": 2
          }
        ],
...

Note that aws:cdk:is-custom-resource-handler-singleton matches the CUSTOM_RESOURCE_SINGLETON above and aws:cdk:is-custom-resource-handler-runtime-family matches the CUSTOM_RESOURCE_RUNTIME_FAMILY above.

Regression Issue

  • Select this option if this issue appears to be a regression.

Last Known Working CDK Version

CDK 2.134.0 Cloud Assembly 36.0.6

Expected Behavior

Shouldn't fail. Expected the generated manifest.json to be read properly.

Current Behavior

Fails with error.

Reproduction Steps

It's difficult to create a self-contained snippet for reproduction. It's unclear to me what conditions are met for the metadata entries to be generated.

Possible Solution

Add missing types to MetadataEntryData

Additional Information/Context

No response

CDK CLI Version

N/A

Framework Version

No response

Node.js Version

v20.11.0

OS

osx

Language

Java

Language Version

21.0.1-graalce

Other information

No response

@matusfaro matusfaro added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jan 4, 2025
@github-actions github-actions bot added the potential-regression Marking this issue as a potential regression to be checked by team member label Jan 4, 2025
@matusfaro matusfaro changed the title cloud-assembly-schema: MetadataEntry cloud-assembly-schema: MetadataEntryData type missing boolean | number Jan 4, 2025
@ashishdhingra
Copy link
Contributor

@matusfaro Good morning. Thanks for opening the issue. You mentioned that the issue was likely introduced as part of the change introduced here. This change was made 5 months ago, but we haven't got any reports of regression until now. By definition of potential regression, the issue should likely be introduced in recently released version of CDK, which was working in last (or may be few versions, let's day 4-5 versions, in the past). Please share the CDK (CLI and Lib) version used.

In order to reproduce the issue, please share the minimal self contained CDK code that reproduces the issue and demonstrates upgrading cloud schema from 36.0.0 to 38.0.1. I will try to investigate the issue further as much as possible.

Thanks,
Ashish

@ashishdhingra ashishdhingra added p2 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed needs-triage This issue or PR still needs to be triaged. labels Jan 6, 2025
@ashishdhingra ashishdhingra self-assigned this Jan 6, 2025
@matusfaro
Copy link
Author

matusfaro commented Jan 6, 2025

Hi @ashishdhingra

Here's a simple self-contained repro in Groovy.

Honestly I am not sure why I am the first one to hit this, it could be for a combination of reasons:

  • Manifest.loadAssemblyManifest is not typical usage, I'm using it as part of tooling around CDK for a Maven plugin
  • The specific conditions that create the unsupported value could be rare.
  • It may be specific to Java/JVM languages only
@Grab(group = 'software.amazon.awscdk', module = 'aws-cdk-lib', version = '2.173.4')
@Grab(group = 'com.fasterxml.jackson.core', module = 'jackson-databind', version = '2.15.2')
@Grab(group = 'software.amazon.awscdk', module = 'cdk-cloud-assembly-schema', version = '39.1.35')

import software.amazon.awscdk.App
import software.amazon.awscdk.Stack
import software.amazon.awscdk.services.s3.Bucket
import software.amazon.awscdk.services.s3.deployment.BucketDeployment
import software.amazon.awscdk.cloud_assembly_schema.AssemblyManifest
import software.amazon.awscdk.cloud_assembly_schema.Manifest

class MyStack extends Stack {
    MyStack(scope, String id) {
        super(scope, id)
        Bucket destinationBucket = Bucket.Builder.create(this, "MyBucket")
                .bucketName("my-deployment-bucket")
                .build()
        BucketDeployment.Builder.create(this, "MyBucketDeployment")
                .sources(List.of())
                .destinationBucket(destinationBucket)
                .build()
    }
}

def app = new App()
new MyStack(app, "MyStack")
def assembly = app.synth()

println "Created manifest.json:"
def manifestPath = "${assembly.directory}/manifest.json"
println manifestPath

// Read and print the manifest file content
def manifestFile = new File(manifestPath)
println manifestFile.text

// Parse the manifest
// THIS WILL FAIL
AssemblyManifest assemblyLoaded = Manifest.loadAssemblyManifest(manifestPath)
println assemblyLoaded

Outputs:

Created manifest.json:
/private/var/folders/jk/0lz5v5jj33g0p8x5xmyhvwz80000gn/T/cdk.outmT35fj/manifest.json
{
  "version": "39.0.0",
  "artifacts": {
    "MyStack.assets": {
      "type": "cdk:asset-manifest",
      "properties": {
        "file": "MyStack.assets.json",
        "requiresBootstrapStackVersion": 6,
        "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version"
      }
    },
    "MyStack": {
      "type": "aws:cloudformation:stack",
      "environment": "aws://unknown-account/unknown-region",
      "properties": {
        "templateFile": "MyStack.template.json",
        "terminationProtection": false,
        "validateOnSynth": false,
        "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
        "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
        "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/f764fa2f4bf23187f9bf0881d792057f45a9e9fca0e575c6ddfb51b0e1f7f229.json",
        "requiresBootstrapStackVersion": 6,
        "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
        "additionalDependencies": [
          "MyStack.assets"
        ],
        "lookupRole": {
          "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}",
          "requiresBootstrapStackVersion": 8,
          "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version"
        }
      },
      "dependencies": [
        "MyStack.assets"
      ],
      "metadata": {
        "/MyStack/MyBucket/Resource": [
          {
            "type": "aws:cdk:logicalId",
            "data": "MyBucketF68F3FF0"
          }
        ],
        "/MyStack/MyBucketDeployment/AwsCliLayer/Resource": [
          {
            "type": "aws:cdk:logicalId",
            "data": "MyBucketDeploymentAwsCliLayer7DA0F120"
          }
        ],
        "/MyStack/MyBucketDeployment/CustomResource/Default": [
          {
            "type": "aws:cdk:logicalId",
            "data": "MyBucketDeploymentCustomResource24ED237B"
          }
        ],
        "/MyStack/Custom::CDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C": [
          {
            "type": "aws:cdk:is-custom-resource-handler-singleton",
            "data": true
          },
          {
            "type": "aws:cdk:is-custom-resource-handler-runtime-family",
            "data": 2
          }
        ],
        "/MyStack/Custom::CDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C/ServiceRole/Resource": [
          {
            "type": "aws:cdk:logicalId",
            "data": "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRole89A01265"
          }
        ],
        "/MyStack/Custom::CDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C/ServiceRole/DefaultPolicy/Resource": [
          {
            "type": "aws:cdk:logicalId",
            "data": "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRoleDefaultPolicy88902FDF"
          }
        ],
        "/MyStack/Custom::CDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C/Resource": [
          {
            "type": "aws:cdk:logicalId",
            "data": "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C81C01536"
          }
        ],
        "/MyStack/BootstrapVersion": [
          {
            "type": "aws:cdk:logicalId",
            "data": "BootstrapVersion"
          }
        ],
        "/MyStack/CheckBootstrapVersion": [
          {
            "type": "aws:cdk:logicalId",
            "data": "CheckBootstrapVersion"
          }
        ]
      },
      "displayName": "MyStack"
    },
    "Tree": {
      "type": "cdk:tree",
      "properties": {
        "file": "tree.json"
      }
    }
  }
}
Caught: software.amazon.jsii.JsiiError: Unable to initialize interface proxy software.amazon.awscdk.cloud_assembly_schema.AssemblyManifest.Jsii$Proxy
software.amazon.jsii.JsiiError: Unable to initialize interface proxy software.amazon.awscdk.cloud_assembly_schema.AssemblyManifest.Jsii$Proxy
        at software.amazon.jsii.JsiiObject.asInterfaceProxy(JsiiObject.java:385)
        at software.amazon.jsii.NativeType$SimpleNativeType.transform(NativeType.java:157)
        at software.amazon.jsii.JsiiObjectMapper.treeToValue(JsiiObjectMapper.java:47)
        at software.amazon.jsii.JsiiObject.jsiiStaticCall(JsiiObject.java:188)
        at software.amazon.jsii.JsiiObject.jsiiStaticCall(JsiiObject.java:166)
        at software.amazon.awscdk.cloud_assembly_schema.Manifest.loadAssemblyManifest(Manifest.java:37)
        at repro.run(repro.groovy:40)
Caused by: java.lang.reflect.InvocationTargetException
        at software.amazon.jsii.JsiiObject.asInterfaceProxy(JsiiObject.java:377)
        ... 6 more
Caused by: software.amazon.jsii.JsiiError: Unable to initialize interface proxy software.amazon.awscdk.cloud_assembly_schema.ArtifactManifest.Jsii$Proxy
        at software.amazon.jsii.JsiiObject.asInterfaceProxy(JsiiObject.java:385)
        at software.amazon.jsii.NativeType$SimpleNativeType.transform(NativeType.java:157)
        at software.amazon.jsii.NativeType$MapNativeType.lambda$transform$0(NativeType.java:209)
        at software.amazon.jsii.NativeType$MapNativeType.transform(NativeType.java:207)
        at software.amazon.jsii.NativeType$MapNativeType.transform(NativeType.java:186)
        at software.amazon.jsii.JsiiObjectMapper.treeToValue(JsiiObjectMapper.java:47)
        at software.amazon.jsii.Kernel.get(Kernel.java:73)
        at software.amazon.awscdk.cloud_assembly_schema.AssemblyManifest$Jsii$Proxy.<init>(AssemblyManifest.java:223)
        ... 7 more
Caused by: java.lang.reflect.InvocationTargetException
        at software.amazon.jsii.JsiiObject.asInterfaceProxy(JsiiObject.java:377)
        ... 14 more
Caused by: software.amazon.jsii.JsiiError: Unable to initialize interface proxy software.amazon.awscdk.cloud_assembly_schema.MetadataEntry.Jsii$Proxy
        at software.amazon.jsii.JsiiObject.asInterfaceProxy(JsiiObject.java:385)
        at software.amazon.jsii.NativeType$SimpleNativeType.transform(NativeType.java:157)
        at software.amazon.jsii.NativeType$ListNativeType.transform(NativeType.java:182)
        at software.amazon.jsii.NativeType$ListNativeType.transform(NativeType.java:164)
        at software.amazon.jsii.NativeType$MapNativeType.lambda$transform$0(NativeType.java:209)
        at software.amazon.jsii.NativeType$MapNativeType.transform(NativeType.java:207)
        at software.amazon.jsii.NativeType$MapNativeType.transform(NativeType.java:186)
        at software.amazon.jsii.JsiiObjectMapper.treeToValue(JsiiObjectMapper.java:47)
        at software.amazon.jsii.Kernel.get(Kernel.java:73)
        at software.amazon.awscdk.cloud_assembly_schema.ArtifactManifest$Jsii$Proxy.<init>(ArtifactManifest.java:277)
        ... 15 more
Caused by: java.lang.reflect.InvocationTargetException
        at software.amazon.jsii.JsiiObject.asInterfaceProxy(JsiiObject.java:377)
        ... 24 more
Caused by: software.amazon.jsii.JsiiError: Of property Object.data: Unable to serialize value as string | aws-cdk-lib.cloud_assembly_schema.FileAssetMetadataEntry | aws-cdk-lib.cloud_assembly_schema.ContainerImageAssetMetadataEntry | array<aws-cdk-lib.cloud_assembly_schema.Tag> | undefined
├── 🛑 Failing value is a boolean
│      true
╰── 🔍 Failure reason(s):
    ├─ [as string] Value is not a string
    ├─ [as array<aws-cdk-lib.cloud_assembly_schema.Tag>] Value is not an array
    ├─ [as aws-cdk-lib.cloud_assembly_schema.FileAssetMetadataEntry] Value is not an object
    ╰─ [as aws-cdk-lib.cloud_assembly_schema.ContainerImageAssetMetadataEntry] Value is not an object
@jsii/kernel.SerializationError: Of property Object.data: Unable to serialize value as string | aws-cdk-lib.cloud_assembly_schema.FileAssetMetadataEntry | aws-cdk-lib.cloud_assembly_schema.ContainerImageAssetMetadataEntry | array<aws-cdk-lib.cloud_assembly_schema.Tag> | undefined
├── 🛑 Failing value is a boolean
│      true
╰── 🔍 Failure reason(s):
    ├─ [as string] Value is not a string
    ├─ [as array<aws-cdk-lib.cloud_assembly_schema.Tag>] Value is not an array
    ├─ [as aws-cdk-lib.cloud_assembly_schema.FileAssetMetadataEntry] Value is not an object
    ╰─ [as aws-cdk-lib.cloud_assembly_schema.ContainerImageAssetMetadataEntry] Value is not an object
    at Object.process (/private/var/folders/jk/0lz5v5jj33g0p8x5xmyhvwz80000gn/T/jsii-java-runtime3897964670663448121/lib/program.js:10486:19)
    at Kernel._Kernel_fromSandbox (/private/var/folders/jk/0lz5v5jj33g0p8x5xmyhvwz80000gn/T/jsii-java-runtime3897964670663448121/lib/program.js:9466:25)
    at Kernel.get (/private/var/folders/jk/0lz5v5jj33g0p8x5xmyhvwz80000gn/T/jsii-java-runtime3897964670663448121/lib/program.js:8846:103)
    at KernelHost.processRequest (/private/var/folders/jk/0lz5v5jj33g0p8x5xmyhvwz80000gn/T/jsii-java-runtime3897964670663448121/lib/program.js:10718:36)
    at KernelHost.run (/private/var/folders/jk/0lz5v5jj33g0p8x5xmyhvwz80000gn/T/jsii-java-runtime3897964670663448121/lib/program.js:10678:22)
    at Immediate._onImmediate (/private/var/folders/jk/0lz5v5jj33g0p8x5xmyhvwz80000gn/T/jsii-java-runtime3897964670663448121/lib/program.js:10679:46)
    at process.processImmediate (node:internal/timers:478:21)
        at software.amazon.jsii.JsiiRuntime.processErrorResponse(JsiiRuntime.java:150)
        at software.amazon.jsii.JsiiRuntime.requestResponse(JsiiRuntime.java:116)
        at software.amazon.jsii.JsiiClient.getPropertyValue(JsiiClient.java:112)
        at software.amazon.jsii.Kernel.get(Kernel.java:72)
        at software.amazon.awscdk.cloud_assembly_schema.MetadataEntry$Jsii$Proxy.<init>(MetadataEntry.java:163)
        ... 25 more

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Jan 7, 2025
@ashishdhingra
Copy link
Contributor

ashishdhingra commented Jan 7, 2025

@matusfaro Good afternoon. Thanks for sharing the code. Ignoring details about language used (Groovy in your case), this appears to be JSII issue.

  • Tried testing using TypeScript and it appears to work fine.
TypeScript example

lib/cdktest-stack-new.ts

import * as cdk from 'aws-cdk-lib';
import * as s3 from 'aws-cdk-lib/aws-s3';
import * as s3deployment from 'aws-cdk-lib/aws-s3-deployment';

export class CdktestStackNew extends cdk.Stack {
  constructor(scope: cdk.App, id: string, props?: cdk.StackProps) {
    super(scope, id, props);

    const destinationBucket = new s3.Bucket(this, 'MyBucket', {
      removalPolicy: cdk.RemovalPolicy.DESTROY
    });

    new s3deployment.BucketDeployment(this, 'MyBucketDeployment', {
      sources: [],
      destinationBucket: destinationBucket
    });
  }
}

bin/cdktest.ts

#!/usr/bin/env node
import 'source-map-support/register';
import * as cdk from 'aws-cdk-lib';
import { CdktestStackNew } from '../lib/cdktest-stack-new';
import * as fs from 'fs';
import * as cloudAssemblySchema from '@aws-cdk/cloud-assembly-schema';

const app = new cdk.App();

new CdktestStackNew(app, 'CdktestStackNew', {
  env: { account: process.env.CDK_DEFAULT_ACCOUNT, region: process.env.CDK_DEFAULT_REGION },
});

const assembly = app.synth();

const manifestPath = `${assembly.directory}/manifest.json`;
console.log(`manifestPath: ${manifestPath}`);

const manifestFile = fs.readFile(manifestPath, { encoding: 'utf-8'}, (err, data) => {
  if (err) throw err;
  console.log(data);
});

const assemblyLoaded = cloudAssemblySchema.Manifest.loadAssemblyManifest(manifestPath);
console.log(`assemblyLoaded.version: ${assemblyLoaded.version}`);

package.json

{
  "name": "cdktest",
  "version": "0.1.0",
  "bin": {
    "cdktest": "bin/cdktest.js"
  },
  "scripts": {
    "build": "tsc",
    "watch": "tsc -w",
    "test": "jest",
    "cdk": "cdk",
    "integ-test": "integ-runner"
  },
  "devDependencies": {
    "@eslint/js": "^9.14.0",
    "@types/jest": "^29.5.12",
    "@types/node": "20.14.9",
    "aws-cdk": "2.174.0",
    "eslint": "^9.14.0",
    "globals": "^15.12.0",
    "jest": "^29.7.0",
    "ts-jest": "^29.1.5",
    "ts-node": "^10.9.2",
    "typescript": "~5.5.3",
    "typescript-eslint": "^8.13.0"
  },
  "dependencies": {
    "aws-cdk-lib": "2.174.0",
    "@aws-cdk/cloud-assembly-schema": "39.1.38",
    "constructs": "^10.0.0",
    "source-map-support": "^0.5.21"
  }
}

Running cdk synth generates the below output:

manifestPath: cdk.out/manifest.json
assemblyLoaded.version: 39.0.0
{
  "version": "39.0.0",
  "artifacts": {
    "CdktestStackNew.assets": {
      "type": "cdk:asset-manifest",
      "properties": {
        "file": "CdktestStackNew.assets.json",
        "requiresBootstrapStackVersion": 6,
        "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version"
      }
    },
    "CdktestStackNew": {
      "type": "aws:cloudformation:stack",
      "environment": "aws://<<REDACTED>>/us-east-2",
      "properties": {
        "templateFile": "CdktestStackNew.template.json",
        "terminationProtection": false,
        "validateOnSynth": false,
        "assumeRoleArn": "arn:${AWS::Partition}:iam::<<REDACTED>>:role/cdk-hnb659fds-deploy-role-<<REDACTED>>-us-east-2",
        "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::<<REDACTED>>:role/cdk-hnb659fds-cfn-exec-role-<<REDACTED>>-us-east-2",
        "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-<<REDACTED>>-us-east-2/75deef435b41ff5d20aa24bb48dedd0ea8ec8d7b5d19c234c46be320efa98326.json",
        "requiresBootstrapStackVersion": 6,
        "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
        "additionalDependencies": [
          "CdktestStackNew.assets"
        ],
        "lookupRole": {
          "arn": "arn:${AWS::Partition}:iam::<<REDACTED>>:role/cdk-hnb659fds-lookup-role-<<REDACTED>>-us-east-2",
          "requiresBootstrapStackVersion": 8,
          "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version"
        }
      },
      "dependencies": [
        "CdktestStackNew.assets"
      ],
      "metadata": {
        "/CdktestStackNew/MyBucket/Resource": [
          {
            "type": "aws:cdk:logicalId",
            "data": "MyBucketF68F3FF0"
          }
        ],
        "/CdktestStackNew/MyBucketDeployment/AwsCliLayer/Resource": [
          {
            "type": "aws:cdk:logicalId",
            "data": "MyBucketDeploymentAwsCliLayer7DA0F120"
          }
        ],
        "/CdktestStackNew/MyBucketDeployment/CustomResource/Default": [
          {
            "type": "aws:cdk:logicalId",
            "data": "MyBucketDeploymentCustomResource24ED237B"
          }
        ],
        "/CdktestStackNew/Custom::CDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C": [
          {
            "type": "aws:cdk:is-custom-resource-handler-singleton",
            "data": true
          },
          {
            "type": "aws:cdk:is-custom-resource-handler-runtime-family",
            "data": 2
          }
        ],
        "/CdktestStackNew/Custom::CDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C/ServiceRole/Resource": [
          {
            "type": "aws:cdk:logicalId",
            "data": "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRole89A01265"
          }
        ],
        "/CdktestStackNew/Custom::CDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C/ServiceRole/DefaultPolicy/Resource": [
          {
            "type": "aws:cdk:logicalId",
            "data": "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRoleDefaultPolicy88902FDF"
          }
        ],
        "/CdktestStackNew/Custom::CDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C/Resource": [
          {
            "type": "aws:cdk:logicalId",
            "data": "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C81C01536"
          }
        ],
        "/CdktestStackNew/CDKMetadata/Default": [
          {
            "type": "aws:cdk:logicalId",
            "data": "CDKMetadata"
          }
        ],
        "/CdktestStackNew/BootstrapVersion": [
          {
            "type": "aws:cdk:logicalId",
            "data": "BootstrapVersion"
          }
        ],
        "/CdktestStackNew/CheckBootstrapVersion": [
          {
            "type": "aws:cdk:logicalId",
            "data": "CheckBootstrapVersion"
          }
        ]
      },
      "displayName": "CdktestStackNew"
    },
    "Tree": {
      "type": "cdk:tree",
      "properties": {
        "file": "tree.json"
      }
    }
  }
}
Resources:
  MyBucketF68F3FF0:
    Type: AWS::S3::Bucket
    Properties:
...
  MyBucketDeploymentAwsCliLayer7DA0F120:
    Type: AWS::Lambda::LayerVersion
    Properties:
...
  MyBucketDeploymentCustomResource24ED237B:
    Type: Custom::CDKBucketDeployment
    Properties:
  ...
  CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRole89A01265:
    Type: AWS::IAM::Role
    Properties:
 ...CdktestStackNew/Custom::CDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C/ServiceRole/Resource
  CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRoleDefaultPolicy88902FDF:
    Type: AWS::IAM::Policy
    Properties:
      PolicyDocument:
...
      PolicyName: CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRoleDefaultPolicy88902FDF
      Roles:
        - Ref: CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRole89A01265
    Metadata:
      aws:cdk:path: CdktestStackNew/Custom::CDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C/ServiceRole/DefaultPolicy/Resource
  CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C81C01536:
    Type: AWS::Lambda::Function
    Properties:
...
  • Tried testing using Java and it fails.
    • First used built in AssemblyManifest and Manifest classes from software.amazon.awscdk.cloud_assembly_schema namespace in aws-cdk-lib (customer's scenario).
    • Then used from software.amazon.awscdk.cloudassembly.schema in cdk-cloud-assembly-schema version 39.1.38.
Java example

CdktestjavaStack.java

package com.myorg;

import software.constructs.Construct;
import software.amazon.awscdk.Stack;
import software.amazon.awscdk.StackProps;
import software.amazon.awscdk.services.s3.Bucket;
import software.amazon.awscdk.services.s3.deployment.BucketDeployment;

import java.util.List;

public class CdktestjavaStack extends Stack {
    public CdktestjavaStack(final Construct scope, final String id) {
        this(scope, id, null);
    }

    public CdktestjavaStack(final Construct scope, final String id, final StackProps props) {
        super(scope, id, props);

        Bucket destinationBucket = Bucket.Builder.create(this, "MyBucket")
                .bucketName("my-deployment-bucket")
                .build();

        BucketDeployment.Builder.create(this, "MyBucketDeployment")
                .sources(List.of())
                .destinationBucket(destinationBucket)
                .build();
    }
}

CdktestjavaApp.java

package com.myorg;

import software.amazon.awscdk.App;
import software.amazon.awscdk.Environment;
import software.amazon.awscdk.StackProps;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;

import software.amazon.awscdk.cloudassembly.schema.AssemblyManifest;
import software.amazon.awscdk.cloudassembly.schema.Manifest;
import software.amazon.awscdk.cxapi.CloudAssembly;

public class CdktestjavaApp {
    public static void main(final String[] args) {
        App app = new App();

        new CdktestjavaStack(app, "CdktestjavaStack", StackProps.builder()
                .env(Environment.builder()
                        .account(System.getenv("CDK_DEFAULT_ACCOUNT"))
                        .region(System.getenv("CDK_DEFAULT_REGION"))
                        .build())
                .build());

        CloudAssembly assembly = app.synth();

        System.out.println("Created manifest.json: ");
        String manifestPath = assembly.getDirectory() + "/manifest.json";
        System.out.println(manifestPath);

        File manifestFile = new File(manifestPath);
        try {
            Scanner sc = new Scanner(manifestFile);

            while (sc.hasNextLine())
                System.out.println(sc.nextLine());
        } catch (FileNotFoundException e) {}

        AssemblyManifest assemblyLoaded = Manifest.loadAssemblyManifest(manifestPath);
        System.out.println(assemblyLoaded.getVersion());
    }
}

pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
         xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.myorg</groupId>
    <artifactId>cdktestjava</artifactId>
    <version>0.1</version>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <cdk.version>2.174.0</cdk.version>
        <constructs.version>[10.0.0,11.0.0)</constructs.version>
        <junit.version>5.7.1</junit.version>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.11.0</version>
                <configuration>
                    <release>11</release>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>3.1.0</version>
                <configuration>
                    <mainClass>com.myorg.CdktestjavaApp</mainClass>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <!-- AWS Cloud Development Kit -->
        <dependency>
            <groupId>software.amazon.awscdk</groupId>
            <artifactId>cdk-cloud-assembly-schema</artifactId>
            <version>39.1.38</version>
        </dependency>

        <dependency>
            <groupId>software.amazon.awscdk</groupId>
            <artifactId>aws-cdk-lib</artifactId>
            <version>${cdk.version}</version>
        </dependency>

        <dependency>
            <groupId>software.constructs</groupId>
            <artifactId>constructs</artifactId>
            <version>${constructs.version}</version>
        </dependency>

        <dependency>
          <groupId>org.junit.jupiter</groupId>
          <artifactId>junit-jupiter</artifactId>
          <version>${junit.version}</version>
          <scope>test</scope>
        </dependency>


    </dependencies>
</project>

Running cdk synth generates the below output with error:

Created manifest.json: 
cdk.out/manifest.json
{
  "version": "39.0.0",
  "artifacts": {
    "CdktestjavaStack.assets": {
      "type": "cdk:asset-manifest",
      "properties": {
        "file": "CdktestjavaStack.assets.json",
        "requiresBootstrapStackVersion": 6,
        "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version"
      }
    },
    "CdktestjavaStack": {
      "type": "aws:cloudformation:stack",
      "environment": "aws://<<REDACTED>>/us-east-2",
      "properties": {
        "templateFile": "CdktestjavaStack.template.json",
        "terminationProtection": false,
        "validateOnSynth": false,
        "assumeRoleArn": "arn:${AWS::Partition}:iam::<<REDACTED>>:role/cdk-hnb659fds-deploy-role-<<REDACTED>>-us-east-2",
        "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::<<REDACTED>>:role/cdk-hnb659fds-cfn-exec-role-<<REDACTED>>-us-east-2",
        "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-<<REDACTED>>-us-east-2/e9d782151315e1e904bf97026c39ca99758ea8aa59a61f786291eebec651282b.json",
        "requiresBootstrapStackVersion": 6,
        "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
        "additionalDependencies": [
          "CdktestjavaStack.assets"
        ],
        "lookupRole": {
          "arn": "arn:${AWS::Partition}:iam::<<REDACTED>>:role/cdk-hnb659fds-lookup-role-<<REDACTED>>-us-east-2",
          "requiresBootstrapStackVersion": 8,
          "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version"
        }
      },
      "dependencies": [
        "CdktestjavaStack.assets"
      ],
      "metadata": {
        "/CdktestjavaStack/MyBucket/Resource": [
          {
            "type": "aws:cdk:logicalId",
            "data": "MyBucketF68F3FF0"
          }
        ],
        "/CdktestjavaStack/MyBucketDeployment/AwsCliLayer/Resource": [
          {
            "type": "aws:cdk:logicalId",
            "data": "MyBucketDeploymentAwsCliLayer7DA0F120"
          }
        ],
        "/CdktestjavaStack/MyBucketDeployment/CustomResource/Default": [
          {
            "type": "aws:cdk:logicalId",
            "data": "MyBucketDeploymentCustomResource24ED237B"
          }
        ],
        "/CdktestjavaStack/Custom::CDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C": [
          {
            "type": "aws:cdk:is-custom-resource-handler-singleton",
            "data": true
          },
          {
            "type": "aws:cdk:is-custom-resource-handler-runtime-family",
            "data": 2
          }
        ],
        "/CdktestjavaStack/Custom::CDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C/ServiceRole/Resource": [
          {
            "type": "aws:cdk:logicalId",
            "data": "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRole89A01265"
          }
        ],
        "/CdktestjavaStack/Custom::CDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C/ServiceRole/DefaultPolicy/Resource": [
          {
            "type": "aws:cdk:logicalId",
            "data": "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRoleDefaultPolicy88902FDF"
          }
        ],
        "/CdktestjavaStack/Custom::CDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C/Resource": [
          {
            "type": "aws:cdk:logicalId",
            "data": "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C81C01536"
          }
        ],
        "/CdktestjavaStack/CDKMetadata/Default": [
          {
            "type": "aws:cdk:logicalId",
            "data": "CDKMetadata"
          }
        ],
        "/CdktestjavaStack/BootstrapVersion": [
          {
            "type": "aws:cdk:logicalId",
            "data": "BootstrapVersion"
          }
        ],
        "/CdktestjavaStack/CheckBootstrapVersion": [
          {
            "type": "aws:cdk:logicalId",
            "data": "CheckBootstrapVersion"
          }
        ]
      },
      "displayName": "CdktestjavaStack"
    },
    "Tree": {
      "type": "cdk:tree",
      "properties": {
        "file": "tree.json"
      }
    }
  }
}
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.1.0:java (default-cli) on project cdktestjava: An exception occurred while executing the Java class. Unable to initialize interface proxy software.amazon.awscdk.cloudassembly.schema.AssemblyManifest.Jsii$Proxy: InvocationTargetException: Unable to initialize interface proxy software.amazon.awscdk.cloudassembly.schema.ArtifactManifest.Jsii$Proxy: Unable to initialize interface proxy software.amazon.awscdk.cloudassembly.schema.MetadataEntry.Jsii$Proxy: Of property Object.data: Unable to serialize value as string | @aws-cdk/cloud-assembly-schema.FileAssetMetadataEntry | @aws-cdk/cloud-assembly-schema.ContainerImageAssetMetadataEntry | array<@aws-cdk/cloud-assembly-schema.Tag> | undefined
[ERROR] ├── 🛑 Failing value is a boolean
[ERROR] │      true
[ERROR] ╰── 🔍 Failure reason(s):
[ERROR]     ├─ [as string] Value is not a string
[ERROR]     ├─ [as array<@aws-cdk/cloud-assembly-schema.Tag>] Value is not an array
[ERROR]     ├─ [as @aws-cdk/cloud-assembly-schema.FileAssetMetadataEntry] Value is not an object
[ERROR]     ╰─ [as @aws-cdk/cloud-assembly-schema.ContainerImageAssetMetadataEntry] Value is not an object
[ERROR] @jsii/kernel.SerializationError: Of property Object.data: Unable to serialize value as string | @aws-cdk/cloud-assembly-schema.FileAssetMetadataEntry | @aws-cdk/cloud-assembly-schema.ContainerImageAssetMetadataEntry | array<@aws-cdk/cloud-assembly-schema.Tag> | undefined
[ERROR] ├── 🛑 Failing value is a boolean
[ERROR] │      true
[ERROR] ╰── 🔍 Failure reason(s):
[ERROR]     ├─ [as string] Value is not a string
[ERROR]     ├─ [as array<@aws-cdk/cloud-assembly-schema.Tag>] Value is not an array
[ERROR]     ├─ [as @aws-cdk/cloud-assembly-schema.FileAssetMetadataEntry] Value is not an object
[ERROR]     ╰─ [as @aws-cdk/cloud-assembly-schema.ContainerImageAssetMetadataEntry] Value is not an object
[ERROR]     at Object.process (/private/var/folders/r5/964t6ckn7jl87krdykn_3hrm0000gr/T/jsii-java-runtime3475921138190945711/lib/program.js:10486:19)
[ERROR]     at Kernel._Kernel_fromSandbox (/private/var/folders/r5/964t6ckn7jl87krdykn_3hrm0000gr/T/jsii-java-runtime3475921138190945711/lib/program.js:9466:25)
[ERROR]     at Kernel.get (/private/var/folders/r5/964t6ckn7jl87krdykn_3hrm0000gr/T/jsii-java-runtime3475921138190945711/lib/program.js:8846:103)
[ERROR]     at KernelHost.processRequest (/private/var/folders/r5/964t6ckn7jl87krdykn_3hrm0000gr/T/jsii-java-runtime3475921138190945711/lib/program.js:10718:36)
[ERROR]     at KernelHost.run (/private/var/folders/r5/964t6ckn7jl87krdykn_3hrm0000gr/T/jsii-java-runtime3475921138190945711/lib/program.js:10678:22)
[ERROR]     at Immediate._onImmediate (/private/var/folders/r5/964t6ckn7jl87krdykn_3hrm0000gr/T/jsii-java-runtime3475921138190945711/lib/program.js:10679:46)
[ERROR]     at process.processImmediate (node:internal/timers:476:21)
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.1.0:java (default-cli) on project cdktestjava: An exception occurred while executing the Java class. Unable to initialize interface proxy software.amazon.awscdk.cloudassembly.schema.AssemblyManifest.Jsii$Proxy
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:333)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
    at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)
Caused by: org.apache.maven.plugin.MojoExecutionException: An exception occurred while executing the Java class. Unable to initialize interface proxy software.amazon.awscdk.cloudassembly.schema.AssemblyManifest.Jsii$Proxy
    at org.codehaus.mojo.exec.ExecJavaMojo.execute (ExecJavaMojo.java:349)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
    at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)
Caused by: software.amazon.jsii.JsiiError: Unable to initialize interface proxy software.amazon.awscdk.cloudassembly.schema.AssemblyManifest.Jsii$Proxy
    at software.amazon.jsii.JsiiObject.asInterfaceProxy (JsiiObject.java:385)
    at software.amazon.jsii.NativeType$SimpleNativeType.transform (NativeType.java:157)
    at software.amazon.jsii.JsiiObjectMapper.treeToValue (JsiiObjectMapper.java:47)
    at software.amazon.jsii.JsiiObject.jsiiStaticCall (JsiiObject.java:188)
    at software.amazon.jsii.JsiiObject.jsiiStaticCall (JsiiObject.java:166)
    at software.amazon.awscdk.cloudassembly.schema.Manifest.loadAssemblyManifest (Manifest.java:49)
    at com.myorg.CdktestjavaApp.main (CdktestjavaApp.java:40)
    at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:279)
    at java.lang.Thread.run (Thread.java:829)
Caused by: java.lang.reflect.InvocationTargetException
    at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0 (Native Method)
    at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance (NativeConstructorAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance (DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance (Constructor.java:490)
    at software.amazon.jsii.JsiiObject.asInterfaceProxy (JsiiObject.java:377)
    at software.amazon.jsii.NativeType$SimpleNativeType.transform (NativeType.java:157)
    at software.amazon.jsii.JsiiObjectMapper.treeToValue (JsiiObjectMapper.java:47)
    at software.amazon.jsii.JsiiObject.jsiiStaticCall (JsiiObject.java:188)
    at software.amazon.jsii.JsiiObject.jsiiStaticCall (JsiiObject.java:166)
    at software.amazon.awscdk.cloudassembly.schema.Manifest.loadAssemblyManifest (Manifest.java:49)
    at com.myorg.CdktestjavaApp.main (CdktestjavaApp.java:40)
    at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:279)
    at java.lang.Thread.run (Thread.java:829)
Caused by: software.amazon.jsii.JsiiError: Unable to initialize interface proxy software.amazon.awscdk.cloudassembly.schema.ArtifactManifest.Jsii$Proxy
    at software.amazon.jsii.JsiiObject.asInterfaceProxy (JsiiObject.java:385)
    at software.amazon.jsii.NativeType$SimpleNativeType.transform (NativeType.java:157)
    at software.amazon.jsii.NativeType$MapNativeType.lambda$transform$0 (NativeType.java:209)
    at java.util.stream.Collectors.lambda$toMap$68 (Collectors.java:1666)
    at java.util.stream.ReduceOps$3ReducingSink.accept (ReduceOps.java:169)
    at java.util.Iterator.forEachRemaining (Iterator.java:133)
    at java.util.Spliterators$IteratorSpliterator.forEachRemaining (Spliterators.java:1801)
    at java.util.stream.AbstractPipeline.copyInto (AbstractPipeline.java:484)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto (AbstractPipeline.java:474)
    at java.util.stream.ReduceOps$ReduceOp.evaluateSequential (ReduceOps.java:913)
    at java.util.stream.AbstractPipeline.evaluate (AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.collect (ReferencePipeline.java:578)
    at software.amazon.jsii.NativeType$MapNativeType.transform (NativeType.java:207)
    at software.amazon.jsii.NativeType$MapNativeType.transform (NativeType.java:186)
    at software.amazon.jsii.JsiiObjectMapper.treeToValue (JsiiObjectMapper.java:47)
    at software.amazon.jsii.Kernel.get (Kernel.java:73)
    at software.amazon.awscdk.cloudassembly.schema.AssemblyManifest$Jsii$Proxy.<init> (AssemblyManifest.java:178)
    at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0 (Native Method)
    at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance (NativeConstructorAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance (DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance (Constructor.java:490)
    at software.amazon.jsii.JsiiObject.asInterfaceProxy (JsiiObject.java:377)
    at software.amazon.jsii.NativeType$SimpleNativeType.transform (NativeType.java:157)
    at software.amazon.jsii.JsiiObjectMapper.treeToValue (JsiiObjectMapper.java:47)
    at software.amazon.jsii.JsiiObject.jsiiStaticCall (JsiiObject.java:188)
    at software.amazon.jsii.JsiiObject.jsiiStaticCall (JsiiObject.java:166)
    at software.amazon.awscdk.cloudassembly.schema.Manifest.loadAssemblyManifest (Manifest.java:49)
    at com.myorg.CdktestjavaApp.main (CdktestjavaApp.java:40)
    at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:279)
    at java.lang.Thread.run (Thread.java:829)
Caused by: java.lang.reflect.InvocationTargetException
    at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0 (Native Method)
    at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance (NativeConstructorAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance (DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance (Constructor.java:490)
    at software.amazon.jsii.JsiiObject.asInterfaceProxy (JsiiObject.java:377)
    at software.amazon.jsii.NativeType$SimpleNativeType.transform (NativeType.java:157)
    at software.amazon.jsii.NativeType$MapNativeType.lambda$transform$0 (NativeType.java:209)
    at java.util.stream.Collectors.lambda$toMap$68 (Collectors.java:1666)
    at java.util.stream.ReduceOps$3ReducingSink.accept (ReduceOps.java:169)
    at java.util.Iterator.forEachRemaining (Iterator.java:133)
    at java.util.Spliterators$IteratorSpliterator.forEachRemaining (Spliterators.java:1801)
    at java.util.stream.AbstractPipeline.copyInto (AbstractPipeline.java:484)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto (AbstractPipeline.java:474)
    at java.util.stream.ReduceOps$ReduceOp.evaluateSequential (ReduceOps.java:913)
    at java.util.stream.AbstractPipeline.evaluate (AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.collect (ReferencePipeline.java:578)
    at software.amazon.jsii.NativeType$MapNativeType.transform (NativeType.java:207)
    at software.amazon.jsii.NativeType$MapNativeType.transform (NativeType.java:186)
    at software.amazon.jsii.JsiiObjectMapper.treeToValue (JsiiObjectMapper.java:47)
    at software.amazon.jsii.Kernel.get (Kernel.java:73)
    at software.amazon.awscdk.cloudassembly.schema.AssemblyManifest$Jsii$Proxy.<init> (AssemblyManifest.java:178)
    at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0 (Native Method)
    at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance (NativeConstructorAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance (DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance (Constructor.java:490)
    at software.amazon.jsii.JsiiObject.asInterfaceProxy (JsiiObject.java:377)
    at software.amazon.jsii.NativeType$SimpleNativeType.transform (NativeType.java:157)
    at software.amazon.jsii.JsiiObjectMapper.treeToValue (JsiiObjectMapper.java:47)
    at software.amazon.jsii.JsiiObject.jsiiStaticCall (JsiiObject.java:188)
    at software.amazon.jsii.JsiiObject.jsiiStaticCall (JsiiObject.java:166)
    at software.amazon.awscdk.cloudassembly.schema.Manifest.loadAssemblyManifest (Manifest.java:49)
    at com.myorg.CdktestjavaApp.main (CdktestjavaApp.java:40)
    at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:279)
    at java.lang.Thread.run (Thread.java:829)
Caused by: software.amazon.jsii.JsiiError: Unable to initialize interface proxy software.amazon.awscdk.cloudassembly.schema.MetadataEntry.Jsii$Proxy
    at software.amazon.jsii.JsiiObject.asInterfaceProxy (JsiiObject.java:385)
    at software.amazon.jsii.NativeType$SimpleNativeType.transform (NativeType.java:157)
    at java.util.stream.ReferencePipeline$3$1.accept (ReferencePipeline.java:195)
    at java.util.ArrayList$ArrayListSpliterator.forEachRemaining (ArrayList.java:1655)
    at java.util.stream.AbstractPipeline.copyInto (AbstractPipeline.java:484)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto (AbstractPipeline.java:474)
    at java.util.stream.ReduceOps$ReduceOp.evaluateSequential (ReduceOps.java:913)
    at java.util.stream.AbstractPipeline.evaluate (AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.collect (ReferencePipeline.java:578)
    at software.amazon.jsii.NativeType$ListNativeType.transform (NativeType.java:182)
    at software.amazon.jsii.NativeType$ListNativeType.transform (NativeType.java:164)
    at software.amazon.jsii.NativeType$MapNativeType.lambda$transform$0 (NativeType.java:209)
    at java.util.stream.Collectors.lambda$toMap$68 (Collectors.java:1666)
    at java.util.stream.ReduceOps$3ReducingSink.accept (ReduceOps.java:169)
    at java.util.Iterator.forEachRemaining (Iterator.java:133)
    at java.util.Spliterators$IteratorSpliterator.forEachRemaining (Spliterators.java:1801)
    at java.util.stream.AbstractPipeline.copyInto (AbstractPipeline.java:484)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto (AbstractPipeline.java:474)
    at java.util.stream.ReduceOps$ReduceOp.evaluateSequential (ReduceOps.java:913)
    at java.util.stream.AbstractPipeline.evaluate (AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.collect (ReferencePipeline.java:578)
    at software.amazon.jsii.NativeType$MapNativeType.transform (NativeType.java:207)
    at software.amazon.jsii.NativeType$MapNativeType.transform (NativeType.java:186)
    at software.amazon.jsii.JsiiObjectMapper.treeToValue (JsiiObjectMapper.java:47)
    at software.amazon.jsii.Kernel.get (Kernel.java:73)
    at software.amazon.awscdk.cloudassembly.schema.ArtifactManifest$Jsii$Proxy.<init> (ArtifactManifest.java:225)
    at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0 (Native Method)
    at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance (NativeConstructorAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance (DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance (Constructor.java:490)
    at software.amazon.jsii.JsiiObject.asInterfaceProxy (JsiiObject.java:377)
    at software.amazon.jsii.NativeType$SimpleNativeType.transform (NativeType.java:157)
    at software.amazon.jsii.NativeType$MapNativeType.lambda$transform$0 (NativeType.java:209)
    at java.util.stream.Collectors.lambda$toMap$68 (Collectors.java:1666)
    at java.util.stream.ReduceOps$3ReducingSink.accept (ReduceOps.java:169)
    at java.util.Iterator.forEachRemaining (Iterator.java:133)
    at java.util.Spliterators$IteratorSpliterator.forEachRemaining (Spliterators.java:1801)
    at java.util.stream.AbstractPipeline.copyInto (AbstractPipeline.java:484)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto (AbstractPipeline.java:474)
    at java.util.stream.ReduceOps$ReduceOp.evaluateSequential (ReduceOps.java:913)
    at java.util.stream.AbstractPipeline.evaluate (AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.collect (ReferencePipeline.java:578)
    at software.amazon.jsii.NativeType$MapNativeType.transform (NativeType.java:207)
    at software.amazon.jsii.NativeType$MapNativeType.transform (NativeType.java:186)
    at software.amazon.jsii.JsiiObjectMapper.treeToValue (JsiiObjectMapper.java:47)
    at software.amazon.jsii.Kernel.get (Kernel.java:73)
    at software.amazon.awscdk.cloudassembly.schema.AssemblyManifest$Jsii$Proxy.<init> (AssemblyManifest.java:178)
    at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0 (Native Method)
    at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance (NativeConstructorAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance (DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance (Constructor.java:490)
    at software.amazon.jsii.JsiiObject.asInterfaceProxy (JsiiObject.java:377)
    at software.amazon.jsii.NativeType$SimpleNativeType.transform (NativeType.java:157)
    at software.amazon.jsii.JsiiObjectMapper.treeToValue (JsiiObjectMapper.java:47)
    at software.amazon.jsii.JsiiObject.jsiiStaticCall (JsiiObject.java:188)
    at software.amazon.jsii.JsiiObject.jsiiStaticCall (JsiiObject.java:166)
    at software.amazon.awscdk.cloudassembly.schema.Manifest.loadAssemblyManifest (Manifest.java:49)
    at com.myorg.CdktestjavaApp.main (CdktestjavaApp.java:40)
    at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:279)
    at java.lang.Thread.run (Thread.java:829)
Caused by: java.lang.reflect.InvocationTargetException
    at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0 (Native Method)
    at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance (NativeConstructorAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance (DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance (Constructor.java:490)
    at software.amazon.jsii.JsiiObject.asInterfaceProxy (JsiiObject.java:377)
    at software.amazon.jsii.NativeType$SimpleNativeType.transform (NativeType.java:157)
    at java.util.stream.ReferencePipeline$3$1.accept (ReferencePipeline.java:195)
    at java.util.ArrayList$ArrayListSpliterator.forEachRemaining (ArrayList.java:1655)
    at java.util.stream.AbstractPipeline.copyInto (AbstractPipeline.java:484)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto (AbstractPipeline.java:474)
    at java.util.stream.ReduceOps$ReduceOp.evaluateSequential (ReduceOps.java:913)
    at java.util.stream.AbstractPipeline.evaluate (AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.collect (ReferencePipeline.java:578)
    at software.amazon.jsii.NativeType$ListNativeType.transform (NativeType.java:182)
    at software.amazon.jsii.NativeType$ListNativeType.transform (NativeType.java:164)
    at software.amazon.jsii.NativeType$MapNativeType.lambda$transform$0 (NativeType.java:209)
    at java.util.stream.Collectors.lambda$toMap$68 (Collectors.java:1666)
    at java.util.stream.ReduceOps$3ReducingSink.accept (ReduceOps.java:169)
    at java.util.Iterator.forEachRemaining (Iterator.java:133)
    at java.util.Spliterators$IteratorSpliterator.forEachRemaining (Spliterators.java:1801)
    at java.util.stream.AbstractPipeline.copyInto (AbstractPipeline.java:484)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto (AbstractPipeline.java:474)
    at java.util.stream.ReduceOps$ReduceOp.evaluateSequential (ReduceOps.java:913)
    at java.util.stream.AbstractPipeline.evaluate (AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.collect (ReferencePipeline.java:578)
    at software.amazon.jsii.NativeType$MapNativeType.transform (NativeType.java:207)
    at software.amazon.jsii.NativeType$MapNativeType.transform (NativeType.java:186)
    at software.amazon.jsii.JsiiObjectMapper.treeToValue (JsiiObjectMapper.java:47)
    at software.amazon.jsii.Kernel.get (Kernel.java:73)
    at software.amazon.awscdk.cloudassembly.schema.ArtifactManifest$Jsii$Proxy.<init> (ArtifactManifest.java:225)
    at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0 (Native Method)
    at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance (NativeConstructorAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance (DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance (Constructor.java:490)
    at software.amazon.jsii.JsiiObject.asInterfaceProxy (JsiiObject.java:377)
    at software.amazon.jsii.NativeType$SimpleNativeType.transform (NativeType.java:157)
    at software.amazon.jsii.NativeType$MapNativeType.lambda$transform$0 (NativeType.java:209)
    at java.util.stream.Collectors.lambda$toMap$68 (Collectors.java:1666)
    at java.util.stream.ReduceOps$3ReducingSink.accept (ReduceOps.java:169)
    at java.util.Iterator.forEachRemaining (Iterator.java:133)
    at java.util.Spliterators$IteratorSpliterator.forEachRemaining (Spliterators.java:1801)
    at java.util.stream.AbstractPipeline.copyInto (AbstractPipeline.java:484)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto (AbstractPipeline.java:474)
    at java.util.stream.ReduceOps$ReduceOp.evaluateSequential (ReduceOps.java:913)
    at java.util.stream.AbstractPipeline.evaluate (AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.collect (ReferencePipeline.java:578)
    at software.amazon.jsii.NativeType$MapNativeType.transform (NativeType.java:207)
    at software.amazon.jsii.NativeType$MapNativeType.transform (NativeType.java:186)
    at software.amazon.jsii.JsiiObjectMapper.treeToValue (JsiiObjectMapper.java:47)
    at software.amazon.jsii.Kernel.get (Kernel.java:73)
    at software.amazon.awscdk.cloudassembly.schema.AssemblyManifest$Jsii$Proxy.<init> (AssemblyManifest.java:178)
    at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0 (Native Method)
    at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance (NativeConstructorAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance (DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance (Constructor.java:490)
    at software.amazon.jsii.JsiiObject.asInterfaceProxy (JsiiObject.java:377)
    at software.amazon.jsii.NativeType$SimpleNativeType.transform (NativeType.java:157)
    at software.amazon.jsii.JsiiObjectMapper.treeToValue (JsiiObjectMapper.java:47)
    at software.amazon.jsii.JsiiObject.jsiiStaticCall (JsiiObject.java:188)
    at software.amazon.jsii.JsiiObject.jsiiStaticCall (JsiiObject.java:166)
    at software.amazon.awscdk.cloudassembly.schema.Manifest.loadAssemblyManifest (Manifest.java:49)
    at com.myorg.CdktestjavaApp.main (CdktestjavaApp.java:40)
    at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:279)
    at java.lang.Thread.run (Thread.java:829)
Caused by: software.amazon.jsii.JsiiError: Of property Object.data: Unable to serialize value as string | @aws-cdk/cloud-assembly-schema.FileAssetMetadataEntry | @aws-cdk/cloud-assembly-schema.ContainerImageAssetMetadataEntry | array<@aws-cdk/cloud-assembly-schema.Tag> | undefined
├── 🛑 Failing value is a boolean
│      true
╰── 🔍 Failure reason(s):
    ├─ [as string] Value is not a string
    ├─ [as array<@aws-cdk/cloud-assembly-schema.Tag>] Value is not an array
    ├─ [as @aws-cdk/cloud-assembly-schema.FileAssetMetadataEntry] Value is not an object
    ╰─ [as @aws-cdk/cloud-assembly-schema.ContainerImageAssetMetadataEntry] Value is not an object
@jsii/kernel.SerializationError: Of property Object.data: Unable to serialize value as string | @aws-cdk/cloud-assembly-schema.FileAssetMetadataEntry | @aws-cdk/cloud-assembly-schema.ContainerImageAssetMetadataEntry | array<@aws-cdk/cloud-assembly-schema.Tag> | undefined
├── 🛑 Failing value is a boolean
│      true
╰── 🔍 Failure reason(s):
    ├─ [as string] Value is not a string
    ├─ [as array<@aws-cdk/cloud-assembly-schema.Tag>] Value is not an array
    ├─ [as @aws-cdk/cloud-assembly-schema.FileAssetMetadataEntry] Value is not an object
    ╰─ [as @aws-cdk/cloud-assembly-schema.ContainerImageAssetMetadataEntry] Value is not an object
    at Object.process (/private/var/folders/r5/964t6ckn7jl87krdykn_3hrm0000gr/T/jsii-java-runtime3475921138190945711/lib/program.js:10486:19)
    at Kernel._Kernel_fromSandbox (/private/var/folders/r5/964t6ckn7jl87krdykn_3hrm0000gr/T/jsii-java-runtime3475921138190945711/lib/program.js:9466:25)
    at Kernel.get (/private/var/folders/r5/964t6ckn7jl87krdykn_3hrm0000gr/T/jsii-java-runtime3475921138190945711/lib/program.js:8846:103)
    at KernelHost.processRequest (/private/var/folders/r5/964t6ckn7jl87krdykn_3hrm0000gr/T/jsii-java-runtime3475921138190945711/lib/program.js:10718:36)
    at KernelHost.run (/private/var/folders/r5/964t6ckn7jl87krdykn_3hrm0000gr/T/jsii-java-runtime3475921138190945711/lib/program.js:10678:22)
    at Immediate._onImmediate (/private/var/folders/r5/964t6ckn7jl87krdykn_3hrm0000gr/T/jsii-java-runtime3475921138190945711/lib/program.js:10679:46)
    at process.processImmediate (node:internal/timers:476:21)
    at software.amazon.jsii.JsiiRuntime.processErrorResponse (JsiiRuntime.java:150)
    at software.amazon.jsii.JsiiRuntime.requestResponse (JsiiRuntime.java:116)
    at software.amazon.jsii.JsiiClient.getPropertyValue (JsiiClient.java:112)
    at software.amazon.jsii.Kernel.get (Kernel.java:72)
    at software.amazon.awscdk.cloudassembly.schema.MetadataEntry$Jsii$Proxy.<init> (MetadataEntry.java:149)
    at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0 (Native Method)
    at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance (NativeConstructorAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance (DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance (Constructor.java:490)
    at software.amazon.jsii.JsiiObject.asInterfaceProxy (JsiiObject.java:377)
    at software.amazon.jsii.NativeType$SimpleNativeType.transform (NativeType.java:157)
    at java.util.stream.ReferencePipeline$3$1.accept (ReferencePipeline.java:195)
    at java.util.ArrayList$ArrayListSpliterator.forEachRemaining (ArrayList.java:1655)
    at java.util.stream.AbstractPipeline.copyInto (AbstractPipeline.java:484)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto (AbstractPipeline.java:474)
    at java.util.stream.ReduceOps$ReduceOp.evaluateSequential (ReduceOps.java:913)
    at java.util.stream.AbstractPipeline.evaluate (AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.collect (ReferencePipeline.java:578)
    at software.amazon.jsii.NativeType$ListNativeType.transform (NativeType.java:182)
    at software.amazon.jsii.NativeType$ListNativeType.transform (NativeType.java:164)
    at software.amazon.jsii.NativeType$MapNativeType.lambda$transform$0 (NativeType.java:209)
    at java.util.stream.Collectors.lambda$toMap$68 (Collectors.java:1666)
    at java.util.stream.ReduceOps$3ReducingSink.accept (ReduceOps.java:169)
    at java.util.Iterator.forEachRemaining (Iterator.java:133)
    at java.util.Spliterators$IteratorSpliterator.forEachRemaining (Spliterators.java:1801)
    at java.util.stream.AbstractPipeline.copyInto (AbstractPipeline.java:484)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto (AbstractPipeline.java:474)
    at java.util.stream.ReduceOps$ReduceOp.evaluateSequential (ReduceOps.java:913)
    at java.util.stream.AbstractPipeline.evaluate (AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.collect (ReferencePipeline.java:578)
    at software.amazon.jsii.NativeType$MapNativeType.transform (NativeType.java:207)
    at software.amazon.jsii.NativeType$MapNativeType.transform (NativeType.java:186)
    at software.amazon.jsii.JsiiObjectMapper.treeToValue (JsiiObjectMapper.java:47)
    at software.amazon.jsii.Kernel.get (Kernel.java:73)
    at software.amazon.awscdk.cloudassembly.schema.ArtifactManifest$Jsii$Proxy.<init> (ArtifactManifest.java:225)
    at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0 (Native Method)
    at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance (NativeConstructorAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance (DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance (Constructor.java:490)
    at software.amazon.jsii.JsiiObject.asInterfaceProxy (JsiiObject.java:377)
    at software.amazon.jsii.NativeType$SimpleNativeType.transform (NativeType.java:157)
    at software.amazon.jsii.NativeType$MapNativeType.lambda$transform$0 (NativeType.java:209)
    at java.util.stream.Collectors.lambda$toMap$68 (Collectors.java:1666)
    at java.util.stream.ReduceOps$3ReducingSink.accept (ReduceOps.java:169)
    at java.util.Iterator.forEachRemaining (Iterator.java:133)
    at java.util.Spliterators$IteratorSpliterator.forEachRemaining (Spliterators.java:1801)
    at java.util.stream.AbstractPipeline.copyInto (AbstractPipeline.java:484)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto (AbstractPipeline.java:474)
    at java.util.stream.ReduceOps$ReduceOp.evaluateSequential (ReduceOps.java:913)
    at java.util.stream.AbstractPipeline.evaluate (AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.collect (ReferencePipeline.java:578)
    at software.amazon.jsii.NativeType$MapNativeType.transform (NativeType.java:207)
    at software.amazon.jsii.NativeType$MapNativeType.transform (NativeType.java:186)
    at software.amazon.jsii.JsiiObjectMapper.treeToValue (JsiiObjectMapper.java:47)
    at software.amazon.jsii.Kernel.get (Kernel.java:73)
    at software.amazon.awscdk.cloudassembly.schema.AssemblyManifest$Jsii$Proxy.<init> (AssemblyManifest.java:178)
    at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0 (Native Method)
    at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance (NativeConstructorAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance (DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance (Constructor.java:490)
    at software.amazon.jsii.JsiiObject.asInterfaceProxy (JsiiObject.java:377)
    at software.amazon.jsii.NativeType$SimpleNativeType.transform (NativeType.java:157)
    at software.amazon.jsii.JsiiObjectMapper.treeToValue (JsiiObjectMapper.java:47)
    at software.amazon.jsii.JsiiObject.jsiiStaticCall (JsiiObject.java:188)
    at software.amazon.jsii.JsiiObject.jsiiStaticCall (JsiiObject.java:166)
    at software.amazon.awscdk.cloudassembly.schema.Manifest.loadAssemblyManifest (Manifest.java:49)
    at com.myorg.CdktestjavaApp.main (CdktestjavaApp.java:40)
    at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:279)
    at java.lang.Thread.run (Thread.java:829)
[ERROR] 
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Subprocess exited with error 1

cdklabs/cloud-assembly-schema was migrated from main CDK repo as separate repo, starting from version 39.0.1 (refer commit history) in June 2024.

If we use software.amazon.awscdk.aws-cdk-lib package version 2.134.0, not using software.amazon.awscdk.cdk-cloud-assembly-schema (modify pom.xml accordingly and refresh packages), the above synthesis work fine.

Transferring to JSII repo.

Thanks,
Ashish

@ashishdhingra ashishdhingra added p1 effort/medium Medium work item – a couple days of effort and removed p2 labels Jan 7, 2025
@ashishdhingra ashishdhingra transferred this issue from aws/aws-cdk Jan 7, 2025
@ashishdhingra ashishdhingra removed their assignment Jan 7, 2025
@iliapolo
Copy link
Contributor

iliapolo commented Jan 8, 2025

@matusfaro thanks for reporting. I was able to reproduce and it seems like the cause is indeed the change you mentioned, unrelated to the cloud-assembly-schema version.

That is, a meer bump of aws-cdk-lib will expose this error if you directly use Manifest. loadAssemblyManifest. Can you confirm?

@matusfaro
Copy link
Author

matusfaro commented Jan 8, 2025

@iliapolo Yes that's right, it seems the new schema introduces values that the type doesn't have. So likely the type just needs to be updated.

mergify bot pushed a commit to cdklabs/cloud-assembly-schema that referenced this issue Jan 8, 2025
In aws/aws-cdk#31041, the CDK started emitting booleans and numbers as metadata values. 
However, since these types are not officially declared in the schema, jsii runtime type checking prevents loading them:

```console
[ERROR] ├── 🛑 Failing value is a boolean
[ERROR] │      true
[ERROR] ╰── 🔍 Failure reason(s):
[ERROR]     ├─ [as string] Value is not a string
[ERROR]     ├─ [as array<aws-cdk-lib.cloud_assembly_schema.Tag>] Value is not an array
[ERROR]     ├─ [as aws-cdk-lib.cloud_assembly_schema.FileAssetMetadataEntry] Value is not an object
[ERROR]     ╰─ [as aws-cdk-lib.cloud_assembly_schema.ContainerImageAssetMetadataEntry] Value is not an object
```

Fixes aws/jsii#4742

> Note that releasing this will immediately resolve the above issue, no cdk release needed. It does bump the schema version, which we can update at will.

## FAQ

### If the types are not allowed in the schema, how can a manifest with them be written?

Actually, these types **are** allowed in the schema, in the json schema that is:

https://github.com/cdklabs/cloud-assembly-schema/blob/f5ae537437531364646e7515e5286e21583c8421/schema/cloud-assembly.schema.json#L131-L133

This free form data is added to the json schema in order to support calls to `node.addMetadata(key: string, value: any)`, as defined in the `constructs` API. However, this type was intentionally left out of the type declaration:

https://github.com/cdklabs/cloud-assembly-schema/blob/f5ae537437531364646e7515e5286e21583c8421/projenrc/update-schema.ts#L79-L89

I'm fairly certain the comment is not applicable anymore, because we don't run jsii compatibility checks on the schema (we just bump it on every change). In practice, I think we can probably get rid of this patching and just type metadata entry values as `any` - but that seems like a bigger change I don't want to go into right now. 

### If such manifests cannot be loaded, how does synth work?

Because during synth, loading the assembly using the `Manifest` class happens solely inside the javascript space, it doesn't callback to java land. This problem presents itself **only when** directly using the java `Manifest` class and invoking the `loadAssemblyManifest` function on a manifest produced by `app.synth()`.
@matusfaro
Copy link
Author

@iliapolo @ashishdhingra Thank you so much for the quick turnaround! Really appreciate it

@iliapolo
Copy link
Contributor

iliapolo commented Jan 8, 2025

@matusfaro this should be resolved now. BTW I noticed you're using this import:

import software.amazon.awscdk.cloud_assembly_schema.Manifest

Its ok, but by using this you're actually picking up the Manifest class thats bundled inside of aws-cdk-lib, and not the standalone assembly package (yeah its a bit messy). Since you are invoking the schema package directly, you should use this import:

import software.amazon.awscdk.cloudassembly.schema.Manifest;

With the following dependency (which you already are):

<dependency>
    <groupId>software.amazon.awscdk</groupId>
    <artifactId>cdk-cloud-assembly-schema</artifactId>
    <version>39.1.41</version>
</dependency>

You'll also need to bump your CDK cli to the latest version because you're picking up new schema versions. Note that a fix for the software.amazon.awscdk.cloud_assembly_schema.Manifest package will be available once a new CDK version is available, but you don't have to wait for that if you use software.amazon.awscdk.cloudassembly.schema.Manifest

@iliapolo iliapolo closed this as completed Jan 8, 2025
Copy link
Contributor

github-actions bot commented Jan 8, 2025

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

matusfaro added a commit to datasprayio/aws-cdk-4j that referenced this issue Jan 8, 2025
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. effort/medium Medium work item – a couple days of effort p1 potential-regression Marking this issue as a potential regression to be checked by team member
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants