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.

Java lambda executions fail to run or hang

See original GitHub issue

Hey, just updated to the latest plugin/intellij version, and my java lambda that once worked can’t seem to find the jar file being generated by mvn clean install.

Here’s my configuration: Screen Shot 2019-03-29 at 16 06 12 Screen Shot 2019-03-29 at 16 06 45

Here’s a copy of the console output:

/Users/rajat.murthi/Library/Python/3.6/bin/sam build --template /Users/rajat.murthi/Documents/Repos/deerwalk-adapter/template.yml --build-dir /private/var/folders/mh/3g3b80k101724rcx46tmvsj0k0dwdd/T/lambdaBuild
2019-03-29 16:06:23 Building resource 'deerwalkadapterchunker'
2019-03-29 16:06:23 /Users/rajat.murthi/Downloads/apache-maven-3.6.0/bin/mvn is using a JVM with major version 11 which is newer than 8 that is supported by AWS Lambda. The compiled function code may not run in AWS Lambda unless the project has been configured to be compatible with Java 8 using 'maven.compiler.target' in Maven.
2019-03-29 16:06:23 Running JavaMavenWorkflow:CopySource
Error: JavaMavenWorkflow:CopySource - [Errno 20] Not a directory: '/Users/rajat.murthi/Documents/Repos/deerwalk-adapter/target/deerwalk-adapter-worker.jar'
Build Failed

Considering I haven’t really changed the configuration since the last released plugin version which was working, and you can see in the pom I’m setting the java version to 8 and target very clearly exists, I don’t think this plugin is actually resolving my pom for some reason.

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.0</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>

I noticed in the new SAM settings you can turn on “Build function inside a container” which seems to emulate the old plugin initialization behavior, but when run inside a container, the plugin simply hangs on startup (I can’t even kill the process since it never makes it to started… meaning I have to restart intellij if I want to close that background thread).

Screen Shot 2019-03-29 at 16 16 14

Your Environment

  • OS: macOS Mojave 10.14.3
  • JetBrains’ Product: IntelliJ IDEA (Ultimate Edition)
  • JetBrains’ Product Version: 2019.1
  • Toolkit Version: 1.2
  • SAM CLI Version: 0.14.2
  • JVM/Python Version: the project sdk is configured to use 1.8.0_131, though my normal command line java --version is set to 11
Screen Shot 2019-03-29 at 16 24 23 Screen Shot 2019-03-29 at 16 26 57
$ java --version
openjdk 11.0.1 2018-10-16
OpenJDK Runtime Environment 18.9 (build 11.0.1+13)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.1+13, mixed mode)
seambp004069:~ rajat.murthi$
$ mvn --version
Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-24T11:41:47-07:00)
Maven home: /Users/rajat.murthi/Downloads/apache-maven-3.6.0
Java version: 11.0.1, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.14.3", arch: "x86_64", family: "mac"

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
zhangzhxcommented, Aug 12, 2019

Closing this issue as the original problem has been resolved.

@Mcat12 , @RMSD , feel free to create a new issue as a feature request for support of independent jar.

1reaction
AzureMarkercommented, Apr 30, 2019

We migrated to SAM build which changed how the CodeUri works.

@abrooksv Is there a way to skip the build and simply invoke like how the previous versions did it? This is a breaking change because it was not gated behind an option or config value. This probably broke everyone’s Java Lambda run configuration.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot execution issues in Lambda - AWS Documentation
If your code takes much longer to run in Lambda than on your local machine, it may be constrained by the memory or...
Read more >
AWS Lambda: Task timed out - Stack Overflow
Something happens somewhere that triggers Lambda (eg an upload to Amazon S3, data coming into an Amazon Kinesis stream, an application invoking ...
Read more >
6 Troubleshoot Process Hangs and Loops - Oracle Help Center
If the VM is deadlocked or hung, use the jstack command. If the VM does not respond to Control+\ or Control+Break, then it...
Read more >
Shave 99.93% off your Lambda bill with this one weird trick
For Provisioned Lambdas, this is executed in the background whenever you config your provisioned concurrency settings, and then every hour or so after...
Read more >
Troubleshoot Dataflow errors - Google Cloud
When running in batch mode, bundles including a failing item are retried four times. The pipeline fails completely when a single bundle fails...
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