apache/dubbo · error · RuntimeException

{} is unknown primitive type.

Error message

{} is unknown primitive type.

What it means

Thrown by Proxy.asArgument when a parameter/return type reports cl.isPrimitive() true but is none of the eight boxed primitive checks (boolean, byte, char, double, float, int, long, short). This is defensive code: the JVM defines exactly those eight primitive types (plus void, handled elsewhere), so in practice this branch is unreachable on a standard JVM. Encountering it implies a corrupted/abnormal Class object or a JVM/javassist quirk.

Source

Thrown at dubbo-common/src/main/java/org/apache/dubbo/common/bytecode/Proxy.java:227

            if (Character.TYPE == cl) {
                return name + "==null?(char)0:((Character)" + name + ").charValue()";
            }
            if (Double.TYPE == cl) {
                return name + "==null?(double)0:((Double)" + name + ").doubleValue()";
            }
            if (Float.TYPE == cl) {
                return name + "==null?(float)0:((Float)" + name + ").floatValue()";
            }
            if (Integer.TYPE == cl) {
                return name + "==null?(int)0:((Integer)" + name + ").intValue()";
            }
            if (Long.TYPE == cl) {
                return name + "==null?(long)0:((Long)" + name + ").longValue()";
            }
            if (Short.TYPE == cl) {
                return name + "==null?(short)0:((Short)" + name + ").shortValue()";
            }
            throw new RuntimeException(name + " is unknown primitive type.");
        }
        return "(" + ReflectUtils.getName(cl) + ")" + name;
    }

    /**
     * get instance with default handler.
     *
     * @return instance.
     */
    public Object newInstance() {
        return newInstance(THROW_UNSUPPORTED_INVOKER);
    }

    /**
     * get instance with special handler.
     *
     * @return instance.
     */

View on GitHub (pinned to 3a3043227f)

Solutions

  1. Verify you are running on a standard JVM and a supported javassist version bundled with your Dubbo release.
  2. Inspect the interface methods' parameter/return types for any unusual primitive-looking Class objects.
  3. If reproducible, report to Dubbo with the interface definition and the full stack trace; this path is not expected to fire.
  4. Upgrade Dubbo/javassist to a known-good combination as a first triage step.
Defensive patterns

Strategy: try-catch

Try / catch

try {
    Proxy.getProxy(ics);
} catch (RuntimeException e) {
    if (e.getMessage().endsWith("is unknown primitive type.")) {
        // unexpected on a standard JVM; collect diagnostics and report
    } else throw e;
}

Prevention

When it happens

Trigger: Proxy.getProxy(ics) where an interface method's parameter or return type is a primitive that asArgument does not recognize - effectively impossible on a compliant JVM; could surface from a custom/buggy Class object or a non-standard runtime.

Common situations: Never seen under normal JVM operation; would require a hand-crafted Class object, an exotic JVM, or a javassist version that misreports a type as primitive. Treat as an internal-error indicator rather than a configuration issue.

Related errors


AI-assisted analysis of apache/dubbo@3a3043227f (2026-08-14). Data as JSON: /api/errors/8fd266af40310607. Report an issue: GitHub.