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

cdk java init template broken #2289

Closed
jousby opened this issue Apr 15, 2019 · 1 comment · Fixed by #2300 · May be fixed by MechanicalRock/account-reaper#6
Closed

cdk java init template broken #2289

jousby opened this issue Apr 15, 2019 · 1 comment · Fixed by #2300 · May be fixed by MechanicalRock/account-reaper#6
Labels
bug This issue is a bug.

Comments

@jousby
Copy link

jousby commented Apr 15, 2019

Describe the bug
I've been using the Java flavour of CDK for a while now and had several projects create prior to 0.23.0 successfully running on my macbook pro. I've just spun up a new Java project using the init template in version 0.28.0 and i'm having trouble using the cdk cli tool against it. It looks like this change (#1503) to the Java template might be causing me issues. The older java cdk apps still run fine.

When I run a 'cdk' command against the new java project i get the following error:

$ cdk list
[INFO] Scanning for projects...
[INFO]
[INFO] -------------------------< com.myorg:cdk-new >--------------------------
[INFO] Building cdk-new 0.1
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- exec-maven-plugin:1.6.0:java (default-cli) @ cdk-new ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.767 s
[INFO] Finished at: 2019-04-15T22:04:17+10:00
[INFO] ------------------------------------------------------------------------
Unable to find output file /var/folders/6k/6fp51jbx3xg83p3fs4vnr4l4t8strm/T/cdkxMefzi/cdk.out; are you calling app.run()?

To Reproduce

  1. mkdir init-test
  2. cd init-test
  3. cdk init --language java
  4. mvn package
  5. cdk list

Expected behavior
Lists the helloworld stacks in the default App

Version:

  • OS = MacOS High Sierra (10.13.6)
  • Programming Language = Java
  • CDK Version = 0.28.0
@jousby jousby added the bug This issue is a bug. label Apr 15, 2019
@eladb
Copy link
Contributor

eladb commented Apr 15, 2019

Confirming this is an issue. As a workaround, just add app.run() at the end of your main() function.

eladb pushed a commit that referenced this issue Apr 15, 2019
Since the java client for jsii does not cleanly shutdown
the jsii-runtime process, the implicit "app.run()" does not
work, and the app cannot be synthesized.

Fixes #2289

Related: aws/jsii#456
eladb pushed a commit that referenced this issue Apr 15, 2019
Since the java client for jsii does not cleanly shutdown
the jsii-runtime process, the implicit "app.run()" does not
work, and the app cannot be synthesized.

Fixes #2289

Related: aws/jsii#456
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
2 participants