Camunda cannot read XSD when running a packaged Spring Boot application

Hello!

I have Camunda running inside a Spring Boot application. When I launch it in IntelliJ Idea, it starts without problems.

However, when I build the same application using mvn clean compile package and then start the resulting application, I get the following eror during startup:

errors: 
* schema_reference.4: Failed to read schema document 'jar:file:/home/company/user/Development/Repositories/git/myproduct/target/myproduct-1.0-SNAPSHOT.jar!/BOOT-INF/lib/camunda-engine-7.12.0-ee.jar!/org/camunda/bpm/engine/impl/bpmn/parser/BPMN20.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.: JAR entry BOOT-INF/lib/camunda-engine-7.12.0-ee.jar!/org/camunda/bpm/engine/impl/bpmn/parser/BPMN20.xsd not found in /home/company/user/Development/Repositories/git/myproduct/target/myproduct-1.0-SNAPSHOT.jar | resource uploadToEc2.bpmn | line 2 | column 404
* cvc-elt.1: Cannot find the declaration of element 'bpmn:definitions'. | resource uploadToEc2.bpmn | line 2 | column 404
        at org.camunda.bpm.engine.impl.util.EngineUtilLogger.exceptionDuringParsing(EngineUtilLogger.java:66) ~[camunda-engine-7.12.0-ee.jar!/:na]
        at org.camunda.bpm.engine.impl.util.xml.Parse.throwExceptionForErrors(Parse.java:254) ~[camunda-engine-7.12.0-ee.jar!/:na]
        at org.camunda.bpm.engine.impl.bpmn.parser.BpmnParse.execute(BpmnParse.java:272) ~[camunda-engine-7.12.0-ee.jar!/:na]
        at org.camunda.bpm.engine.impl.bpmn.deployer.BpmnDeployer.transformDefinitions(BpmnDeployer.java:105) ~[camunda-engine-7.12.0-ee.jar!/:na]
        at org.camunda.bpm.engine.impl.AbstractDefinitionDeployer.transformResource(AbstractDefinitionDeployer.java:99) ~[camunda-engine-7.12.0-ee.jar!/:na]
        at org.camunda.bpm.engine.impl.AbstractDefinitionDeployer.parseDefinitionResources(AbstractDefinitionDeployer.java:74) ~[camunda-engine-7.12.0-ee.jar!/:na]
        at org.camunda.bpm.engine.impl.AbstractDefinitionDeployer.deploy(AbstractDefinitionDeployer.java:64) ~[camunda-engine-7.12.0-ee.jar!/:na]

If I open the respective JAR file in an archive application, I do see the jar:file:/home/company/user/Development/Repositories/git/myproduct/target/myproduct-1.0-SNAPSHOT.jar!/BOOT-INF/lib/camunda-engine-7.12.0-ee.jar!/org/camunda/bpm/engine/impl/bpmn/parser/BPMN20.xsd file.

What could be the reason for this and how can I fix it?

Thanks

Dmitrii Pisarenko

Seems you are using Enterprise version of camunda. If you are an enterprise customer you can raise a support ticket.

And I would suggest not to use snapshot version. Stable version (most preferred) or alpha versions (least preferred) can be good to use. Snapshot versions are not production-grade software.

Make sure required camunda certification files are added for camunda enterprise edition software usage.

Refer these sections:

1 Like

Hello, I have the exact same problem with camunda engine version 7.13.0. Have you managed to find a fix for it? Thanks!

Hi!

Yes. In the pom.xml file I added the version (<version>2.0.1.RELEASE</version>) into the following block:

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <layout>ZIP</layout>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

After the change, this code block looks like this:

<build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>2.0.1.RELEASE</version>

Thereafter mvn clean compile package started to work again.

Please tell me whether or not this fix works for you.

Best regards

Dmitrii Pisarenko

1 Like

Hello,

thank you so much! This worked perfectly and I can continue now with my university project! :smiley: Thank you also for the quick reply!

Best regards!
Miruna

1 Like

I think it is because of issue of spring boot version 2.3.0.RELEASE bug please upgrade to spring boot 2.3.1.RELEASE and check

Hi Dmitrii Pisarenko,

I am facing similar type of issue, while deploying a DMN file in DEV env:

Gradle build config : classpath(“org.springframework.boot:spring-boot-gradle-plugin:2.3.1.RELEASE”)

`Caused by: org.camunda.bpm.model.xml.ModelValidationException: Unable to parse schema:jar:file:/common/bin/../lib/camunda-service.jar!/DMN12.xsd
at org.camunda.bpm.model.xml.impl.parser.AbstractModelParser.createSchema(AbstractModelParser.java:189) ~[camunda-service.jar:na]`

In my case, I am using gradle instead maven, any idea how to apply this in gradle ?
By the way, I am not able to upgrade the spring-boot version due to other constrains.

Appreciate your help!

Thanks,
SK