We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
bug: java.lang.IllegalArgumentException: argument type mismatch with RequestHandler
### Is there an existing issue for this?

- [X] I have searched the existing issues

### Current Behavior

The following request handler:

```java
public class LegalDocPublisher implements RequestHandler<SQSEvent, Void> {
    @Override
    public Void handleRequest(final SQSEvent event, final Context context) {
        return null;
    }
}
```

causes 

```
2022-10-10T06:38:23.362  INFO --- [  Thread-244] l.s.a.lambda_executors     : Error executing Lambda "arn:aws:lambda:us-east-2:000000000000:function:LegalDocPublisher": InvocationException: Lambda process returned error status code: 1. Result: . Output:
Exception in thread "main" java.lang.IllegalArgumentException: argument type mismatch
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.base/java.lang.reflect.Method.invoke(Unknown Source)
        at cloud.localstack.LambdaExecutor.main(LambdaExecutor.java:117)   File "/opt/code/localstack/localstack/services/awslambda/lambda_executors.py", line 1423, in do_execute
    execute_result = lambda_function_callable(inv_context.event, context)
  File "/opt/code/localstack/localstack/services/awslambda/lambda_api.py", line 579, in execute
    result = lambda_executors.EXECUTOR_LOCAL.execute_java_lambda(
  File "/opt/code/localstack/localstack/services/awslambda/lambda_executors.py", line 1532, in execute_java_lambda
    invocation_result = self._execute_in_custom_runtime(cmd, lambda_function=lambda_function)
  File "/opt/code/localstack/localstack/services/awslambda/lambda_executors.py", line 1366, in _execute_in_custom_runtime
    raise InvocationException(
```

when execution is triggered.

This works fine until LocalStack 1.0.4.

### Expected Behavior

No exceptions.

### How are you starting LocalStack?

Custom (please describe below)

### Steps To Reproduce

LocalStack is started as part of integration tests run by Maven, via `docker-maven-plugin`.

### Environment

```markdown
- OS: 20.04
- LocalStack: 1.2.0
```


### Anything else?

AWS SDK version: 1.12.271

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `localstack/services/awslambda/packages.py`
Content:
```
1 import os
2 import platform
3 import stat
4 from typing import List
5 
6 from localstack.packages import DownloadInstaller, InstallTarget, Package, PackageInstaller
7 from localstack.packages.core import ArchiveDownloadAndExtractInstaller, SystemNotSupportedException
8 from localstack.utils.platform import get_arch
9 
10 LAMBDA_RUNTIME_INIT_URL = "https://github.com/localstack/lambda-runtime-init/releases/download/{version}/aws-lambda-rie-{arch}"
11 
12 LAMBDA_RUNTIME_DEFAULT_VERSION = "v0.1.8-pre"
13 
14 # GO Lambda runtime
15 GO_RUNTIME_VERSION = "0.4.0"
16 GO_RUNTIME_DOWNLOAD_URL_TEMPLATE = "https://github.com/localstack/awslamba-go-runtime/releases/download/v{version}/awslamba-go-runtime-{version}-{os}-{arch}.tar.gz"
17 
18 
19 class AWSLambdaRuntimePackage(Package):
20     def __init__(self, default_version: str = LAMBDA_RUNTIME_DEFAULT_VERSION):
21         super().__init__(name="AwsLambda", default_version=default_version)
22 
23     def get_versions(self) -> List[str]:
24         return [
25             "v0.1.8-pre",
26             "v0.1.7-pre",
27             "v0.1.6-pre",
28             "v0.1.5-pre",
29             "v0.1.4-pre",
30             "v0.1.1-pre",
31             "v0.1-pre",
32         ]
33 
34     def _get_installer(self, version: str) -> PackageInstaller:
35         return AWSLambdaRuntimePackageInstaller(name="awslambda-runtime", version=version)
36 
37 
38 class AWSLambdaRuntimePackageInstaller(DownloadInstaller):
39     def _get_download_url(self) -> str:
40         arch = get_arch()
41         arch = "x86_64" if arch == "amd64" else arch
42         return LAMBDA_RUNTIME_INIT_URL.format(version=self.version, arch=arch)
43 
44     def _install(self, target: InstallTarget) -> None:
45         super()._install(target)
46         install_location = self.get_executable_path()
47         st = os.stat(install_location)
48         os.chmod(install_location, mode=st.st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
49 
50 
51 class AWSLambdaGoRuntimePackage(Package):
52     def __init__(self, default_version: str = GO_RUNTIME_VERSION):
53         super().__init__(name="AwsLambdaGo", default_version=default_version)
54 
55     def get_versions(self) -> List[str]:
56         return [GO_RUNTIME_VERSION]
57 
58     def _get_installer(self, version: str) -> PackageInstaller:
59         return AWSLambdaGoRuntimePackageInstaller(name="awslamba-go-runtime", version=version)
60 
61 
62 class AWSLambdaGoRuntimePackageInstaller(ArchiveDownloadAndExtractInstaller):
63     def _get_download_url(self) -> str:
64         system = platform.system().lower()
65         arch = get_arch()
66 
67         if system not in ["linux"]:
68             raise SystemNotSupportedException(f"Unsupported os {system} for awslambda-go-runtime")
69         if arch not in ["amd64", "arm64"]:
70             raise SystemNotSupportedException(f"Unsupported arch {arch} for awslambda-go-runtime")
71 
72         return GO_RUNTIME_DOWNLOAD_URL_TEMPLATE.format(
73             version=GO_RUNTIME_VERSION,
74             os=system,
75             arch=arch,
76         )
77 
78     def _get_install_marker_path(self, install_dir: str) -> str:
79         return os.path.join(install_dir, "aws-lambda-mock")
80 
81     def _install(self, target: InstallTarget) -> None:
82         super()._install(target)
83 
84         install_dir = self._get_install_dir(target)
85         install_location = self._get_install_marker_path(install_dir)
86         st = os.stat(install_location)
87         os.chmod(install_location, st.st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
88 
89         go_lambda_mockserver = os.path.join(install_dir, "mockserver")
90         st = os.stat(go_lambda_mockserver)
91         os.chmod(go_lambda_mockserver, st.st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
92 
93 
94 # version of the Maven dependency with Java utility code
95 LOCALSTACK_MAVEN_VERSION = "0.2.21"
96 MAVEN_REPO_URL = "https://repo1.maven.org/maven2"
97 URL_LOCALSTACK_FAT_JAR = (
98     "{mvn_repo}/cloud/localstack/localstack-utils/{ver}/localstack-utils-{ver}-fat.jar"
99 )
100 
101 
102 class AWSLambdaJavaPackage(Package):
103     def __init__(self):
104         super().__init__("LambdaJavaLibs", "0.2.21")
105 
106     def get_versions(self) -> List[str]:
107         return ["0.2.21"]
108 
109     def _get_installer(self, version: str) -> PackageInstaller:
110         return AWSLambdaJavaPackageInstaller("lambda-java-libs", version)
111 
112 
113 class AWSLambdaJavaPackageInstaller(DownloadInstaller):
114     def _get_download_url(self) -> str:
115         return URL_LOCALSTACK_FAT_JAR.format(ver=self.version, mvn_repo=MAVEN_REPO_URL)
116 
117 
118 awslambda_runtime_package = AWSLambdaRuntimePackage()
119 awslambda_go_runtime_package = AWSLambdaGoRuntimePackage()
120 lambda_java_libs_package = AWSLambdaJavaPackage()
121
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/localstack/services/awslambda/packages.py b/localstack/services/awslambda/packages.py
--- a/localstack/services/awslambda/packages.py
+++ b/localstack/services/awslambda/packages.py
@@ -101,10 +101,10 @@
 
 class AWSLambdaJavaPackage(Package):
     def __init__(self):
-        super().__init__("LambdaJavaLibs", "0.2.21")
+        super().__init__("LambdaJavaLibs", "0.2.22")
 
     def get_versions(self) -> List[str]:
-        return ["0.2.21"]
+        return ["0.2.22", "0.2.21"]
 
     def _get_installer(self, version: str) -> PackageInstaller:
         return AWSLambdaJavaPackageInstaller("lambda-java-libs", version)

{"golden_diff": "diff --git a/localstack/services/awslambda/packages.py b/localstack/services/awslambda/packages.py\n--- a/localstack/services/awslambda/packages.py\n+++ b/localstack/services/awslambda/packages.py\n@@ -101,10 +101,10 @@\n \n class AWSLambdaJavaPackage(Package):\n     def __init__(self):\n-        super().__init__(\"LambdaJavaLibs\", \"0.2.21\")\n+        super().__init__(\"LambdaJavaLibs\", \"0.2.22\")\n \n     def get_versions(self) -> List[str]:\n-        return [\"0.2.21\"]\n+        return [\"0.2.22\", \"0.2.21\"]\n \n     def _get_installer(self, version: str) -> PackageInstaller:\n         return AWSLambdaJavaPackageInstaller(\"lambda-java-libs\", version)\n", "issue": "bug: java.lang.IllegalArgumentException: argument type mismatch with RequestHandler\n### Is there an existing issue for this?\r\n\r\n- [X] I have searched the existing issues\r\n\r\n### Current Behavior\r\n\r\nThe following request handler:\r\n\r\n```java\r\npublic class LegalDocPublisher implements RequestHandler<SQSEvent, Void> {\r\n    @Override\r\n    public Void handleRequest(final SQSEvent event, final Context context) {\r\n        return null;\r\n    }\r\n}\r\n```\r\n\r\ncauses \r\n\r\n```\r\n2022-10-10T06:38:23.362  INFO --- [  Thread-244] l.s.a.lambda_executors     : Error executing Lambda \"arn:aws:lambda:us-east-2:000000000000:function:LegalDocPublisher\": InvocationException: Lambda process returned error status code: 1. Result: . Output:\r\nException in thread \"main\" java.lang.IllegalArgumentException: argument type mismatch\r\n        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)\r\n        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)\r\n        at java.base/java.lang.reflect.Method.invoke(Unknown Source)\r\n        at cloud.localstack.LambdaExecutor.main(LambdaExecutor.java:117)   File \"/opt/code/localstack/localstack/services/awslambda/lambda_executors.py\", line 1423, in do_execute\r\n    execute_result = lambda_function_callable(inv_context.event, context)\r\n  File \"/opt/code/localstack/localstack/services/awslambda/lambda_api.py\", line 579, in execute\r\n    result = lambda_executors.EXECUTOR_LOCAL.execute_java_lambda(\r\n  File \"/opt/code/localstack/localstack/services/awslambda/lambda_executors.py\", line 1532, in execute_java_lambda\r\n    invocation_result = self._execute_in_custom_runtime(cmd, lambda_function=lambda_function)\r\n  File \"/opt/code/localstack/localstack/services/awslambda/lambda_executors.py\", line 1366, in _execute_in_custom_runtime\r\n    raise InvocationException(\r\n```\r\n\r\nwhen execution is triggered.\r\n\r\nThis works fine until LocalStack 1.0.4.\r\n\r\n### Expected Behavior\r\n\r\nNo exceptions.\r\n\r\n### How are you starting LocalStack?\r\n\r\nCustom (please describe below)\r\n\r\n### Steps To Reproduce\r\n\r\nLocalStack is started as part of integration tests run by Maven, via `docker-maven-plugin`.\r\n\r\n### Environment\r\n\r\n```markdown\r\n- OS: 20.04\r\n- LocalStack: 1.2.0\r\n```\r\n\r\n\r\n### Anything else?\r\n\r\nAWS SDK version: 1.12.271\n", "before_files": [{"content": "import os\nimport platform\nimport stat\nfrom typing import List\n\nfrom localstack.packages import DownloadInstaller, InstallTarget, Package, PackageInstaller\nfrom localstack.packages.core import ArchiveDownloadAndExtractInstaller, SystemNotSupportedException\nfrom localstack.utils.platform import get_arch\n\nLAMBDA_RUNTIME_INIT_URL = \"https://github.com/localstack/lambda-runtime-init/releases/download/{version}/aws-lambda-rie-{arch}\"\n\nLAMBDA_RUNTIME_DEFAULT_VERSION = \"v0.1.8-pre\"\n\n# GO Lambda runtime\nGO_RUNTIME_VERSION = \"0.4.0\"\nGO_RUNTIME_DOWNLOAD_URL_TEMPLATE = \"https://github.com/localstack/awslamba-go-runtime/releases/download/v{version}/awslamba-go-runtime-{version}-{os}-{arch}.tar.gz\"\n\n\nclass AWSLambdaRuntimePackage(Package):\n    def __init__(self, default_version: str = LAMBDA_RUNTIME_DEFAULT_VERSION):\n        super().__init__(name=\"AwsLambda\", default_version=default_version)\n\n    def get_versions(self) -> List[str]:\n        return [\n            \"v0.1.8-pre\",\n            \"v0.1.7-pre\",\n            \"v0.1.6-pre\",\n            \"v0.1.5-pre\",\n            \"v0.1.4-pre\",\n            \"v0.1.1-pre\",\n            \"v0.1-pre\",\n        ]\n\n    def _get_installer(self, version: str) -> PackageInstaller:\n        return AWSLambdaRuntimePackageInstaller(name=\"awslambda-runtime\", version=version)\n\n\nclass AWSLambdaRuntimePackageInstaller(DownloadInstaller):\n    def _get_download_url(self) -> str:\n        arch = get_arch()\n        arch = \"x86_64\" if arch == \"amd64\" else arch\n        return LAMBDA_RUNTIME_INIT_URL.format(version=self.version, arch=arch)\n\n    def _install(self, target: InstallTarget) -> None:\n        super()._install(target)\n        install_location = self.get_executable_path()\n        st = os.stat(install_location)\n        os.chmod(install_location, mode=st.st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)\n\n\nclass AWSLambdaGoRuntimePackage(Package):\n    def __init__(self, default_version: str = GO_RUNTIME_VERSION):\n        super().__init__(name=\"AwsLambdaGo\", default_version=default_version)\n\n    def get_versions(self) -> List[str]:\n        return [GO_RUNTIME_VERSION]\n\n    def _get_installer(self, version: str) -> PackageInstaller:\n        return AWSLambdaGoRuntimePackageInstaller(name=\"awslamba-go-runtime\", version=version)\n\n\nclass AWSLambdaGoRuntimePackageInstaller(ArchiveDownloadAndExtractInstaller):\n    def _get_download_url(self) -> str:\n        system = platform.system().lower()\n        arch = get_arch()\n\n        if system not in [\"linux\"]:\n            raise SystemNotSupportedException(f\"Unsupported os {system} for awslambda-go-runtime\")\n        if arch not in [\"amd64\", \"arm64\"]:\n            raise SystemNotSupportedException(f\"Unsupported arch {arch} for awslambda-go-runtime\")\n\n        return GO_RUNTIME_DOWNLOAD_URL_TEMPLATE.format(\n            version=GO_RUNTIME_VERSION,\n            os=system,\n            arch=arch,\n        )\n\n    def _get_install_marker_path(self, install_dir: str) -> str:\n        return os.path.join(install_dir, \"aws-lambda-mock\")\n\n    def _install(self, target: InstallTarget) -> None:\n        super()._install(target)\n\n        install_dir = self._get_install_dir(target)\n        install_location = self._get_install_marker_path(install_dir)\n        st = os.stat(install_location)\n        os.chmod(install_location, st.st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)\n\n        go_lambda_mockserver = os.path.join(install_dir, \"mockserver\")\n        st = os.stat(go_lambda_mockserver)\n        os.chmod(go_lambda_mockserver, st.st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)\n\n\n# version of the Maven dependency with Java utility code\nLOCALSTACK_MAVEN_VERSION = \"0.2.21\"\nMAVEN_REPO_URL = \"https://repo1.maven.org/maven2\"\nURL_LOCALSTACK_FAT_JAR = (\n    \"{mvn_repo}/cloud/localstack/localstack-utils/{ver}/localstack-utils-{ver}-fat.jar\"\n)\n\n\nclass AWSLambdaJavaPackage(Package):\n    def __init__(self):\n        super().__init__(\"LambdaJavaLibs\", \"0.2.21\")\n\n    def get_versions(self) -> List[str]:\n        return [\"0.2.21\"]\n\n    def _get_installer(self, version: str) -> PackageInstaller:\n        return AWSLambdaJavaPackageInstaller(\"lambda-java-libs\", version)\n\n\nclass AWSLambdaJavaPackageInstaller(DownloadInstaller):\n    def _get_download_url(self) -> str:\n        return URL_LOCALSTACK_FAT_JAR.format(ver=self.version, mvn_repo=MAVEN_REPO_URL)\n\n\nawslambda_runtime_package = AWSLambdaRuntimePackage()\nawslambda_go_runtime_package = AWSLambdaGoRuntimePackage()\nlambda_java_libs_package = AWSLambdaJavaPackage()\n", "path": "localstack/services/awslambda/packages.py"}], "after_files": [{"content": "import os\nimport platform\nimport stat\nfrom typing import List\n\nfrom localstack.packages import DownloadInstaller, InstallTarget, Package, PackageInstaller\nfrom localstack.packages.core import ArchiveDownloadAndExtractInstaller, SystemNotSupportedException\nfrom localstack.utils.platform import get_arch\n\nLAMBDA_RUNTIME_INIT_URL = \"https://github.com/localstack/lambda-runtime-init/releases/download/{version}/aws-lambda-rie-{arch}\"\n\nLAMBDA_RUNTIME_DEFAULT_VERSION = \"v0.1.8-pre\"\n\n# GO Lambda runtime\nGO_RUNTIME_VERSION = \"0.4.0\"\nGO_RUNTIME_DOWNLOAD_URL_TEMPLATE = \"https://github.com/localstack/awslamba-go-runtime/releases/download/v{version}/awslamba-go-runtime-{version}-{os}-{arch}.tar.gz\"\n\n\nclass AWSLambdaRuntimePackage(Package):\n    def __init__(self, default_version: str = LAMBDA_RUNTIME_DEFAULT_VERSION):\n        super().__init__(name=\"AwsLambda\", default_version=default_version)\n\n    def get_versions(self) -> List[str]:\n        return [\n            \"v0.1.8-pre\",\n            \"v0.1.7-pre\",\n            \"v0.1.6-pre\",\n            \"v0.1.5-pre\",\n            \"v0.1.4-pre\",\n            \"v0.1.1-pre\",\n            \"v0.1-pre\",\n        ]\n\n    def _get_installer(self, version: str) -> PackageInstaller:\n        return AWSLambdaRuntimePackageInstaller(name=\"awslambda-runtime\", version=version)\n\n\nclass AWSLambdaRuntimePackageInstaller(DownloadInstaller):\n    def _get_download_url(self) -> str:\n        arch = get_arch()\n        arch = \"x86_64\" if arch == \"amd64\" else arch\n        return LAMBDA_RUNTIME_INIT_URL.format(version=self.version, arch=arch)\n\n    def _install(self, target: InstallTarget) -> None:\n        super()._install(target)\n        install_location = self.get_executable_path()\n        st = os.stat(install_location)\n        os.chmod(install_location, mode=st.st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)\n\n\nclass AWSLambdaGoRuntimePackage(Package):\n    def __init__(self, default_version: str = GO_RUNTIME_VERSION):\n        super().__init__(name=\"AwsLambdaGo\", default_version=default_version)\n\n    def get_versions(self) -> List[str]:\n        return [GO_RUNTIME_VERSION]\n\n    def _get_installer(self, version: str) -> PackageInstaller:\n        return AWSLambdaGoRuntimePackageInstaller(name=\"awslamba-go-runtime\", version=version)\n\n\nclass AWSLambdaGoRuntimePackageInstaller(ArchiveDownloadAndExtractInstaller):\n    def _get_download_url(self) -> str:\n        system = platform.system().lower()\n        arch = get_arch()\n\n        if system not in [\"linux\"]:\n            raise SystemNotSupportedException(f\"Unsupported os {system} for awslambda-go-runtime\")\n        if arch not in [\"amd64\", \"arm64\"]:\n            raise SystemNotSupportedException(f\"Unsupported arch {arch} for awslambda-go-runtime\")\n\n        return GO_RUNTIME_DOWNLOAD_URL_TEMPLATE.format(\n            version=GO_RUNTIME_VERSION,\n            os=system,\n            arch=arch,\n        )\n\n    def _get_install_marker_path(self, install_dir: str) -> str:\n        return os.path.join(install_dir, \"aws-lambda-mock\")\n\n    def _install(self, target: InstallTarget) -> None:\n        super()._install(target)\n\n        install_dir = self._get_install_dir(target)\n        install_location = self._get_install_marker_path(install_dir)\n        st = os.stat(install_location)\n        os.chmod(install_location, st.st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)\n\n        go_lambda_mockserver = os.path.join(install_dir, \"mockserver\")\n        st = os.stat(go_lambda_mockserver)\n        os.chmod(go_lambda_mockserver, st.st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)\n\n\n# version of the Maven dependency with Java utility code\nLOCALSTACK_MAVEN_VERSION = \"0.2.21\"\nMAVEN_REPO_URL = \"https://repo1.maven.org/maven2\"\nURL_LOCALSTACK_FAT_JAR = (\n    \"{mvn_repo}/cloud/localstack/localstack-utils/{ver}/localstack-utils-{ver}-fat.jar\"\n)\n\n\nclass AWSLambdaJavaPackage(Package):\n    def __init__(self):\n        super().__init__(\"LambdaJavaLibs\", \"0.2.22\")\n\n    def get_versions(self) -> List[str]:\n        return [\"0.2.22\", \"0.2.21\"]\n\n    def _get_installer(self, version: str) -> PackageInstaller:\n        return AWSLambdaJavaPackageInstaller(\"lambda-java-libs\", version)\n\n\nclass AWSLambdaJavaPackageInstaller(DownloadInstaller):\n    def _get_download_url(self) -> str:\n        return URL_LOCALSTACK_FAT_JAR.format(ver=self.version, mvn_repo=MAVEN_REPO_URL)\n\n\nawslambda_runtime_package = AWSLambdaRuntimePackage()\nawslambda_go_runtime_package = AWSLambdaGoRuntimePackage()\nlambda_java_libs_package = AWSLambdaJavaPackage()\n", "path": "localstack/services/awslambda/packages.py"}]}