chrisguttandin / dynamo-db-local

A wrapper around Amazon's DynamoDB Local to start and stop it from Node.js.
MIT License
13 stars 5 forks source link

Cannot start 'Java' local dynamodb with versions greater than 8.0.0 #119

Open mxro opened 4 days ago

mxro commented 4 days ago

Environment

Test case

For reference, here the code how I spawn the instance:

 if (commandExists('java')) {
    console.debug('Starting local DynamoDB with Java');
    const pr = dynamoDBLocal.spawn({
      port: MAPPED_PORT,
      path: null,
      detached: false,
    });
    await waitPort({
      host: 'localhost',
      port: MAPPED_PORT,
    });
    console.debug('Started local DynamoDB with Java');
    return {
      port: MAPPED_PORT,
      stop: async () => {
        console.debug('Stopping local Java DynamoDB');
        try {
          await killProcess(pr);
        } catch (e) {
          console.error('Stopping local Java DynamoDB process not successful');
          throw e;
        }
        console.debug('Local Java DynamoDB stopped');
      },
    };
  }

https://github.com/goldstack/goldstack/blob/09810c61c34b39436420e64b72f86a29fa3d796b/workspaces/templates-lib/packages/template-dynamodb/src/localDynamoDB.ts#L142

The waitPort method never returns when using package > 8.0.0. Could this be related with the path lookup in package having changed?

chrisguttandin commented 8 hours ago

I think the main difference between the v8.0 and v8.1 is this commit https://github.com/chrisguttandin/dynamo-db-local/commit/c17285a111ad9a158d9098259cea037c03cde947. It updates DynamoDB Local to v2.3.0. This update in itself updated the JDK.

https://github.com/chrisguttandin/dynamo-db-local/commit/c17285a111ad9a158d9098259cea037c03cde947#diff-4a887757e1a3d31931e4b8281af3d6c5bf8cbe84d5b503218990fe81d22df575R10-R14

Could that be the reason for the problem?