Git Product home page Git Product logo

quarkus-dynamodb-enhanced's Introduction

This is a quarkus extension that attempts to make the dynamodb enhanced library compatible with native image (and quarkus).

If you do not have quarkus, you can just strip all the quarkus stuff out. Pretty much just use the classes in the "runtime" module.

This extension specifically fixes the following problems:

  • ClassDefNotFoundError when running tests (with quarkus)
  • GraalVM Native-image runtime/reflection issues

The fix for quarkus-tests uses the same workaround as for the native-image. There is no other way (from my point of view) for native-image (except full support for dynamically generated lambdas). But for jvm mode it has a slight performance-hit in contrast to the lambdas.

A detection is in place such that the fix for tests is only applied when in "test"-profile. For normal builds (like prod) this fix is not applied so you keep the full LambdaMetafactory performance.

Everything should just work out-of-the box ❤️

Note: The workaround for tests can be removed when aws/aws-sdk-java-v2#2604 is fixed.

What does it do technically

In short, the AWS SDK tries to create and load lambdas at runtime but since the native-image is pre-compiled, this is not possible.

Instead, the predecessor, MethodHandles are used instead which are fully supported.

There is also an additional bugfix for quarkus in there that deals with multiple classloaders when running tests. Although this is a separate issue, the same fix described above conveniently fixed this too.

As a bonus, since the DynamoDbBeans are accessed by reflection, they are automatically registered for this purpose in the GraalVM native-image generation. This means that you do not need to add @RegisterForReflection to all your beans.

If want to know even more about the technical side, feel free to dive into the code. You can find extensive information in the javadoc (and of course the code itself)!

Can I use it in production?

Probably. You certainly have to decide for yourself if you want to take the risk. See the disclaimer in the license!

I just researched and spent weeks trying to fix all problems because I needed it for work. (However, there is no association! I did that in my free time!)

We deployed it in production and has been running happily since!

Usage

pom.xml

To use this extension, just import it as a normal dependency:

<dependency>
    <groupId>me.nithanim.quarkus</groupId>
    <artifactId>quarkus-amazon-dynamodb-enhanced</artifactId>
    <version>1.2.0</version>
</dependency>

Note: For Quarkus below version 2.6 (which introduced Quarkiverse) use version 1.0.1.

Note/Warning: This extension is built against a specific quarkus version (see pom.xml properties). Since you are probably using the quarkus version bom in your project like so:

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>io.quarkus.platform</groupId>
            <artifactId>quarkus-bom</artifactId>
            <version>${quarkus.platform.version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
    <dependency>
        <groupId>io.quarkus.platform</groupId>
        <artifactId>quarkus-amazon-services-bom</artifactId>
        <version>${quarkus.platform.version}</version>
        <type>pom</type>
        <scope>import</scope>
    </dependency>
</dependencyManagement>

the versions defined there take precedence over the ones defined in this extension.

In any case, you can always exclude the dependencies and add them to your project directly (like every other quarkus dependency you have added). It might look something like this:

<dependencies>
    <dependency>
        <groupId>me.nithanim.quarkus</groupId>
        <artifactId>quarkus-amazon-dynamodb-enhanced</artifactId>
        <version>1.0.1</version>
        <exclusions>
            <exclusion>
                <groupId>io.quarkus</groupId>
                <artifactId>quarkus-arc</artifactId>
            </exclusion>
            <exclusion>
                <groupId>io.quarkus</groupId>
                <artifactId>quarkus-amazon-dynamodb</artifactId>
            </exclusion>
            <exclusion>
                <groupId>software.amazon.awssdk</groupId>
                <artifactId>dynamodb-enhanced</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>io.quarkus</groupId>
        <artifactId>quarkus-amazon-dynamodb</artifactId>
    </dependency>
    <dependency>
        <groupId>software.amazon.awssdk</groupId>
        <artifactId>dynamodb-enhanced</artifactId>
    </dependency>
</dependencies>

Then maven will pull the versions that are defined via your quarkus import.

Config

Currently, there is only a single config property for `application.properties:

quarkus.dynamodb-enhanced.jvm-transformation=true

It controls whether the fix for the ClassLoader problems for tests should be applied. It is there just in case that there are any problems with the detection of the current build environment. IF there are problems you can set it specifically for prod to false to not give up any speed at runtime.

quarkus-dynamodb-enhanced's People

Contributors

fastluca avatar nithanim avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

fastluca jugory

quarkus-dynamodb-enhanced's Issues

NoClassDefFoundError during test execution

I'm working with the following dependencies from pom.xml file;

<dependencies>
<dependency>
        <groupId>me.nithanim.quarkus</groupId>
        <artifactId>quarkus-amazon-dynamodb-enhanced</artifactId>
        <version>1.0.0-SNAPSHOT</version>
        <exclusions>
            <exclusion>
                <groupId>io.quarkus</groupId>
                <artifactId>quarkus-arc</artifactId>
            </exclusion>
            <exclusion>
                <groupId>io.quarkus</groupId>
                <artifactId>quarkus-amazon-dynamodb</artifactId>
            </exclusion>
            <exclusion>
                <groupId>software.amazon.awssdk</groupId>
                <artifactId>dynamodb-enhanced</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
		<dependency>
			<groupId>io.quarkus</groupId>
			<artifactId>quarkus-junit5</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>io.quarkus</groupId>
			<artifactId>quarkus-junit5-mockito</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.jeasy</groupId>
			<artifactId>easy-random-core</artifactId>
			<version>5.0.0</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>com.amazonaws</groupId>
			<artifactId>DynamoDBLocal</artifactId>
			<version>1.15.0</version>
			<scope>test</scope>
		</dependency>
</dependencies>

When I executed this test class

@QuarkusTest
@QuarkusTestResource(DynamoDbLocalResource.class)
public class ChatConnectionUnitTest {
	
	@Inject
	ChatConnectionDaoService chatConnectionDaoService;
	
	@Test
	public void test() {
		this.chatConnectionDaoService.putItem(ChatConnection.builder().connectionId(UUID.randomUUID().toString()).chatId(100l).build());
	}

}

I have this exception:

java.lang.RuntimeException: java.lang.NoClassDefFoundError: me/nithanim/aws/dynamodb/enhanced/nativeimage/deployment/BuildTimeConfig
	at io.quarkus.test.junit.QuarkusTestExtension.throwBootFailureException(QuarkusTestExtension.java:574)
	at io.quarkus.test.junit.QuarkusTestExtension.interceptTestClassConstructor(QuarkusTestExtension.java:647)
	at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)
	at org.junit.jupiter.api.extension.InvocationInterceptor.interceptTestClassConstructor(InvocationInterceptor.java:73)
	at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37)
	at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104)
	at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:77)
	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeTestClassConstructor(ClassBasedTestDescriptor.java:355)
	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.instantiateTestClass(ClassBasedTestDescriptor.java:302)
	at org.junit.jupiter.engine.descriptor.ClassTestDescriptor.instantiateTestClass(ClassTestDescriptor.java:79)
	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.instantiateAndPostProcessTestInstance(ClassBasedTestDescriptor.java:280)
	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$4(ClassBasedTestDescriptor.java:272)
	at java.base/java.util.Optional.orElseGet(Optional.java:369)
	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$5(ClassBasedTestDescriptor.java:271)
	at org.junit.jupiter.engine.execution.TestInstancesProvider.getTestInstances(TestInstancesProvider.java:31)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$prepare$0(TestMethodTestDescriptor.java:102)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:101)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:66)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$prepare$2(NodeTestTask.java:123)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.prepare(NodeTestTask.java:123)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:90)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35)
	at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
	at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:107)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:88)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:54)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:95)
	at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:91)
	at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:60)
	at org.eclipse.jdt.internal.junit5.runner.JUnit5TestReference.run(JUnit5TestReference.java:98)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:40)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:529)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:756)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:452)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:210)
Caused by: java.lang.NoClassDefFoundError: me/nithanim/aws/dynamodb/enhanced/nativeimage/deployment/BuildTimeConfig
	at io.quarkus.runtime.generated.Config.<clinit>(Config.zig:1008)
	at io.quarkus.runner.ApplicationImpl.<clinit>(ApplicationImpl.zig:60)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:398)
	at io.quarkus.runner.bootstrap.StartupActionImpl.run(StartupActionImpl.java:215)
	at io.quarkus.test.junit.QuarkusTestExtension.doJavaStart(QuarkusTestExtension.java:241)
	at io.quarkus.test.junit.QuarkusTestExtension.ensureStarted(QuarkusTestExtension.java:551)
	at io.quarkus.test.junit.QuarkusTestExtension.beforeAll(QuarkusTestExtension.java:589)
	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeBeforeAllCallbacks$10(ClassBasedTestDescriptor.java:381)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeBeforeAllCallbacks(ClassBasedTestDescriptor.java:381)
	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.before(ClassBasedTestDescriptor.java:205)
	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.before(ClassBasedTestDescriptor.java:80)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:148)
	... 35 more
	Suppressed: java.lang.NoClassDefFoundError: Could not initialize class io.quarkus.runtime.generated.Config
		at java.base/java.lang.Class.forName0(Native Method)
		at java.base/java.lang.Class.forName(Class.java:398)
		at io.quarkus.runner.bootstrap.StartupActionImpl.run(StartupActionImpl.java:219)
		... 44 more
Caused by: java.lang.ClassNotFoundException: me.nithanim.aws.dynamodb.enhanced.nativeimage.deployment.BuildTimeConfig
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
	at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:455)
	at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:405)
	... 49 more


update Quarkus version to 2.6 or later (I'd prefer 2.8.1 personally)

Please update the project to use the latest Quarkus version and fix the dependencies. In 2.6 Quarkus had a bit of a reshuffle and moved some dependencies which result in warning like this in my build:

The artifact io.quarkus:quarkus-amazon-dynamodb-deployment:jar:2.8.1.Final has been relocated to io.quarkiverse.amazonservices:quarkus-amazon-dynamodb-deployment:jar:1.0.2: io.quarkus:quarkus-amazon-dynamodb-deployment was relocated to io.quarkiverse.amazonservices:quarkus-amazon-dynamodb-deployment and is now managed by the io.quarkus.platform:quarkus-amazon-services-bom:2.8.1.Final. Please, update its groupId in the dependency declaration and import io.quarkus.platform:quarkus-amazon-services-bom:2.8.1.Final in your project configuration. For more information about this change, please, refer to https://github.com/quarkusio/quarkus/wiki/Migration-Guide-2.6

For more details read https://github.com/quarkusio/quarkus/wiki/Migration-Guide-2.6

Basically change:

        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-amazon-dynamodb</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-amazon-dynamodb-deployment</artifactId>
        </dependency>

to:

        <dependency>
            <groupId>io.quarkiverse.amazonservices</groupId>
            <artifactId>quarkus-amazon-dynamodb</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkiverse.amazonservices</groupId>
            <artifactId>quarkus-amazon-dynamodb-deployment</artifactId>
        </dependency>

Defining anonymous classes at runtime is not supported.

Hi there,

I am having a problem when running my function.

Here is the error I get:


Mounting /tmp/tmpdiy2yp68 as /var/task:ro,delegated inside runtime container
START RequestId: 9e1549f3-48ca-4020-94f2-60c153428d4f Version: $LATEST
__  ____  __  _____   ___  __ ____  ______ 
 --/ __ \/ / / / _ | / _ \/ //_/ / / / __/ 
 -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \   
--\___\_\____/_/ |_/_/|_/_/|_|\____/___/   
2022-01-14 09:30:34,013 WARN  [io.qua.application] (main) Setting the 'javax.net.ssl.trustStore' system property will not have any effect at runtime. Make sure to set this property at build time (for example by setting 'quarkus.native.additional-build-args=-J-Djavax.net.ssl.trustStore=someValue').
2022-01-14 09:30:34,039 INFO  [io.quarkus] (main) iam 1.0-SNAPSHOT native (powered by Quarkus 2.5.0.Final) started in 0.026s. 
2022-01-14 09:30:34,040 INFO  [io.quarkus] (main) Profile prod activated. 
2022-01-14 09:30:34,040 INFO  [io.quarkus] (main) Installed features: [amazon-dynamodb, amazon-lambda, amazon-s3, amazon-ses, amazon-sns, aws-dynamodb-enhanced, cdi]
2022-01-14 09:30:34,398 ERROR [io.qua.ama.lam.run.AbstractLambdaPollLoop] (Lambda Thread (NORMAL)) Failed to run lambda (NORMAL): java.lang.IllegalArgumentException: Failed to generate method handle.
        at software.amazon.awssdk.enhanced.dynamodb.internal.mapper.LambdaToMethodBridgeBuilder.build(LambdaToMethodBridgeBuilder.java:92)
        at software.amazon.awssdk.enhanced.dynamodb.internal.mapper.ObjectConstructor.create(ObjectConstructor.java:37)
        at software.amazon.awssdk.enhanced.dynamodb.mapper.BeanTableSchema.newObjectSupplierForClass(BeanTableSchema.java:361)
        at software.amazon.awssdk.enhanced.dynamodb.mapper.BeanTableSchema.createStaticTableSchema(BeanTableSchema.java:172)
        at software.amazon.awssdk.enhanced.dynamodb.mapper.BeanTableSchema.create(BeanTableSchema.java:129)
        at software.amazon.awssdk.enhanced.dynamodb.mapper.BeanTableSchema.create(BeanTableSchema.java:121)
        at software.amazon.awssdk.enhanced.dynamodb.TableSchema.fromBean(TableSchema.java:81)
        at com.loreggian.invflow.common.services.organization.OrganizationService.getDynamoDbTable(OrganizationService.java:52)
        at com.loreggian.invflow.common.services.DynamoDbService.getDynamoDbTable(DynamoDbService.java:50)
        at com.loreggian.invflow.common.services.organization.OrganizationService.createOrganization(OrganizationService.java:66)
        at com.loreggian.invflow.common.services.organization.OrganizationService_ClientProxy.createOrganization(OrganizationService_ClientProxy.zig:1200)
        at com.loreggian.invflow.iam.organization.CreateOrganization.handleRequest(CreateOrganization.java:34)
        at com.loreggian.invflow.iam.organization.CreateOrganization.handleRequest(CreateOrganization.java:16)
        at io.quarkus.amazon.lambda.runtime.AmazonLambdaRecorder$1.processRequest(AmazonLambdaRecorder.java:161)
        at io.quarkus.amazon.lambda.runtime.AbstractLambdaPollLoop$1.run(AbstractLambdaPollLoop.java:124)
        at java.lang.Thread.run(Thread.java:829)
        at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:596)
        at com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:192)
Caused by: com.oracle.svm.core.jdk.UnsupportedFeatureError: Defining anonymous classes at runtime is not supported.
        at com.oracle.svm.core.util.VMError.unsupportedFeature(VMError.java:87)
        at jdk.internal.misc.Unsafe.defineAnonymousClass(Unsafe.java:213)
        at java.lang.invoke.InnerClassLambdaMetafactory.spinInnerClass(InnerClassLambdaMetafactory.java:302)
        at java.lang.invoke.InnerClassLambdaMetafactory.buildCallSite(InnerClassLambdaMetafactory.java:193)
        at java.lang.invoke.LambdaMetafactory.metafactory(LambdaMetafactory.java:329)
        at software.amazon.awssdk.enhanced.dynamodb.internal.mapper.LambdaToMethodBridgeBuilder.build(LambdaToMethodBridgeBuilder.java:83)
        ... 17 more

{"errorType":"java.lang.IllegalArgumentException","errorMessage":"Failed to generate method handle."}END RequestId: 9e1549f3-48ca-4020-94f2-60c153428d4f
REPORT RequestId: 9e1549f3-48ca-4020-94f2-60c153428d4f  Init Duration: 0.59 ms  Duration: 423.50 ms     Billed Duration: 424 ms Memory Size: 128 MB     Max Memory Used: 128 MB

After looking at the LambdaToMethodBridgeBuilder code it looks to be breaking on this method call:

public T build() {
        try {
            MethodHandle targetMethodHandle = targetMethod.map(
                m -> invokeSafely(() -> LOOKUP.unreflect(m)),
                c -> invokeSafely(() -> LOOKUP.unreflectConstructor(c)));

            return lambdaType.cast(
                LambdaMetafactory.metafactory(LOOKUP,
                                              lambdaMethodName,
                                              MethodType.methodType(lambdaType),
                                              MethodType.methodType(postEraseLambdaReturnType, postEraseLambdaParameters),
                                              targetMethodHandle,
                                              MethodType.methodType(preEraseLambdaReturnType, preEraseLambdaParameters))
                                 .getTarget()
                                 .invoke());
        } catch (Throwable e) {
            throw new IllegalArgumentException("Failed to generate method handle.", e);
        }
    }

Can you possibly point me in the right direction?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.