question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Dynamodb start" missing log4j/logger - exception

See original GitHub issue

Console output:

>sls dynamodb start
Dynamodb Local Started, Visit: http://localhost:8000/shell

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/logging/log4j/Logger
        at com.amazonaws.services.dynamodbv2.local.server.DynamoDBProxyServer.<clinit>(DynamoDBProxyServer.java:36)
        at com.amazonaws.services.dynamodbv2.local.main.ServerRunner.createServer(ServerRunner.java:123)
        at com.amazonaws.services.dynamodbv2.local.main.ServerRunner.createServerFromCommandLineArgs(ServerRunner.java:119)
        at com.amazonaws.services.dynamodbv2.local.main.ServerRunner.main(ServerRunner.java:70)
Caused by: java.lang.ClassNotFoundException: org.apache.logging.log4j.Logger
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 4 more
DynamoDB Local failed to start with code 1

Versions:

>sls --v
1.5.1

>java -version
java version "1.8.0_112"
Java(TM) SE Runtime Environment (build 1.8.0_112-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.112-b15, mixed mode)

>node -v
v7.2.0

Package.json:

   "serverless-dynamodb-local": "^0.2.16",
    "serverless-offline": "^3.8.3"

serverless.yaml

service: aws-nodejs-nexit

provider:
  name: aws
  runtime: nodejs4.3
functions:
  hello:
    handler: src/handler.hello
    events:
      - http:
          path: hello
          method: get
plugins:
  - serverless-offline
  - serverless-dynamodb-local

custom:
  dynamodb:
    start:
      port: 8000
      inMemory: true
      migration: true
    migration:
      dir: ./offline/migrations

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
whossacommented, Aug 9, 2019

@AshanFernando seems yes, no error when running jar from site.

>java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb
Initializing DynamoDB Local with the following configuration:
Port:   8000
InMemory:       false
DbPath: null
SharedDb:       true
shouldDelayTransientStatuses:   false
CorsParams:     *

No sense of testing the jar from the aws site, instead, you should test with your local dynamoLocal.jar in the dir .dynamodb of the serverless project home.

Test against with “java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb” to see what happens.

Probably this issue is caused by an interrupted download and worse still, when you re-run sls dynamodb install, it will remind you that “Dynamodb is already installed on path!” even it’s a broken jar.

Prune that dir and run “sls dynamodb install” again! Hope that helps

0reactions
asotjrscommented, Mar 30, 2021

@AshanFernando seems yes, no error when running jar from site.

>java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb
Initializing DynamoDB Local with the following configuration:
Port:   8000
InMemory:       false
DbPath: null
SharedDb:       true
shouldDelayTransientStatuses:   false
CorsParams:     *

No sense of testing the jar from the aws site, instead, you should test with your local dynamoLocal.jar in the dir .dynamodb of the serverless project home.

Test against with “java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb” to see what happens.

Probably this issue is caused by an interrupted download and worse still, when you re-run sls dynamodb install, it will remind you that “Dynamodb is already installed on path!” even it’s a broken jar.

Prune that dir and run “sls dynamodb install” again! Hope that helps

Thank you

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Dynamodb start" missing log4j/logger - exception #69
@AshanFernando seems yes, no error when running jar from site. >java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb ...
Read more >
Error handling with DynamoDB - AWS Documentation
Discover the best practices for handling client and server errors and exceptions returned by Amazon DynamoDB operations.
Read more >
java.lang.NoClassDefFoundError: org/apache/log4j/Logger ...
ClassNotFoundException This an Exception , it indicates that the class was ... this dependency in my build.gradle , the error disappeared :.
Read more >
Log4j 2 Lock-free Asynchronous Loggers for Low-Latency ...
If a problem happens during the logging process and an exception is ... starting another thread is not likely to give better performance....
Read more >
VPC errors - Amazon EMR - 亚马逊云科技
... configurationMissing DHCP Options SetPermissions errorsErrors that result in START_FAILEDCluster Terminated with errors and NameNode fails to start.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found