Giter Site home page Giter Site logo

Comments (4)

sanathkr avatar sanathkr commented on May 22, 2024

I haven't used the jersy example before. Let me try it out and see what might be wrong.

from aws-sam-cli.

sanathkr avatar sanathkr commented on May 22, 2024

Could be related to #37, just by looks of it.

from aws-sam-cli.

PaulMaddox avatar PaulMaddox commented on May 22, 2024

I can confirm that this is related to #37, and is fixed by pull request #75 (automatic unzipping of packaged archives such as JAR/ZIP).

With the fix:

$ git clone https://github.com/awslabs/aws-serverless-java-container
$ cd aws-serverless-java-container/samples/jersey/pet-store
$ mvn package
$ sam local start-api -t sam.yaml
2017/08/18 15:25:00 Connected to Docker 1.30
2017/08/18 15:25:00 Successfully parsed sam.yaml (version 2010-09-09)
2017/08/18 15:25:00 Fetching lambci/lambda:java8 image for java8 runtime...
java8: Pulling from lambci/lambda
Digest: sha256:668979530863a155b52533947e782fe164908eda2d6c5741317511bfa036d8cf
Status: Image is up to date for lambci/lambda:java8

Mounting com.amazonaws.serverless.sample.jersey.LambdaHandler::handleRequest (java8) at http://127.0.0.1:3000/{proxy+} [OPTIONS GET HEAD POST PUT DELETE TRACE CONNECT]

You can now browse to the above endpoints to invoke your functions.
You do not need to restart/reload SAM CLI while working on your functions,
changes will be reflected instantly/automatically. You only need to restart
SAM CLI if you update your AWS SAM template.

2017/08/18 15:26:17 Invoking com.amazonaws.serverless.sample.jersey.LambdaHandler::handleRequest (java8)
2017/08/18 15:26:17 Decompressing serverless-jersey-example-1.0-SNAPSHOT.jar into runtime container...
log4j:WARN No appenders could be found for logger (com.amazonaws.serverless.proxy.internal.LambdaContainerHandler).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
START RequestId: 0aee9bbe-79d0-480a-8efb-9dfd35ca68b8 Version: $LATEST
END RequestId: 0aee9bbe-79d0-480a-8efb-9dfd35ca68b8
REPORT RequestId: 0aee9bbe-79d0-480a-8efb-9dfd35ca68b8  Duration: 454.63 ms     Billed Duration: 500 ms Memory Size: 512 MB     Max Memory Used: 13 MB

and the HTTP response from http://localhost:3000/pets

[{"id":"d2d77c29-4426-4c1c-9445-15367993db21","breed":"Jack Russell Terrier","name":"Teddy","dateOfBirth":1448375182603},{"id":"918c5a08-abb2-43fc-a9e5-40ab4a9f538d","breed":"Beagle","name":"Max","dateOfBirth":1304605582603},{"id":"4416e7df-40e0-4695-b622-4c64336a55eb","breed":"Afghan Hound","name":"Bear","dateOfBirth":1196778382604},{"id":"046f0a53-e851-4105-b024-411cead3d2a7","breed":"Beagle","name":"Jack\t","dateOfBirth":1011450382604},{"id":"9078d215-7bcc-4534-9e2a-d3aaf6a45ef6","breed":"Dalmatian","name":"Bella","dateOfBirth":1309098382604},{"id":"9911779b-398f-4f6a-b4ae-da3b531d3e0d","breed":"Jack Russell Terrier","name":"Maggie","dateOfBirth":1093184782604},{"id":"a6838c72-aabc-45bf-93cd-b08157493c22","breed":"Bloodhound","name":"Ginger","dateOfBirth":1331130382604},{"id":"a420d1cc-ba29-4731-87a8-64a0a3fc9eaa","breed":"Beagle","name":"Princess","dateOfBirth":1035901582604},{"id":"5decb878-15b4-4c01-8bcf-33bde8bbbcf7","breed":"Dalmatian","name":"Roxy","dateOfBirth":1122301582604},{"id":"22a64d5f-e20c-42f8-9745-2357ded83add","breed":"Afghan Hound","name":"Lola","dateOfBirth":1202135182604}]

The fix will be included in the next release we do (0.1.2).
I'm not 100% sure when we'll next cut a release, but it won't be long.

from aws-sam-cli.

dtsushant avatar dtsushant commented on May 22, 2024

I am trying to setup one of the lamda function in my local i referenced your project as walkthrough, I am facing following issue could you please help me with it,

P.S. I am new at docker, just started today

A newer version of the AWS SAM CLI is available!
Your version:   0.2.11
Latest version: 0.5.0
See https://github.com/awslabs/aws-sam-local for upgrade instructions

2018/07/30 19:07:20 Connected to Docker 1.38
2018/07/30 19:07:20 Runtime image missing, will pull....
2018/07/30 19:07:20 Fetching lambci/lambda:java8 image for java8 runtime...
2018/07/30 19:07:20 Could not fetch lambci/lambda:java8 Docker image: Error response from daemon: Get https://registry-1.docker.io/v2/: invalid proxy URL port "port"

Mounting com.amazonaws.serverless.sample.jersey.StreamLambdaHandler::handleRequest (java8) at http://127.0.0.1:3000/{proxy+} [OPTIONS GET HEAD POST PUT DELETE PATCH]

You can now browse to the above endpoints to invoke your functions.
You do not need to restart/reload SAM CLI while working on your functions,
changes will be reflected instantly/automatically. You only need to restart
SAM CLI if you update your AWS SAM template.

2018/07/30 19:07:40 Invoking com.amazonaws.serverless.sample.jersey.StreamLambdaHandler::handleRequest (java8)
2018/07/30 19:07:40 Decompressing /Users/spandey/sushant/aws/aws-serverless-java-container/samples/jersey/pet-store/target/serverless-jersey-example-1.0-SNAPSHOT.jar
2018/07/30 19:07:41 Mounting /private/var/folders/5l/plhvb6z10gb10btxlvxy527mpftf3d/T/aws-sam-local-1532956960083789000 as /var/task:ro inside runtime container
2018/07/30 19:07:41 Error invoking java8 runtime: Error: No such image: lambci/lambda:java8

from aws-sam-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.