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
- Use a concrete POJO class with getters/setters instead of Object as the service parameter/return type so Wrapper generates a real property accessor.
- Verify the service interface method signatures are concrete types; if a generic Object slipped in via raw types or type erasure, parameterize it.
- If you must use Object, avoid property-level access (getPropertyValue/setPropertyValue) and use method invocation instead.
- 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
- Use concrete POJO types instead of Object for service parameters/return types.
- Call hasProperty(name) before getPropertyValue when the property set is dynamic.
- Avoid wrapping java.lang.Object; ensure service interfaces are concrete and on the classpath.
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
- Invoke method [{}] argument number error.
- Method [{}] not found.
- Can not create wrapper for primitive type: {}
- Unknown primitive type: {}
- pns.length != pvs.length
AI-assisted analysis of apache/dubbo@3a3043227f (2026-08-14).
Data as JSON: /api/errors/3f56f3efcc4832d0.
Report an issue: GitHub.