pentaho/pentaho-kettle · error · KettleStepException
Wsdl.Error.ElementMissingException
Wsdl.Error.ElementMissingException
Error message
Wsdl.Error.ElementMissingException
What it means
After locating the right schema, WsdlTypes.findNamedElement(QName) scans its child <element name="..."> declarations. If no element whose name matches the QName's local part exists in that schema, a KettleStepException with message key Wsdl.Error.ElementMissingException is thrown — the schema is present but the specific element is not.
Solutions
- Open the schema for that targetNamespace and confirm an <xsd:element name="..."> with the exact local part exists.
- If only a complexType exists, add a wrapping <xsd:element name="..." type="tns:MyType"/> and reference it.
- Correct the namespace so the element is looked up in the schema that actually declares it.
- Refresh to the current WSDL/XSD versions if the element was renamed.
Example fix
<!-- before: schema has only a complexType --> <xsd:complexType name="Address">...</xsd:complexType> <!-- after --> <xsd:complexType name="Address">...</xsd:complexType> <xsd:element name="Address" type="tns:Address"/>
Defensive patterns
Strategy: validation
Validate before calling
// Pre-check the schema contains the element before findNamedElement
Schema s = wsdlTypes.getSchema(elementName.getNamespaceURI());
boolean found = s != null && DomUtils.getChildElementsByName(s.getElement(), "element").stream()
.anyMatch(el -> elementName.getLocalPart().equals(el.getAttribute("name")));
if (!found) throw new IllegalArgumentException("Element '" + elementName + "' not declared in schema"); Try / catch
try {
Element el = wsdlTypes.findNamedElement(qname);
} catch (KettleStepException kse) {
if (kse.getMessage() != null && kse.getMessage().contains("ElementMissing")) {
logError("Element " + qname.getLocalPart() + " not in schema for " + qname.getNamespaceURI(), kse);
}
throw kse;
} Prevention
- Distinguish complexType names from element names
- Verify the element's actual targetNamespace
- Re-check element names after WSDL version upgrades
When it happens
Trigger: findNamedElement(new QName(ns, "Foo")) where the schema for ns exists but contains no <element name="Foo"> — e.g., the element is only defined as a complex type, or was renamed in a newer WSDL version.
Common situations: WSDL/service version upgrade renamed elements; developer confused complexType name with element name; the element lives in a different schema (different targetNamespace) than the one resolved; case mismatch in element name.
Understand the failure class
Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.
Related errors
- Wsdl.Error.MissingSchemaException
- Could not retrieve WSDL Operator for operation name: +…
- invalid element: + e.getNodeName()
- Invalid part count for fault!!
- AnalyticQueryMeta.Exception.SubjectFieldNotFound
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/a43bb5d95868ea55.
Report an issue: GitHub.
Appendix: source
Thrown at engine/src/main/java/org/pentaho/di/trans/steps/webservices/wsdl/WsdlTypes.java:94
Schema s = getSchema( elementName.getNamespaceURI() );
if ( s == null ) {
throw new KettleStepException( BaseMessages
.getString( PKG, "Wsdl.Error.MissingSchemaException", elementName ) );
}
Element schemaRoot = s.getElement();
List<Element> elements = DomUtils.getChildElementsByName( schemaRoot, WsdlUtils.ELEMENT_NAME );
for ( Element e : elements ) {
String schemaElementName = e.getAttribute( WsdlUtils.NAME_ATTR );
if ( elementName.getLocalPart().equals( schemaElementName ) ) {
namedElement = e;
break;
}
}
if ( namedElement == null ) {
throw new KettleStepException( BaseMessages.getString(
PKG, "Wsdl.Error.ElementMissingException", elementName ) );
}
return namedElement;
}
/**
* Find a named <complexType> or <simpleType> in the types section of the WSDL.
*
* @param typeName
* Name of the type to find.
* @return null if type not found.
*/
protected Element findNamedType( QName typeName ) {
Schema s = getSchema( typeName.getNamespaceURI() );
if ( s == null ) {
return null;
}View on GitHub (pinned to f3058517a1)