From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from MTA-08-3.privateemail.com (mta-08-3.privateemail.com [198.54.127.61]) by sourceware.org (Postfix) with ESMTPS id E1CEE3858C3B for ; Sun, 29 Aug 2021 19:04:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E1CEE3858C3B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=eatonphil.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=eatonphil.com Received: from mta-08.privateemail.com (localhost [127.0.0.1]) by mta-08.privateemail.com (Postfix) with ESMTP id D039918000A1 for ; Sun, 29 Aug 2021 15:04:00 -0400 (EDT) Received: from mail-ua1-f45.google.com (unknown [10.20.151.216]) by mta-08.privateemail.com (Postfix) with ESMTPA id B370A180009F for ; Sun, 29 Aug 2021 15:04:00 -0400 (EDT) Received: by mail-ua1-f45.google.com with SMTP id g2so6597020uad.4 for ; Sun, 29 Aug 2021 12:04:00 -0700 (PDT) X-Gm-Message-State: AOAM5319wb+YnY4n2lXoa0Ax9IGzmvAQW/t4WJr/V7EbKmqO3i//waIx SjqUeF2YNtQXP94PGbX4urbW5D+G0LmshUe3Wlw= X-Google-Smtp-Source: ABdhPJzg6dcRhTSQdlg7qocZIbx2YsntHJiYbKdJeTKgTWe7UpHHjDEf6xJuFjckwGGvxtcWk2QLbWPy40h/nuEIods= X-Received: by 2002:ab0:54c4:: with SMTP id q4mr12831038uaa.74.1630263839569; Sun, 29 Aug 2021 12:03:59 -0700 (PDT) MIME-Version: 1.0 From: Phil Eaton Date: Sun, 29 Aug 2021 15:03:48 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Receiver class does not define or inherit an implementation of the resolved method To: kawa mailing list X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00, HTML_MESSAGE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: kawa@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Kawa mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Aug 2021 19:04:05 -0000 Hey folks! Still new to Kawa. I'm trying to implement an interface ( io.jooby.Route$Handler ). It only has a single non-default method, apply. Here's what I've got (define (route app method path handler) (let ((handler (object (io.jooby.Route$Handler) #| This method exists just to stop Jooby from trying to introspect Java code that doesn't exist because this isn't written in Java. |# ((apply (ctx ::io.jooby.Context)) ::string #!null) ((apply (ctx ::io.jooby.Context)) ::java.lang.Object (handler ctx))))) (app:route method path handler))) But when this gets exercised, I get: [worker-1-3] ERROR io.jooby.Jooby - GET /hello-world 500 Server Error java.lang.AbstractMethodError: Receiver class main$0 does not define or inherit an implementation of the resolved method 'abstract java.lang.Object apply(io.jooby.Context)' of interface io.jooby.Route$Handler. at io.jooby.internal.handler.SendCharSequence.apply(SendCharSequence.java:22) at io.jooby.internal.handler.WorkerHandler.lambda$apply$0(WorkerHandler.java:23) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.base/java.lang.Thread.run(Thread.java:831) Also on a tangent, I was excited about the lambda shorthand for single method objects. Like I said this interface only has a single non-default method: apply. But I tried just calling `(app:route method handler)` without wrapping it in the io.jooby.Route$Handler object but it still failed. I guess it couldn't figure out this one method. Or I'm doing everything wrong. The full code is available here and can be run just by calling make. The exception happens when you `curl localhost:8080/`. Any ideas about what I'm doing wrong? Thanks! Phil