apache/flink · error · IllegalArgumentException

Object is no primitive Java type.

Error message

Object is no primitive Java type.

What it means

Error "Object is no primitive Java type." thrown in apache/flink.

Source

Thrown at flink-core/src/main/java/org/apache/flink/types/JavaToValueConverter.java:52

            return new StringValue((String) boxed);
        } else if (clazz == Integer.class) {
            return new IntValue((Integer) boxed);
        } else if (clazz == Long.class) {
            return new LongValue((Long) boxed);
        } else if (clazz == Double.class) {
            return new DoubleValue((Double) boxed);
        } else if (clazz == Float.class) {
            return new FloatValue((Float) boxed);
        } else if (clazz == Boolean.class) {
            return new BooleanValue((Boolean) boxed);
        } else if (clazz == Byte.class) {
            return new ByteValue((Byte) boxed);
        } else if (clazz == Short.class) {
            return new ShortValue((Short) boxed);
        } else if (clazz == Character.class) {
            return new CharValue((Character) boxed);
        } else {
            throw new IllegalArgumentException("Object is no primitive Java type.");
        }
    }

    public static Object convertValueType(Value value) {
        if (value == null) {
            return null;
        }

        if (value instanceof StringValue) {
            return ((StringValue) value).getValue();
        } else if (value instanceof IntValue) {
            return ((IntValue) value).getValue();
        } else if (value instanceof LongValue) {
            return ((LongValue) value).getValue();
        } else if (value instanceof DoubleValue) {
            return ((DoubleValue) value).getValue();
        } else if (value instanceof FloatValue) {
            return ((FloatValue) value).getValue();

View on GitHub (pinned to 2f3c205e92)

Solutions

  1. Address the cause reported by the error message: Object is no primitive Java type.
  2. Verify the inputs, configuration values, and classpath/dependency setup related to this operation, then retry.

Example fix

Correct the condition described ("Object is no primitive Java type.") and rerun the job or command.

When it happens

Trigger: Triggered at runtime when the operation fails because: Object is no primitive Java type.

Common situations: Commonly caused by misconfiguration, missing dependencies or files, unsupported types or operations, or invalid user input leading to: Object is no primitive Java type.


AI-assisted analysis of apache/flink@2f3c205e92 (2026-08-14). Data as JSON: /api/errors/d5a49f39c31ab230. Report an issue: GitHub.