Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lambda application return error with libjvm.so, for a node js application #367

Closed
Krishman23 opened this issue Jun 1, 2022 · 6 comments
Closed
Labels
blocked/more-info-needed More info is needed from the requester. If no response in 14 days, it will become stale. type/question Further information is requested

Comments

@Krishman23
Copy link

Krishman23 commented Jun 1, 2022

I have a node js application, which uses xslt4node package.
https://github.com/Krishman23/xslt-transform
After successful deployment from SAM Cli, im getting below errror.

{
    "errorType": "Error",
    "errorMessage": "libjvm.so: cannot open shared object file: No such file or directory",
    "code": "ERR_DLOPEN_FAILED",
    "stack": [
        "Error: libjvm.so: cannot open shared object file: No such file or directory",
        "    at Object.Module._extensions..node (internal/modules/cjs/loader.js:1144:18)",
        "    at Module.load (internal/modules/cjs/loader.js:950:32)",
        "    at Function.Module._load (internal/modules/cjs/loader.js:790:12)",
        "    at Module.require (internal/modules/cjs/loader.js:974:19)",
        "    at require (internal/modules/cjs/helpers.js:101:18)",
        "    at Object.<anonymous> (/var/task/node_modules/java/lib/nodeJavaBridge.js:21:16)",
        "    at Module._compile (internal/modules/cjs/loader.js:1085:14)",
        "    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)",
        "    at Module.load (internal/modules/cjs/loader.js:950:32)",
        "    at Function.Module._load (internal/modules/cjs/loader.js:790:12)"
    ]
}

@Krishman23 Krishman23 added the stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. label Jun 1, 2022
@moelasmar
Copy link
Contributor

moelasmar commented Jun 1, 2022

I did some investigation for this issue, and I found the following:

  • Your package depends on xslt4node which depends on java. You can find your package dependency here, and the xslt4node dependencies here
  • I found this issue raised before for the node-java repo here, and here. Based on the solutions mentioned in the previous posts, you need to set the JAVA_HOME environment variable.
  • Java will not be installed by default in the Lambda function, and so you need to provide it through a lambda layer function, then you can set the value of the java home environment variable. Or another solution is to create Lambda Function with Image Type.

@moelasmar
Copy link
Contributor

based on the previous investigation, I do not think that this issue is related to SAM Builders.

@Krishman23
Copy link
Author

@moelasmar thank you for your information on lambda layers. I'm new to lambda, could you please help me how we can introduce java with lambda layer ? is there any tutorials or links that refers to the solution?

@moelasmar
Copy link
Contributor

sorry @Krishman23 I do not have enough info about doing that. Let me do some investigations and I will come back to you with some approach.

My feelings is using the Image type Lambda function will be easier in this case, as you can control what will exist in the running container. Do you have any preference on using the ZIP type lambda functions, or you are OK with both options ?

@moelasmar moelasmar added maintainer/need-followup and removed stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. labels Jun 7, 2022
@mildaniel mildaniel added the type/question Further information is requested label Jun 24, 2022
@moelasmar
Copy link
Contributor

@Krishman23 .. were you able to find a way to include the java binaries in the lambda function layers?

@moelasmar moelasmar added the blocked/more-info-needed More info is needed from the requester. If no response in 14 days, it will become stale. label Jul 28, 2022
@torresxb1
Copy link
Contributor

Closing as there hasn't been more information provided, please reopen if there's still something you'd like the team to look into.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked/more-info-needed More info is needed from the requester. If no response in 14 days, it will become stale. type/question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants