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

Java Gradle Multi-Module: "Module can only have 1 content root" #868

Closed
lukasbradley opened this issue Apr 1, 2019 · 2 comments
Closed
Labels
bug We can reproduce the issue and confirmed it is a bug.
Milestone

Comments

@lukasbradley
Copy link

Describe the bug
In attempting to execute a Lambda in a multi-module Gradle project, the Plugin has a fatal error.

To reproduce

  1. Create a multi-module Gradle project.
  2. Select the RequestHandler class to execute.
  3. Run it...

Expected behavior
No fatal error...?

Actual behavior

IDE Fatal Error: The Plugin crashes with the following stack trace.
java.lang.IllegalArgumentException: Module can only have 1 content root at software.aws.toolkits.jetbrains.services.lambda.java.JavaLambdaBuilder.getBaseDirectory(JavaLambdaBuilder.kt:43) at software.aws.toolkits.jetbrains.services.lambda.java.JavaLambdaBuilder.buildLambda(JavaLambdaBuilder.kt:30) at software.aws.toolkits.jetbrains.services.lambda.LambdaBuilderUtils.runSamBuild(LambdaBuilderUtils.kt:133) at software.aws.toolkits.jetbrains.services.lambda.LambdaBuilderUtils.access$runSamBuild(LambdaBuilderUtils.kt:32) at software.aws.toolkits.jetbrains.services.lambda.LambdaBuilderUtils$buildAndReport$$inlined$runSamBuildInBackground$1.run(LambdaBuilderUtils.kt:177) at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:731) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:164) at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:586) at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:532) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:86) at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:151) at com.intellij.openapi.progress.impl.CoreProgressManager$4.run(CoreProgressManager.java:403) at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:311) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)

Your Environment

  • OS: Ubuntu 18.10
  • JetBrains' Product: IDEA
  • JetBrains' Product Version: Ultimate 2019.1
  • Toolkit Version: 1.2
  • SAM CLI Version: 0.14.2
  • JVM/Python Version: JDK 1.8

Additional context
The plugin completely crashes and will not allow me to re-run. I have to shut down the IDE and restart.

@abrooksv abrooksv added the bug We can reproduce the issue and confirmed it is a bug. label Apr 2, 2019
@abrooksv
Copy link
Contributor

abrooksv commented Apr 2, 2019

So it seems we have 2 issues here:

  1. Improve the logic around resolving handlers when using a Java handler invocation with respect to Gradle imports.
  2. Make sure we wrap all exceptions coming out of the Run/Debug system as an ExecutionExceptionas per the method contract

@zhangzhx
Copy link
Contributor

This fix has been released in version 1.3. Feel free to reopen it if you still see any issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug We can reproduce the issue and confirmed it is a bug.
Projects
None yet
Development

No branches or pull requests

3 participants