# WorkflowReplayer - java.lang.IllegalArgumentException: First event is corrupted

**URL:** <https://community.temporal.io/t/workflowreplayer-java-lang-illegalargumentexception-first-event-is-corrupted/7847>\
**Category:** Community Support\
**Tags:** java-sdk\
**Created:** [April 10, 2023, 5:46pm UTC](https://community.temporal.io/t/workflowreplayer-java-lang-illegalargumentexception-first-event-is-corrupted/7847 "2023-04-10T17:46:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![workflow](https://avatars.discourse-cdn.com/v4/letter/w/58956e/32.png) [@workflow](https://community.temporal.io/u/workflow)\
**Post date:** [April 10, 2023, 5:46pm UTC](https://community.temporal.io/t/workflowreplayer-java-lang-illegalargumentexception-first-event-is-corrupted/7847/1 "2023-04-10T17:46:19Z")

</div>

Mine is a long running workflow(continue-as-new). I am just trying use WorkflowReplayer

- Downloaded the history from temporal UI. I modified the json based on [temporal-patient-onboarding/testrun.json at main · tsurdilo/temporal-patient-onboarding · GitHub](https://github.com/tsurdilo/temporal-patient-onboarding/blob/main/onboarding-app/src/test/resources/testrun.json)
- when I run my replay test

```kotlin
 @RegisterExtension
    val extension = TestWorkflowExtension.newBuilder()
        .setWorkflowTypes(MyWorkflowImpl::class.java)
        .setNamespace("Cloud")
        .setWorkflowClientOptions(
            WorkflowClientOptions.newBuilder()
                .setDataConverter(
                    DefaultDataConverter(
                        JacksonJsonPayloadConverter(
                            Jackson2ObjectMapperBuilder.json()
                                .modulesToInstall(KotlinModule())
                                .build()
                        ),
                    ),
                )
                .build(),
        )
        .useInternalService()
        .setDoNotStart(false)
        .build()

WorkflowReplayer.replayWorkflowExecutionFromResource("MyWorkflowHistory_V2_addedKafkaEvent.json", testEnv, MyWorkflowImpl::class.java)

```

I get this exception. Thoughts?

```kotlin

First event is corrupted
java.lang.IllegalArgumentException: First event is corrupted
	at io.temporal.internal.common.WorkflowExecutionHistory.checkHistory(WorkflowExecutionHistory.java:80)
	at io.temporal.internal.common.WorkflowExecutionHistory.fromJson(WorkflowExecutionHistory.java:65)
	at io.temporal.testing.WorkflowHistoryLoader.readHistory(WorkflowHistoryLoader.java:60)
	at io.temporal.testing.WorkflowHistoryLoader.readHistoryFromResource(WorkflowHistoryLoader.java:54)
	at io.temporal.testing.WorkflowReplayer.replayWorkflowExecutionFromResource(WorkflowReplayer.java:77)

```

---

<div class="post-metadata">

**Author:** ![workflow](https://avatars.discourse-cdn.com/v4/letter/w/58956e/32.png) [@workflow](https://community.temporal.io/u/workflow)\
**Post date:** [April 11, 2023, 4:00am UTC](https://community.temporal.io/t/workflowreplayer-java-lang-illegalargumentexception-first-event-is-corrupted/7847/2 "2023-04-11T04:00:41Z")

</div>

@tihomir is there an utility class that we can use to convert/fix the json file from UI? we can not tctl on our prod cluster
