serverless / serverless/examples

Example failure: aws-java-simple-http-endpoint

Open
#276 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
11.5k
Forks
4.4k
Avg merge
2h 55m
Merged PRs (30d)
3

Description

Hi,

I followed the instruction as per the README for https://github.com/serverless/examples/tree/master/aws-java-simple-http-endpoint but these results in errors.

I'm specifically looking for an example that doesnt use maven with the shade plugin, but I've been unable to find a single working example.

Any advice/suggestions would be appreciated.

Regards

serverless v1.28.0
Gradle 4.8.1

Build time: 2018-06-21 07:53:06 UTC
Revision: 0abdea078047b12df42e7750ccba34d69b516a22

Groovy: 2.4.12
Ant: Apache Ant(TM) version 1.9.11 compiled on March 23 2018
JVM: 1.8.0_171 (Oracle Corporation 25.171-b11)
OS: Linux 4.13.0-45-generic amd64

eugenevd@t430x:/home/eugenevd/dev/aws-java-simple-http-endpoint$ ls
build.gradle  gradle  gradlew  gradlew.bat  pom.xml  README.md  serverless.yml  src
eugenevd@t430x:/home/eugenevd/dev/aws-java-simple-http-endpoint$ gradle wrapper

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
See https://docs.gradle.org/4.8.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 1s
1 actionable task: 1 executed

eugenevd@t430x:/home/eugenevd/dev/aws-java-simple-http-endpoint$ ./gradlew build
Downloading https://services.gradle.org/distributions/gradle-3.2.1-bin.zip
.................................................................
Starting a Gradle Daemon (subsequent builds will be faster)
:compileJava
:processResources
:classes
:jar
:assemble
:buildZip
:compileTestJava UP-TO-DATE
:processTestResources UP-TO-DATE
:testClasses UP-TO-DATE
:test UP-TO-DATE
:check UP-TO-DATE
:build

BUILD SUCCESSFUL

Total time: 18.9 secs

eugenevd@t430x:/home/eugenevd/dev/aws-java-simple-http-endpoint$ sls deploy -v
Serverless: Packaging service...
Serverless: Creating Stack...
Serverless: Checking Stack create progress...
CloudFormation - CREATE_IN_PROGRESS - AWS::CloudFormation::Stack - aws-java-simple-http-endpoint-dev
CloudFormation - CREATE_IN_PROGRESS - AWS::S3::Bucket - ServerlessDeploymentBucket
CloudFormation - CREATE_IN_PROGRESS - AWS::S3::Bucket - ServerlessDeploymentBucket
CloudFormation - CREATE_COMPLETE - AWS::S3::Bucket - ServerlessDeploymentBucket
CloudFormation - CREATE_COMPLETE - AWS::CloudFormation::Stack - aws-java-simple-http-endpoint-dev
Serverless: Stack create finished...
Serverless: Uploading CloudFormation file to S3...
Serverless: Uploading artifacts...
Serverless: Uploading service .zip file to S3 (1.81 MB)...
Serverless: Validating template...
Serverless: Updating Stack...
Serverless: Checking Stack update progress...
CloudFormation - UPDATE_IN_PROGRESS - AWS::CloudFormation::Stack - aws-java-simple-http-endpoint-dev
CloudFormation - CREATE_IN_PROGRESS - AWS::IAM::Role - IamRoleLambdaExecution
CloudFormation - CREATE_IN_PROGRESS - AWS::Logs::LogGroup - CurrentTimeLogGroup
CloudFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::RestApi - ApiGatewayRestApi
CloudFormation - CREATE_IN_PROGRESS - AWS::Logs::LogGroup - CurrentTimeLogGroup
CloudFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::RestApi - ApiGatewayRestApi
CloudFormation - CREATE_IN_PROGRESS - AWS::IAM::Role - IamRoleLambdaExecution
CloudFormation - CREATE_COMPLETE - AWS::Logs::LogGroup - CurrentTimeLogGroup
CloudFormation - CREATE_COMPLETE - AWS::ApiGateway::RestApi - ApiGatewayRestApi
CloudFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Resource - ApiGatewayResourcePing
CloudFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Resource - ApiGatewayResourcePing
CloudFormation - CREATE_COMPLETE - AWS::ApiGateway::Resource - ApiGatewayResourcePing
CloudFormation - CREATE_COMPLETE - AWS::IAM::Role - IamRoleLambdaExecution
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Function - CurrentTimeLambdaFunction
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Function - CurrentTimeLambdaFunction
CloudFormation - CREATE_COMPLETE - AWS::Lambda::Function - CurrentTimeLambdaFunction
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Permission - CurrentTimeLambdaPermissionApiGateway
CloudFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Method - ApiGatewayMethodPingGet
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Version - CurrentTimeLambdaVersiond38gqt33Q54NiXfsrhaJxKXj6Z1J5ze123abcdefg
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Permission - CurrentTimeLambdaPermissionApiGateway
CloudFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Method - ApiGatewayMethodPingGet
CloudFormation - CREATE_COMPLETE - AWS::ApiGateway::Method - ApiGatewayMethodPingGet
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Version - CurrentTimeLambdaVersiond38gqt33Q54NiXfsrhaJxKXj6Z1J5ze123abcdefg
CloudFormation - CREATE_COMPLETE - AWS::Lambda::Version - CurrentTimeLambdaVersiond38gqt33Q54NiXfsrhaJxKXj6Z1J5ze123abcdefg
CloudFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Deployment - ApiGatewayDeployment1531216600000
CloudFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Deployment - ApiGatewayDeployment1531216600000
CloudFormation - CREATE_COMPLETE - AWS::ApiGateway::Deployment - ApiGatewayDeployment1531216600000
CloudFormation - CREATE_COMPLETE - AWS::Lambda::Permission - CurrentTimeLambdaPermissionApiGateway
CloudFormation - UPDATE_COMPLETE_CLEANUP_IN_PROGRESS - AWS::CloudFormation::Stack - aws-java-simple-http-endpoint-dev
CloudFormation - UPDATE_COMPLETE - AWS::CloudFormation::Stack - aws-java-simple-http-endpoint-dev
Serverless: Stack update finished...
Service Information
service: aws-java-simple-http-endpoint
stage: dev
region: us-east-1
stack: aws-java-simple-http-endpoint-dev
api keys:
  None
endpoints:
  GET - https://yyy.execute-api.us-east-1.amazonaws.com/dev/ping
functions:
  currentTime: aws-java-simple-http-endpoint-dev-currentTime

Stack Outputs
CurrentTimeLambdaFunctionQualifiedArn: arn:aws:lambda:us-east-1:xxx:function:aws-java-simple-http-endpoint-dev-currentTime:1
ServiceEndpoint: https://yyy.execute-api.us-east-1.amazonaws.com/dev
ServerlessDeploymentBucketName: aws-java-simple-http-end-serverlessdeploymentbuck-zzz

eugenevd@t430x:/home/eugenevd/dev/aws-java-simple-http-endpoint$ sls invoke --function currentTime --log
{
    "errorMessage": "Class not found: com.serverless.Handler",
    "errorType": "java.lang.ClassNotFoundException"
}
--------------------------------------------------------------------

eugenevd@t430x:/home/eugenevd/dev/aws-java-simple-http-endpoint$ curl https://yyy.execute-api.us-east-1.amazonaws.com/dev/ping
{"message": "Internal server error"}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading README.md, build.gradle, pom.xml, serverless.yml, and the src directory in aws-java-simple-http-endpoint. Run ./gradlew build followed by sls deploy and sls invoke --function currentTime --log to reproduce the ClassNotFoundException. Done means the example deploys and the currentTime invocation succeeds without that error.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, java
Domain
api, backend, build-system, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.