dbeaver/dbeaver · error · DBException
Error instantiating geometry viewer
Error message
Error instantiating geometry viewer
What it means
Thrown by GeometryViewerDescriptor.createGeometryViewer() when reflective instantiation of the configured IGeometryViewer class fails. The descriptor reads the class name from the org.jkiss.dbeaver.data.gis.geometryViewer extension point and calls getImplClass().getConstructor(IValueController.class).newInstance(valueController); any Throwable from that chain is wrapped.
Source
Thrown at plugins/org.jkiss.dbeaver.data.gis.view/src/org/jkiss/dbeaver/ui/gis/registry/GeometryViewerDescriptor.java:84
}
public String getLabel() {
return label;
}
public String getDescription() {
return description;
}
public DBPImage getIcon() {
return icon;
}
public IGeometryViewer createGeometryViewer(IValueController valueController) throws DBException {
try {
return (IGeometryViewer) type.getImplClass().getConstructor(IValueController.class).newInstance(valueController);
} catch (Throwable e) {
throw new DBException("Error instantiating geometry viewer", e);
}
}
public boolean supportsInlineView() {
return supportsInline;
}
public boolean supportedBy(DBPDataSource dataSource) {
if (!supportedDataSources.isEmpty()) {
if (dataSource == null) {
return false;
}
if (!supportedDataSources.contains(dataSource.getContainer().getDriver().getProviderId())) {
return false;
}
}
return true;
}View on GitHub (pinned to 1e5ee1042b)
Solutions
- Verify the class attribute in plugin.xml for the geometryViewer extension matches a real, exported, instantiable class.
- Ensure the contributing plugin declares all required bundles in MANIFEST.MF Require-Bundle so the class loads.
- Confirm the viewer class has a public constructor with signature (IValueController).
- Inspect the wrapped Throwable cause — InvocationTargetException.getTargetException() reveals the constructor's actual exception.
Example fix
// before: viewer class without the expected constructor causes NoSuchMethodException
public class MyViewer implements IGeometryViewer {
public MyViewer() { ... } // no IValueController arg
}
// after: provide the constructor the descriptor reflectively looks up
public class MyViewer implements IGeometryViewer {
public MyViewer(IValueController valueController) { ... }
} Defensive patterns
Strategy: try-catch
Validate before calling
// Validate the extension class is loadable with the expected constructor before use
try {
Class<?> clazz = type.getImplClass();
clazz.getConstructor(IValueController.class); // fail early if missing
} catch (NoSuchMethodException | ClassNotFoundException e) {
throw new DBException("Geometry viewer class misconfigured", e);
} Try / catch
try {
return (IGeometryViewer) type.getImplClass()
.getConstructor(IValueController.class).newInstance(valueController);
} catch (Throwable e) {
throw new DBException("Error instantiating geometry viewer", e);
} Prevention
- Keep the class attribute in plugin.xml in sync with the real implementing class name.
- Declare all required bundles in MANIFEST.MF Require-Bundle so the class loads at runtime.
- Ensure viewer classes expose a public constructor taking IValueController.
When it happens
Trigger: Reflection fails: the class attribute in plugin.xml points to a missing/unloaded class (ClassNotFoundException), the class lacks a public constructor taking IValueController (NoSuchMethodException), the constructor is inaccessible (IllegalAccessException), or the constructor itself threw during newInstance (InvocationTargetException / user code exception).
Common situations: A custom geometry viewer extension with a wrong class attribute; a viewer class whose required bundle/dependency is missing from Require-Bundle; a constructor that throws on a null or unexpected IValueController; version mismatch where the class moved or was renamed.
Related errors
- Can't create attribute transformer instance
- Can't create event processor
- Can't create data transformer node
- Can't create node settings
- Can't instantiate data exporter
AI-assisted analysis of dbeaver/dbeaver@1e5ee1042b (2026-08-13).
Data as JSON: /api/errors/e89102494a1940e8.
Report an issue: GitHub.