quarkusio/quarkus · error · RuntimeException

Method "" + methodDescription + "" not found.

Error message

Method "" + methodDescription + "" not found.

What it means

FunctionRegistry.register() uses reflection to locate the exact method (name + JVM descriptor) recorded at build time. If no matching method exists on the class, a RuntimeException naming the method description is thrown during startup.

Source

Thrown at extensions/funqy/funqy-server-common/runtime/src/main/java/io/quarkus/funqy/runtime/FunctionRegistry.java:35

        FunctionInvoker fi = functions.get(functionName);
        if (fi != null) {
            String otherMethodDescription = fi.targetClass.getName() + "/" + fi.method.getName()
                    + getMethodDescriptor(fi.method);
            String msg = String.format("Name conflict: the name \"%s\" is shared by \"%s\" and \"%s\"." +
                    " Consider using @Func(\"name-here\") annotation parameter to distinguish them.",
                    functionName, methodDescription, otherMethodDescription);
            log.warn(msg);
        }

        for (Method m : clz.getMethods()) {
            if (m.getName().equals(methodName) && descriptor.equals(getMethodDescriptor(m))) {
                functions.put(functionName, new FunctionInvoker(functionName, clz, m));
                return;
            }
        }

        throw new RuntimeException("Method \"" + methodDescription + "\" not found.");
    }

    public FunctionInvoker matchInvoker(String name) {
        return functions.get(name);
    }

    public Collection<FunctionInvoker> invokers() {
        return functions.values();
    }

    private static String getDescriptorForClass(final Class c) {
        if (c.isPrimitive()) {
            if (c == byte.class)
                return "B";
            if (c == char.class)
                return "C";
            if (c == double.class)
                return "D";

View on GitHub (pinned to e1c734241f)

Solutions

  1. Clean rebuild (mvn clean install) to re-sync build-time scan with compiled classes
  2. Verify the method name and parameter types in the @Funq class haven't changed after the build
  3. Check dependency versions of quarkus-funqy-* artifacts match
  4. If registering manually, confirm the descriptor (parameter/return types) matches the method signature

Example fix

// before (method changed after build)
@Funq public String greet(String name)
// registry recorded greet(String) → method now greet(String, String)
// after
mvn clean install  // rebuild so registry and class match
@Funq public String greet(String name) // keep signature stable
Defensive patterns

Strategy: validation

Validate before calling

// Confirm the method exists before registration
boolean found = Arrays.stream(clz.getDeclaredMethods())
    .anyMatch(m -> m.getName().equals(methodName)
        && FunctionRegistry.getMethodDescriptor(m).equals(expectedDescriptor));
if (!found) throw new IllegalStateException("Registry/class mismatch for " + methodDescription);

Try / catch

try {
    FunctionRegistry.register(clz, functionName, methodName, descriptor);
} catch (RuntimeException e) {
    if (e.getMessage().contains("not found")) {
        log.errorf(e, "Class %s changed after build; clean rebuild required", clz.getName());
    }
    throw e;
}

Prevention

When it happens

Trigger: The build-time recorded method signature no longer matches the runtime class: method renamed, parameter types changed, or class version mismatch between deployment scan and runtime.

Common situations: Hot-reload/hotswap artifacts where the compiled class changed after the registry was built; version skew between quarkus-funqy deployment and runtime artifacts; manual registry registration with a mistyped descriptor.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/f8b9747d970b350e. Report an issue: GitHub.