BPMN20.xsd not found/accessible in jar

I am trying to upload new BPMN file, using REST endpoint /rest/engine/default/deployment/create
It was working well for years but not anymore since yesterday.

Error message:
Failed to read schema document 'jar:file:/usr/camunda-boot-1.0.0.jar!/BOOT-INF/lib/camunda-engine-7.13.0.jar!/org/camunda/bpm/engine/impl/bpmn/parser/BPMN20.xsd

The full error message:

12:01:07.068 [http-nio-8090-exec-3] 13583  /rest/engine/default/deployment/create ERROR org.camunda.bpm.engine.context - ENGINE-16004 Exception while closing command context: ENGINE-09005 Could not parse BPMN process. Errors: 

* schema_reference.4: Failed to read schema document 'jar:file:/usr/camunda-boot-1.0.0.jar!/BOOT-INF/lib/camunda-engine-7.13.0.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.13.0.jar!/org/camunda/bpm/engine/impl/bpmn/parser/BPMN20.xsd not found in /usr/camunda-boot-1.0.0.jar | resource versLesEtoiles.bpmn | line 2 | column 500


* cvc-elt.1: Cannot find the declaration of element 'definitions'. | resource versLesEtoiles.bpmn | line 2 | column 500
org.camunda.bpm.engine.ParseException: ENGINE-09005 Could not parse BPMN process. Errors: 

* schema_reference.4: Failed to read schema document 'jar:file:/usr/camunda-boot-1.0.0.jar!/BOOT-INF/lib/camunda-engine-7.13.0.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.13.0.jar!/org/camunda/bpm/engine/impl/bpmn/parser/BPMN20.xsd not found in /usr/camunda-boot-1.0.0.jar | resource versLesEtoiles.bpmn | line 2 | column 500


* cvc-elt.1: Cannot find the declaration of element 'definitions'. | resource versLesEtoiles.bpmn | line 2 | column 500
	at org.camunda.bpm.engine.impl.util.EngineUtilLogger.exceptionDuringParsing(EngineUtilLogger.java:66)

	at org.camunda.bpm.engine.impl.util.xml.Parse.throwExceptionForErrors(Parse.java:254)
	at org.camunda.bpm.engine.impl.bpmn.parser.BpmnParse.execute(BpmnParse.java:272)
	at org.camunda.bpm.engine.impl.bpmn.deployer.BpmnDeployer.transformDefinitions(BpmnDeployer.java:105)
	at org.camunda.bpm.engine.impl.AbstractDefinitionDeployer.transformResource(AbstractDefinitionDeployer.java:99)
	at org.camunda.bpm.engine.impl.AbstractDefinitionDeployer.parseDefinitionResources(AbstractDefinitionDeployer.java:74)
	at org.camunda.bpm.engine.impl.AbstractDefinitionDeployer.deploy(AbstractDefinitionDeployer.java:64)
	at org.camunda.bpm.engine.impl.persistence.deploy.cache.CacheDeployer$1.call(CacheDeployer.java:54)
	at org.camunda.bpm.engine.impl.persistence.deploy.cache.CacheDeployer$1.call(CacheDeployer.java:51)
	at org.camunda.bpm.engine.impl.interceptor.CommandContext.runWithoutAuthorization(CommandContext.java:537)
	at org.camunda.bpm.engine.impl.persistence.deploy.cache.CacheDeployer.deploy(CacheDeployer.java:51)
	at org.camunda.bpm.engine.impl.persistence.deploy.cache.DeploymentCache.deploy(DeploymentCache.java:67)
	at org.camunda.bpm.engine.impl.persistence.entity.DeploymentManager.insertDeployment(DeploymentManager.java:65)
	at org.camunda.bpm.engine.impl.cmd.DeployCmd.deploy(DeployCmd.java:254)
	at org.camunda.bpm.engine.impl.cmd.DeployCmd.lambda$doExecute$0(DeployCmd.java:155)
	at org.camunda.bpm.engine.impl.interceptor.CommandContext.runWithoutAuthorization(CommandContext.java:537)
	at org.camunda.bpm.engine.impl.cmd.DeployCmd.doExecute(DeployCmd.java:141)

Thanks for ideas!

Erki

Can you upload the model?
Looks like there could be a problem with it.

oneBPMNDiagram.bpmn (25.9 KB)

One example is here.

Camunda Spring Boot is running in Centos Docker container. I suspect the xsd files are not accessible

It looks we have something wrong when we build the project inside Dockerfile.
Without Dockerfile, the Camunda Spring Boot jar works perfectly.

So, our solutions is: we build jar file (in Jenkins) before building Docker image and copy the jar to Dockerfile.

Are you doing this in a pipeline? I have the same issue when using the CodePipeline in AWS, works fine locally though…
Could you share the details on how are you building the jar and passing it to Docker?

Thanks!

  1. build war: mvn clean package

  2. Dockerfile, copy the war to docker

FROM openjdk:10-jdk

ENV LANG C.UTF-8
ENV JAVA_TOOL_OPTIONS -Dfile.encoding=UTF8

Create app directory

RUN rm -rf /usr/src/app
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY . /usr/src/app/

RUN cp -a /usr/src/app/target/filename.war /usr
RUN rm -rf /usr/src/app

ENV Settings

ARG ENV=default
ENV PROFILE $ENV

RUN echo $PROFILE

RUN JAVA_OPTS=“-XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=70 -XX:CompressedClassSpaceSize=64m -XX:ReservedCodeCacheSize=64m -XX:MaxMetaspaceSize=256m -Xms256m -Xmx750m”

ENTRYPOINT [ “sh”, “-c”, “java $JAVA_OPTS -jar -Dspring.profiles.active=$PROFILE /usr/filename.war” ]

Jenkins pipeline

    stage('Build package') {
        parallel {
            stage("Build docker image") {
                when {
                    anyOf {
                        branch 'develop'
              branch 'test'
                        branch 'master'
                    }
                }
                steps {
                    sh "mvn clean package"
                }
            }
        }
    }
    stage('Build docker image') {
        parallel {
            stage("Build docker image") {
                when {
                    anyOf {
                        branch 'develop'
  					              branch 'test'
                        branch 'master'
                    }
                }
                steps {
                    sh "docker build -t dockerfilename:${TAG_NAME} ."
                }
            }
        }
    }

Thanks for the quick reply!
I have found another post that fixes the problem without having to re-engineer the pipeline - Camunda cannot read XSD when running a packaged Spring Boot application

Apparently, we need to add the version of the spring-boot-maven-plugin in the pom.xml

<build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                **<version>2.0.1.RELEASE</version>**
                <configuration>
                    <layout>ZIP</layout>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
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