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

Bug: Multi-step Workflow throws JSON Parsing error on Java8.al2 runtime #302

Open
peter-smith-phd opened this issue Nov 8, 2022 · 1 comment
Labels
java Pull requests that update Java code

Comments

@peter-smith-phd
Copy link

Here are the steps to reproduce:

% sam init
Select AWS Quick Start Templates
Select Multi-step Workflow
Select Java8.al2
Select gradle
Select all the remaining defaults

> cd sam-app
> sam build
> sam deploy -g
Select all the remaining defaults.

In the template, change HourlyTradingSchedule to Enable: True, and rate(1 minute) so the State Machine will actually run, then:
> sam build && sam deploy

Wait a minute for the state machine to run, then in the Step Functions log for the state machine, you'll see the following:

{
  "errorMessage": "An error occurred during JSON parsing",
  "errorType": "java.lang.RuntimeException",
  "stackTrace": [],
  "cause": {
    "errorMessage": "com.amazonaws.lambda.thirdparty.com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of `java.lang.String` out of START_OBJECT token\n at [Source: (ByteArrayInputStream); line: 1, column: 323] (through reference chain: java.util.LinkedHashMap[\"detail\"])",
    "errorType": "java.io.UncheckedIOException",
    "stackTrace": [
      "com.amazonaws.services.lambda.runtime.serialization.factories.JacksonFactory$InternalSerializer.fromJson(JacksonFactory.java:184)"
    ],
    "cause": {
      "errorMessage": "Cannot deserialize instance of `java.lang.String` out of START_OBJECT token\n at [Source: (ByteArrayInputStream); line: 1, column: 323] (through reference chain: java.util.LinkedHashMap[\"detail\"])",
      "errorType": "com.amazonaws.lambda.thirdparty.com.fasterxml.jackson.databind.exc.MismatchedInputException",
      "stackTrace": [
        "com.amazonaws.lambda.thirdparty.com.fasterxml.jackson.databind.exc.MismatchedInputException.from(MismatchedInputException.java:59)",
        "com.amazonaws.lambda.thirdparty.com.fasterxml.jackson.databind.DeserializationContext.reportInputMismatch(DeserializationContext.java:1445)",
        "com.amazonaws.lambda.thirdparty.com.fasterxml.jackson.databind.DeserializationContext.handleUnexpectedToken(DeserializationContext.java:1219)",
        "com.amazonaws.lambda.thirdparty.com.fasterxml.jackson.databind.DeserializationContext.handleUnexpectedToken(DeserializationContext.java:1129)",
        "com.amazonaws.lambda.thirdparty.com.fasterxml.jackson.databind.deser.std.StringDeserializer.deserialize(StringDeserializer.java:63)",
        "com.amazonaws.lambda.thirdparty.com.fasterxml.jackson.databind.deser.std.StringDeserializer.deserialize(StringDeserializer.java:10)",
        "com.amazonaws.lambda.thirdparty.com.fasterxml.jackson.databind.deser.std.MapDeserializer._readAndBindStringKeyMap(MapDeserializer.java:527)",
        "com.amazonaws.lambda.thirdparty.com.fasterxml.jackson.databind.deser.std.MapDeserializer.deserialize(MapDeserializer.java:364)",
        "com.amazonaws.lambda.thirdparty.com.fasterxml.jackson.databind.deser.std.MapDeserializer.deserialize(MapDeserializer.java:29)",
        "com.amazonaws.lambda.thirdparty.com.fasterxml.jackson.databind.ObjectReader._bindAndClose(ObjectReader.java:1719)",
        "com.amazonaws.lambda.thirdparty.com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:1228)",
        "com.amazonaws.services.lambda.runtime.serialization.factories.JacksonFactory$InternalSerializer.fromJson(JacksonFactory.java:182)"
      ]
    }
  }
}
@peter-smith-phd peter-smith-phd changed the title Multi-step Workflow throws JSON Parsing error on Java8.al2 runtime Bug: Multi-step Workflow throws JSON Parsing error on Java8.al2 runtime Nov 8, 2022
@moelasmar moelasmar added maintainer/need-response java Pull requests that update Java code labels Nov 9, 2022
@moelasmar
Copy link
Contributor

Thanks @northvankiwiguy for raising this issue. I will try to reproduce it to investigate the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
java Pull requests that update Java code
Projects
None yet
Development

No branches or pull requests

3 participants