flowable/flowable-engine · error · FlowableException
Could not find importer class for type " + theImport.getImpo
Error message
Could not find importer class for type " + theImport.getImportType()
What it means
DefaultXMLImporterFactory.createXMLImporter imports WSDL/XML definitions for BPEL-style service tasks by reflectively loading a default importer class (DEFAULT_XML_IMPORTER_FACTORY_CLASSNAME) via the thread context classloader. If the class is not on the classpath, ClassNotFoundException is wrapped and a FlowableException 'Could not find importer class for type <importType>' is thrown. This is a deployment/classpath problem, not an invalid import type value.
Source
Thrown at modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/parser/factory/DefaultXMLImporterFactory.java:39
* Default implementation of the {@link XMLImporterFactory}. Used when no custom {@link XMLImporterFactory} is injected
* on the {@link ProcessEngineConfigurationImpl}.
*
* @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 artifact that provides DEFAULT_XML_IMPORTER_FACTORY_CLASSNAME (the XML/WSDL importer) to the runtime classpath.
- Verify the class can be loaded from the current thread context classloader (Class.forName in your app) and fix classloader/scoping issues (e.g. remove provided scope or shade exclusions).
- Remove the <import> declaration from the BPMN if the WSDL/XML import is not actually needed.
- If the importer class name was customized, ensure the configured class exists and is exported by its jar.
Example fix
// before (pom.xml) <dependency> <groupId>org.flowable</groupId> <artifactId>flowable-xml-importer</artifactId> <scope>provided</scope> <!-- not available at runtime --> </dependency> // after <dependency> <groupId>org.flowable</groupId> <artifactId>flowable-xml-importer</artifactId> <scope>runtime</scope> </dependency>
Defensive patterns
Strategy: try-catch
Validate before calling
try {
Class.forName("org.flowable.engine.impl.bpmn.parser.factory.DefaultXmlImporter",
true, Thread.currentThread().getContextClassLoader());
} catch (ClassNotFoundException e) {
throw new IllegalStateException("WSDL/XML importer not on classpath; add the importer dependency", e);
} Try / catch
try {
deploymentBuilder.deploy();
} catch (FlowableException e) {
if (e.getMessage().startsWith("Could not find importer class")) {
// add the missing importer jar / fix the classloader, then retry deployment
} else { throw e; }
} Prevention
- Include the XML/WSDL importer dependency in runtime scope whenever BPMN <import> declarations are used.
- Smoke-test deployments in CI so classpath regressions are caught before production.
- Check thread context classloader behavior when embedding Flowable in app servers or shaded jars.
- Remove unused <import> elements from process definitions.
When it happens
Trigger: Deploying a process containing a service task with an XML/WSDL import declaration while the module providing the XML importer class (e.g. flowable-bpel or the wsdl importer jar) is absent from the application classpath, or the thread context classloader cannot see it.
Common situations: Running Flowable in an app server or fat jar where the optional importer dependency was excluded; shade-plugin or dependency scoping (provided/test) dropping the importer; switching from the full flowable-engine-war distribution to an embedded setup without the extra jar.
Related errors
- resource '${resource}' not found
- Failed to read resource ${resource}
- BPMN XSD could not be found
- resource '${resource}' not found
- Failed to load type alias class
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/f81770702c2ad0ca.
Report an issue: GitHub.