Failure exceeds size limit when initializing Selenium web driver

I created a simple workflow and activity to initialize a web driver using Selenium so that I can use that driver in another activity.

However, my initializeDriver activity does not complete and remains stuck on pending indefinitely.

Here are the logs:

{
  "message": "Failure exceeds size limit.",
  "source": "",
  "stackTrace": "",
  "encodedAttributes": null,
  "cause": {
    "message": "com.fasterxml.jackson.databind.JsonMappingException: Infinite recursion (StackOverflowError) (through reference chain: org.openqa.selenium.remote.http.Filter$$Lambda$247/0x000001fad331c118[\"arg$2\"]->org.openqa.selenium.remote.http.jdk.JdkHttpClient$$Lambda$246/0x000001fad331bee8[\"arg$1\"]->org.openqa.selenium.remote.http.jdk.JdkHttpClient[\"handler\"]->org.openqa.selenium.remote.http.Filter$$Lambda$247/0x000001fad331c118[\"arg$2\"]->org.openqa.selenium.remote.http.jdk.JdkHttpClient$$Lambda$246/0x000001fad331bee8[\"arg$1\"]->org.openqa.selenium.remote.http.jdk.JdkHttpClient[\"handler\"]->org.openqa.selenium.remote.http.Filter$$Lambda$247/0x000001fad331c118[\"arg$2\"]->org.openqa.selenium.remote.http.jdk.JdkHttpClient$$Lambda$246/0x000001fad331bee8[\"arg$1\"]->org.openqa.selenium.remote.http.jdk.JdkHttpClient[\"handler\"]->org.openqa.selenium.remote.http.Filter$$Lambda$247/0x000001fad331c118[\"arg$2\"]->org.openqa.selenium.remote.http.jdk.JdkHttpClient$$Lambda$246/0x000001fad331bee8[\"arg$1\"]->org.openqa.selenium.remote.http.jdk.JdkHttpClient[\"handler\"]->org.openqa.selenium.remote.http.Filter$$Lambda$247/0x000001fad331c118[\"arg$2\"]->org.openqa.selenium.remote.http.jdk.JdkHttpClient$$Lambda$246/0x000001fad331bee8[\"arg$1\"]->org.openqa.selenium.remote.http.jdk.JdkHttpClient[\"handler\"]->org.openqa.selenium.remote.http.Filter$$Lambda$247/0x000001fad331c118[\"arg$2\"]->org.openqa.selenium.remote.http.jdk.JdkHttpClient$$Lambda$246/0x000001fad331bee8[\"arg$1\"]->org.openqa.selenium.remote.http.jdk.JdkHttpClient[\"handler\"]->org.openqa.selenium.remote.http.Filter$$Lambda$247/0x000001fad331c118[\"arg$2\"]->org.openqa.selenium.remote.http.jdk.JdkHttpClient$$Lambda$246/0x000001fad331bee8[\"arg$1\"]->org.openqa.selenium.remote.http.jdk.JdkHttpClient[\"handler\"]->org.openqa.selenium.remote.http.Filter$$Lambda$247/0x000001fad331c118[\"arg$2\"]->org.openqa.selenium.remote.http.jdk.JdkHttpClient$$Lambda$246/0x000001fad331bee8[\"arg$1\"]->org.openqa.selenium.remote.http.jdk.JdkHttpClient[\"handler\"]->org.openqa.selenium.remote.http.Filter$$Lambda$247/0x000001fad331c118[\"arg$2\"]->org.openqa.selenium.remote.http.jdk.JdkHttpClient$$Lambda$246/0x000001fad331bee8[\"arg$1\"]->org.openqa.selenium.remote.http.jdk.JdkHttpClient[\"handler\"]->org.openqa.selenium.remote.http.Filter$$Lambda$247/0x000001fad331c118[\"arg$2\"]->org.openqa.selenium.remote.http.jdk.JdkHttpClient$$Lambda$246/0x000001fad331bee8[\"arg$1\"]->org.openqa.selenium.remote.http.jdk.JdkHttpClient[\"handler\"]->org.openqa.selenium.remote.http.Filter$$Lambda$247/0x000001fad331c118[\"arg$2\"]->org.openqa.selenium.remote.http.jdk.JdkHttpClient$$Lambda$246/0x000001fad331bee8[\"arg$1\"]->org.openqa.selenium.remote.http.jdk.JdkHttpClient[\"handler\"]->org.openqa.selenium.remote.http.Filter$$Lambda$247/0x000001fad331c118[\"arg$2\"]->org.openqa.selenium.remote.http.jdk.JdkHttpClient$$Lambda$246/0x000001fad331bee8[\"arg$1\"]->org.openqa.selenium.remote.http.jdk.JdkHttpClient[\"handler\"]->org.openqa.selenium.remote.http.Filter$$Lambda$247/0x000001fad331c118[\"arg$2\"]->org.openqa.selenium.remote.http.jdk.JdkHttpClient$$Lambda$246/0x000001fad331bee8[\"arg$1\"]->org.openqa.selenium.remote.http.jdk.JdkHttpClient[\"handler\"]->org.openqa.selenium.remote.http.Filter$$Lambda$247/0x000001fad331c118[\"arg$2\"]->org.openqa.selenium.remote.http.jdk.JdkHttpClient$$Lambda$246/0x000001fad331bee8[\"arg$1\"]->org.openqa.selenium.remote.http.jdk.JdkHttpClient[\"handler\"]->org.openqa.selenium.remote.http.Filter$$Lambda$247/0x000001fad331c118[\"arg$2\"]->org.openqa.selenium.remote.http.jdk.JdkHttpClient$$Lambda$246/0x000001fad331bee8[\"arg$1\"]->org.openqa.selenium.remote.http.jdk.JdkHttpClient[\"handler\"]->org.openqa.selenium.remote.http.Filter$$Lambda$247/0x000001fad331c118[\"arg$2\"]->org.openqa.selenium.remote.http.jdk.JdkHttpClient$$Lambda$246/0x000001fad331bee8[\"arg$1\"]->org.openqa.selenium.remote.http.jdk.JdkHttpClient[\"handler\"]->org.openqa.selenium.remote.http.Filter$$Lambda$247/0x000001fad331c118[\"arg$2\"]->org.openqa.selenium.remote.http.jdk.JdkHttpClient$$Lambda$246/0x000001fad331bee8[\"arg$1\"]->org.openqa.selenium.remote.http.jdk.JdkHttpClient[\"handler\"]->org.openqa.selen",
    "source": "JavaSDK",
    "stackTrace": "",
    "encodedAttributes": null,
    "cause": null,
    "applicationFailureInfo": {
      "type": "io.temporal.common.converter.DataConverterException",
      "nonRetryable": false,
      "details": null
    }
  },
  "serverFailureInfo": {
    "nonRetryable": false
  }
}

The code is really simple:

Workflow

public class WorkflowImpl implements Workflow {
    private final WorkflowActivities activities = Workflow.newActivityStub(
            WorkflowActivities.class,
            ActivityOptions
                    .newBuilder()
                    .setStartToCloseTimeout(
                            Duration.ofMinutes(1)
                    ).build()
    );

    @Override
    public void scrapePageContent() {
        WebDriver driver = null;
        try {
            driver = bookingActivities.initializeDriver();
        } finally {
            driver.quit();
        }
    }
}

Activity

public class ActivitiesImpl implements Activities {
    @Override
    public WebDriver initializeDriver() {
        ChromeOptions options = new ChromeOptions();
        WebDriver driver = new ChromeDriver(options);

        return driver;
    }
}