flowable/flowable-engine · error · FlowableException
Error instantiating XML importer '%s' for type '%s'
Error message
Error instantiating XML importer '%s' for type '%s'
What it means
Flowable's DefaultXMLImporterFactory creates the WSDL/XML importer for BPMN import elements via reflection, hardcoding 'org.flowable.engine.impl.webservice.CxfWSDLImporter' and loading it through the current thread's context ClassLoader. The message is thrown when the class is found but cannot be instantiated (e.g. missing CXF dependencies, no no-arg constructor, linkage or access errors) while deploying a process that uses <import> / web service tasks. It wraps the reflective failure in a FlowableException with the importer class name and the BPMN import type.
Source
Thrown at modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/parser/factory/DefaultXMLImporterFactory.java:41
*
* @author Christophe DENEUX
*/
public class DefaultXMLImporterFactory implements XMLImporterFactory {
// Name of the default XML Importer, provided by flowable-cxf
private static final String DEFAULT_XML_IMPORTER_FACTORY_CLASSNAME = "org.flowable.engine.impl.webservice.CxfWSDLImporter";
@Override
public XMLImporter createXMLImporter(Import theImport) throws FlowableException {
try {
Class<?> wsdlImporterClass = Class.forName(DEFAULT_XML_IMPORTER_FACTORY_CLASSNAME, true,
Thread.currentThread().getContextClassLoader());
return (XMLImporter) wsdlImporterClass.getConstructor().newInstance();
} catch (ClassNotFoundException e) {
throw new FlowableException("Could not find importer class for type " + theImport.getImportType(), e);
} catch (Exception e) {
throw new FlowableException(String.format("Error instantiating XML importer '%s' for type '%s'",
DEFAULT_XML_IMPORTER_FACTORY_CLASSNAME, theImport.getImportType()), e);
}
}
}
View on GitHub (pinned to d6d39ce1c6)
Solutions
- Add the Flowable web-service/CXF dependencies (e.g. org.flowable:flowable-cxf plus Apache CXF artifacts) to the application classpath
- If no web service import is intended, remove the <import> declaration and related service tasks from the BPMN XML
- Ensure Thread.currentThread().getContextClassLoader() can see the class (set the context ClassLoader appropriately in your launch environment)
- Inspect the wrapped cause ('Caused by') of the FlowableException to distinguish missing classes from constructor/access problems
Example fix
// before (pom.xml) <dependency> <groupId>org.flowable</groupId> <artifactId>flowable-engine</artifactId> </dependency> // after <dependency> <groupId>org.flowable</groupId> <artifactId>flowable-engine</artifactId> </dependency> <dependency> <groupId>org.flowable</groupId> <artifactId>flowable-cxf</artifactId> </dependency>
Defensive patterns
Strategy: try-catch
Validate before calling
// before deployment
String cls = "org.flowable.engine.impl.webservice.CxfWSDLImporter";
try {
Class.forName(cls, true, Thread.currentThread().getContextClassLoader());
} catch (Throwable t) {
throw new IllegalStateException("WSDL importer missing on classpath: add flowable-cxf + CXF dependencies", t);
} Type guard
boolean canInstantiateWsdlImporter() {
try {
Class<?> c = Class.forName("org.flowable.engine.impl.webservice.CxfWSDLImporter",
true, Thread.currentThread().getContextClassLoader());
c.getConstructor();
return true;
} catch (Throwable t) {
return false;
}
} Try / catch
try {
repositoryService.createDeployment().addInputStream(...).deploy();
} catch (FlowableException e) {
if (e.getMessage() != null && e.getMessage().startsWith("Error instantiating XML importer")) {
logger.error("CXF/WSDL support missing or broken; check flowable-cxf dependency and classloader", e);
} else {
throw e;
}
} Prevention
- Include flowable-cxf and Apache CXF dependencies whenever BPMN XML uses <import> or web service tasks
- Verify the thread context ClassLoader can load the importer class in your runtime (fat jars, app servers)
- Read the 'Caused by' chain to distinguish missing classes from constructor problems
- Only add <import> declarations to BPMN that you actually need
When it happens
Trigger: Deploying a BPMN XML containing an <import type="..."> element (web service import); the reflection call wsdlImporterClass.getConstructor().newInstance() fails with an exception other than ClassNotFoundException — typically NoClassDefFoundError/LinkageError because CXF classes (cxf-rt-frontend-jaxws etc.) are not on the classpath, or InstantiationException/IllegalAccessException.
Common situations: Using the Flowable web-service (WSDL) integration without adding the flowable-cxf/CXF Maven dependencies; running in a container (Spring Boot fat jar, OSGi, app server) where the thread context ClassLoader cannot see the CxfWSDLImporter class; upgrading Flowable versions where the webservice module or package layout changed.
Related errors
- Could not get context class loader
- BPMN XSD could not be found
- The bpmn 2.0 xml is not properly encoded
- The ${task} cannot be deleted because is part of a running p
- TypeConverter ${clazz} could not be instantiated
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/30f780399374e64b.
Report an issue: GitHub.