{"record":{"id":"f81770702c2ad0ca","repo":"flowable/flowable-engine","slug":"could-not-find-importer-class-for-type-theimpo","errorCode":null,"errorMessage":"Could not find importer class for type \" + theImport.getImportType()","messagePattern":"Could not find importer class for type \" \\+ theImport\\.getImportType\\(\\)","errorType":"validation","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/parser/factory/DefaultXMLImporterFactory.java","lineNumber":39,"sourceCode":" * Default implementation of the {@link XMLImporterFactory}. Used when no custom {@link XMLImporterFactory} is injected\n * on the {@link ProcessEngineConfigurationImpl}.\n * \n * @author Christophe DENEUX\n */\npublic class DefaultXMLImporterFactory implements XMLImporterFactory {\n\n    // Name of the default XML Importer, provided by flowable-cxf\n    private static final String DEFAULT_XML_IMPORTER_FACTORY_CLASSNAME = \"org.flowable.engine.impl.webservice.CxfWSDLImporter\";\n\n    @Override\n    public XMLImporter createXMLImporter(Import theImport) throws FlowableException {\n\n        try {\n            Class<?> wsdlImporterClass = Class.forName(DEFAULT_XML_IMPORTER_FACTORY_CLASSNAME, true,\n                    Thread.currentThread().getContextClassLoader());\n            return (XMLImporter) wsdlImporterClass.getConstructor().newInstance();\n        } catch (ClassNotFoundException e) {\n            throw new FlowableException(\"Could not find importer class for type \" + theImport.getImportType(), e);\n        } catch (Exception e) {\n            throw new FlowableException(String.format(\"Error instantiating XML importer '%s' for type '%s'\",\n                    DEFAULT_XML_IMPORTER_FACTORY_CLASSNAME, theImport.getImportType()), e);\n        }\n    }\n}\n","sourceCodeStart":21,"sourceCodeEnd":46,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/parser/factory/DefaultXMLImporterFactory.java#L21-L46","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before (pom.xml)\n<dependency>\n  <groupId>org.flowable</groupId>\n  <artifactId>flowable-xml-importer</artifactId>\n  <scope>provided</scope> <!-- not available at runtime -->\n</dependency>\n// after\n<dependency>\n  <groupId>org.flowable</groupId>\n  <artifactId>flowable-xml-importer</artifactId>\n  <scope>runtime</scope>\n</dependency>","handlingStrategy":"try-catch","validationCode":"try {\n    Class.forName(\"org.flowable.engine.impl.bpmn.parser.factory.DefaultXmlImporter\",\n        true, Thread.currentThread().getContextClassLoader());\n} catch (ClassNotFoundException e) {\n    throw new IllegalStateException(\"WSDL/XML importer not on classpath; add the importer dependency\", e);\n}","typeGuard":null,"tryCatchPattern":"try {\n    deploymentBuilder.deploy();\n} catch (FlowableException e) {\n    if (e.getMessage().startsWith(\"Could not find importer class\")) {\n        // add the missing importer jar / fix the classloader, then retry deployment\n    } else { throw e; }\n}","preventionTips":["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."],"tags":["flowable","classpath","wsdl","importer","class-not-found"],"backgroundTag":"class-not-found","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}