Jar deployment broken on serverless 1.27.2

Provider : AWS
FUnction : Lambda
Java8

I have integrated serverless with Jenkins and trying out CD pipeline.
i trigger a maven build and once the jars are generated.
i call the serverless deploy.

The S3 bucket has the Zip file with jar (only jar nothing else).
The deployment is sucessfull.
But execution of lambda throws “class not found”

If i downlad the S3 Zip file and upload the contained jar manually in AWS console it executes fine.
can you please help me, i am blocked on this.

provider:
environment:
DYNAMODB_TABLE: IAM-JWK
KEY_FETCH_INTERVAL: 30
DISCOVERY_URL: https://xyz.com/core/.well-known/openid-configuration
iamRoleStatements:
-
Action:
- “dynamodb:Query”
- “dynamodb:GetItem”
- “dynamodb:Scan”
- “dynamodb:PutItem”
- “dynamodb:UpdateItem”
- “dynamodb:DeleteItem”
Effect: Allow
Resource: “arn:aws:dynamodb:${opt:region, self:provider.region}:*:table/${self:provider.environment.DYNAMODB_TABLE}”
name: aws
runtime: java8
resources:
Resources:
IAMJWKKeysTable:
DeletionPolicy: Retain
Properties:
AttributeDefinitions:
-
AttributeName: kid
AttributeType: S
KeySchema:
-
AttributeName: kid
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
TableName: “${self:provider.environment.DYNAMODB_TABLE}”
Type: “AWS::DynamoDB::Table”
service: IAMService
package:
individually: true
functions:
fetchOAuth2JWTTokenSignKeys:
description: This lambda executes every ${self:provider.environment.KEY_FETCH_INTERVAL} to collect latest JWT keys for token verification.
handler: com.xyz.lambda.SaveJsonWebKeysHandler::handleRequest
artifact: fetchKeys.jar
events:
- schedule: rate(30 minutes)