desnudopenguino / aws-lambda-jruby

Run ruby code on JRuby on AWS Lambda Java
0 stars 1 forks source link

NoClassDefFoundError for IsolatedScriptingContainer #2

Open edmz opened 6 years ago

edmz commented 6 years ago

I tried running this on AWS Lambda, with SAM.

My ruby code is as simple as it gets:

require 'yaml'
require "open-uri"

URI.parse("http://URI_HERE/").read
return YAML.dump { a: 1, b: 2}

The template.yml for SAM is:

AWSTemplateFormatVersion: 2010-09-09
Transform:
- AWS::Serverless-2016-10-31

Resources:
  AwsLambdaJrubyTest:
    Type: AWS::Serverless::Function
    Properties:
      Handler: AWSLambdaJRuby::handler
      CodeUri: ./build/libs/aws-lambda-jruby.jar
      Runtime: java8
      MemorySize: 1156
      Timeout: 70
      Events:
        GetEvent:
          Type: Api
          Properties:
            Path: /java
            Method: get

But on the error log I see:

org/jruby/embed/IsolatedScriptingContainer: java.lang.NoClassDefFoundError java.lang.NoClassDefFoundError: org/jruby/embed/IsolatedScriptingContainer at AWSLambdaJRuby.handler(AWSLambdaJRuby.java:17)

I could only find one reference to a similar error but I don't think this is related.

It seems to be an error on my side, but I don't see what it could be.

Thanks for any help in case this is not an issue with your code.