Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

CDK synth give error stream closed error #114

Closed
abhinav-jain09 opened this issue Jan 10, 2020 · 2 comments
Closed

CDK synth give error stream closed error #114

abhinav-jain09 opened this issue Jan 10, 2020 · 2 comments
Assignees
Labels
closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. guidance Question that needs advice or information. language/java Related to the Java workshop

Comments

@abhinav-jain09
Copy link

abhinav-jain09 commented Jan 10, 2020

🐛 Bug Report

What is the problem?

Dear Friends . I just did cdk init and then doing cdk synth and get the follwoing error

[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:java (default-cli) on project cdk-workshop: An exception occured while executing the Java class. Unable to send request to jsii-runtime: java.io.IOException: Stream closed -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:java (default-cli) on project cdk-workshop: An exception occured while executing the Java class. Unable to send request to jsii-runtime: java.io.IOException: Stream closed

I use java 8 . Need help to fix this issue

Reproduction Steps

do cdk-init --language= java then cdk synth

Verbose Log

cdk synth
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:java (default-cli) on project cdk-workshop: An exception occured while executing the Java class. Unable to send request to jsii-runtime: java.io.IOException: Stream closed -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:java (default-cli) on project cdk-workshop: An exception occured while executing the Java class. Unable to send request to jsii-runtime: java.io.IOException: Stream closed
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.MojoExecutionException: An exception occured while executing the Java class. Unable to send request to jsii-runtime: java.io.IOException: Stream closed
    at org.codehaus.mojo.exec.ExecJavaMojo.execute (ExecJavaMojo.java:339)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: software.amazon.jsii.JsiiException: Unable to send request to jsii-runtime: java.io.IOException: Stream closed
    at software.amazon.jsii.JsiiRuntime.requestResponse (JsiiRuntime.java:96)
    at software.amazon.jsii.JsiiClient.createObject (JsiiClient.java:82)
    at software.amazon.jsii.JsiiEngine.createNewObject (JsiiEngine.java:510)
    at software.amazon.awscdk.core.App.<init> (App.java:46)
    at com.myorg.CdkWorkshopApp.main (CdkWorkshopApp.java:7)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:282)
    at java.lang.Thread.run (Thread.java:748)
Caused by: java.io.IOException: Stream closed
    at java.lang.ProcessBuilder$NullOutputStream.write (ProcessBuilder.java:433)
    at java.io.OutputStream.write (OutputStream.java:116)
    at java.io.BufferedOutputStream.flushBuffer (BufferedOutputStream.java:82)
    at java.io.BufferedOutputStream.flush (BufferedOutputStream.java:140)
    at sun.nio.cs.StreamEncoder.implFlush (StreamEncoder.java:297)
    at sun.nio.cs.StreamEncoder.flush (StreamEncoder.java:141)
    at java.io.OutputStreamWriter.flush (OutputStreamWriter.java:229)
    at java.io.BufferedWriter.flush (BufferedWriter.java:254)
    at software.amazon.jsii.JsiiRuntime.requestResponse (JsiiRuntime.java:77)
    at software.amazon.jsii.JsiiClient.createObject (JsiiClient.java:82)
    at software.amazon.jsii.JsiiEngine.createNewObject (JsiiEngine.java:510)
    at software.amazon.awscdk.core.App.<init> (App.java:46)
    at com.myorg.CdkWorkshopApp.main (CdkWorkshopApp.java:7)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:282)
    at java.lang.Thread.run (Thread.java:748)
[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

Environment

  • **CDK CLI Version:1.19.0 (build 5597bbe)
  • Section: java version 8
  • Browser:
  • Language:

Other information

@abhinav-jain09 abhinav-jain09 added the bug This issue is a bug. label Jan 10, 2020
@NGL321 NGL321 added guidance Question that needs advice or information. language/java Related to the Java workshop and removed bug This issue is a bug. labels Jan 16, 2020
@Jaszkowic
Copy link

This looks similar to aws/aws-cdk#5187 mentioning problems with node in version >= 13.2. I had the same problem and downgrading to node version 12.16.2 fixed it for me.

@NGL321
Copy link
Contributor

NGL321 commented Aug 6, 2020

I just tested with v1.56.0 and had no issues. If anyone encounters this problem again, please leave a comment, and I can dig deeper!

😸

@NGL321 NGL321 added the closing-soon This issue will automatically close in 4 days unless further comments are made. label Aug 6, 2020
@github-actions github-actions bot added closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Aug 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. guidance Question that needs advice or information. language/java Related to the Java workshop
Projects
None yet
Development

No branches or pull requests

3 participants