apache/dubbo · error · NoSuchPropertyException

Property [{}] not found.

Error message

Property [{}] not found.

What it means

Thrown by the OBJECT_WRAPPER (the singleton Wrapper for java.lang.Object) when getPropertyValue is called. Because Object has no bean properties, any property read on an Object-typed service/argument is rejected. NoSuchPropertyException is a Dubbo-specific RuntimeException indicating the property name does not exist on the wrapped class.

Source

Thrown at dubbo-common/src/main/java/org/apache/dubbo/common/bytecode/Wrapper.java:72

        @Override
        public String[] getDeclaredMethodNames() {
            return OBJECT_METHODS;
        }

        @Override
        public String[] getPropertyNames() {
            return EMPTY_STRING_ARRAY;
        }

        @Override
        public Class<?> getPropertyType(String pn) {
            return null;
        }

        @Override
        public Object getPropertyValue(Object instance, String pn) throws NoSuchPropertyException {
            throw new NoSuchPropertyException("Property [" + pn + "] not found.");
        }

        @Override
        public void setPropertyValue(Object instance, String pn, Object pv) throws NoSuchPropertyException {
            throw new NoSuchPropertyException("Property [" + pn + "] not found.");
        }

        @Override
        public boolean hasProperty(String name) {
            return false;
        }

        @Override
        public Object invokeMethod(Object instance, String mn, Class<?>[] types, Object[] args)
                throws NoSuchMethodException {
            if ("getClass".equals(mn)) {
                return instance.getClass();
            }

View on GitHub (pinned to 3a3043227f)

Solutions

  1. Use a concrete POJO class with getters/setters instead of Object as the service parameter/return type so Wrapper generates a real property accessor.
  2. Verify the service interface method signatures are concrete types; if a generic Object slipped in via raw types or type erasure, parameterize it.
  3. If you must use Object, avoid property-level access (getPropertyValue/setPropertyValue) and use method invocation instead.
  4. Check hasProperty(name) before calling getPropertyValue to fail gracefully.

Example fix

// before
public interface MyService { Object getData(); }
// after
public interface MyService { MyDataDto getData(); }
Defensive patterns

Strategy: validation

Validate before calling

// Before calling getPropertyValue on a Wrapper:
if (wrapper.hasProperty(name)) {
    Object val = wrapper.getPropertyValue(instance, name);
} else {
    // property does not exist; handle gracefully
}

Type guard

// Ensure the wrapped class is not Object before property access
static boolean isPropertyAccessible(Wrapper w) {
    return w.getPropertyNames().length > 0;
}

Try / catch

try {
    Object v = wrapper.getPropertyValue(instance, name);
} catch (NoSuchPropertyException e) {
    // log and use fallback or skip
}

Prevention

When it happens

Trigger: Calling Wrapper.getWrapper(Object.class).getPropertyValue(instance, name), or a Dubbo RPC/generic invocation whose target interface resolves to Object.class and a property accessor is generated/invoked against it.

Common situations: A service interface method declares a parameter or return type of Object (or a raw type whose erased superclass is Object), and Dubbo's reflection layer tries to serialize/deserialize or set fields by property name. Also triggered by passing a plain java.lang.Object where a typed POJO was expected.

Related errors


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