question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Lambda function in Gradle Project failed to Running locally

See original GitHub issue

Describe the bug Running Lambda function in Gradle Project fails with “SAM build command failed”

To reproduce

  1. Create a Gradle SAM application
  2. Find build.gradle and right click Import Gradle Project
  3. Open App.java and click Lambda icon on the left of the class definition.
  4. Select Run '[Local] App'
  5. Select my Credentials and Region, and Input Text(API Gateway AWS Proxy)
  6. Execute Run, but it fails with “SAM build command failed”

Build Output details is below.

/usr/local/bin/sam build --template /private/var/folders/94/599b3s8j0tbgnn506tmtd17m0000gq/T/template381.yaml --build-dir /private/var/folders/94/599b3s8j0tbgnn506tmtd17m0000gq/T/lambdaBuild1175
Build Failed
2019-03-28 21:41:51 Building resource 'Function'
Error: Unable to find a supported build workflow for runtime 'java8'. Reason: None of the supported manifests '['build.gradle', 'pom.xml']' were found in the following paths '['/Users/nomura.keichi/project/serverless/test/HelloWorldFunction/src/main', '/private/var/folders/94/599b3s8j0tbgnn506tmtd17m0000gq/T']'

Expected behavior The expected behavior is same as “Running a function locally” on AWS Toolkit for IntelliJ – Now generally available | AWS Developer Blog

Screenshots スクリーンショット 2019-03-28 21 49 29 スクリーンショット 2019-03-28 21 27 57 スクリーンショット 2019-03-28 21 42 46 スクリーンショット 2019-03-28 21 43 03

Your Environment

  • OS: macOS Mojave 10.14.4
  • JetBrains’ Product: IntelliJ IDEA
  • JetBrains’ Product Version: IntelliJ IDEA 2018.3.4 (Ultimate Edition) Build #IU-183.5429.30, built on January 29, 2019 JRE: 1.8.0_152-release-1343-b26 x86_64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
  • Toolkit Version: 1.2
  • SAM CLI Version: 0.14.2
  • JVM/Python Version: Java 1.8.0_144

Additional context

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
zhangzhxcommented, Apr 29, 2019

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

1reaction
abrooksvcommented, Mar 29, 2019

That is good to hear, you can also go through the template’s gutter icon to auto fill in some of that information:

Screen Shot 2019-03-29 at 9 43 10 AM

Read more comments on GitHub >

github_iconTop Results From Across the Web

AWS SAM: java8/gradle app fails with ClassNotFound when ...
Run sam build : sam build --use-container; Observe that the function runs successfully locally (this fails with the same ClassNotFound exception ...
Read more >
Resolve "ClassNotFoundExeption" errors from Java Lambda ...
The ClassNotFoundException error occurs when a Java runtime loads a class by its fully qualified name, but doesn't locate the class.
Read more >
Unit test fail when I run "gradle test" but run in Intellij successfully
When I open this project in Intellij, and switch to each single unit test file. All the test can be passed. But when...
Read more >
Serverless Functions with Spring Cloud Function - Baeldung
We'll build and run a simple Spring Cloud Function locally and then deploy ... Since AWS Lambda is one of the popular serverless...
Read more >
Create a Java function in Azure from the command line
Run az login to sign in to Azure and verify an active subscription. Create a local function project. In Azure Functions, a function...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found