Comments (4)
I haven't used the jersy example before. Let me try it out and see what might be wrong.
from aws-sam-cli.
Could be related to #37, just by looks of it.
from aws-sam-cli.
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.
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)
- Bug: sam local invoke - JSONDecodeError HOT 2
- SAM deploy stuck on "Waiting for changeset to be created.." HOT 7
- Bug: sam local invoke - ReadTimeout HOT 2
- Feature request: Enable deployment of two different environments HOT 2
- Bug: `sam local start-api --add-host` does not work HOT 4
- Add option to override resolve_s3 from samconfig HOT 1
- Bug: invocation-type: Event is not supported. RequestResponse is only supported. HOT 3
- Bug: `Fn::ForEach` with transform `AWS::LanguageExtensions` results in error HOT 3
- Feature request: AWS::Serverless::Function.ImageUri Should Also Accept a Local File Path HOT 5
- Token Authorizer doesn't get linked if FunctionPayloadType missing in template.yml HOT 1
- Feature Request: Set ECR Lifecycle when deploying a lambda with a docker image HOT 4
- Unable to Retrieve Bot Response: ERR_NAME_NOT_RESOLVED and 403 Forbidden Error in Flask Application HOT 6
- Bug: sam cli build stuck on mounting.... HOT 3
- Bug: TITLE HOT 2
- Bug: TITLE HOT 1
- Feature request: TITLE HOT 1
- Permission denied: '/tmp/samcli/source/gradlew' when building aws-sam-cli-build-image-java11 HOT 3
- Bug: option --base-dir does not work HOT 1
- Bug: sam build - OSError HOT 1
- CDK followSymlinks not supported HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aws-sam-cli.