The applicationContext.xml file can't be found. That file should be at the top level inside of the component .jar.
I'm not sure what your component directory structure looks like, so I went ahead and took our
example Java HelloWorldComponent and modified it to work in Docker. First, I had to change
this line from "<format>tar.gz</format>" to "
<format>dir</format>". Then I added a "Dockerfile" to the top-level HelloWorldComponent dir with this content:
FROM openmpf_java_component_build:latest as build_component
COPY pom.xml pom.xml
RUN mvn org.apache.maven.plugins:maven-dependency-plugin:3.1.1:go-offline;
COPY . .
RUN mvn package -Dmpf.assembly.format=dir
RUN ls /home/mpf/component_src/target/plugin-packages/*
FROM ${BUILD_REGISTRY}openmpf_java_executor:latest as install_component
COPY --from=build_component /home/mpf/component_src/target/plugin-packages/JavaHelloWorldExample/JavaHelloWorldExample \
$PLUGINS_DIR/JavaHelloWorldExample
I was then able to build that by running the following command from within the top-level HelloWorldComponent dir:
docker build . -t openmpf_hello_world_componentAnd register it to an existing "docker-compose up" deployment with:
docker run --rm --network openmpf_default -v openmpf_shared_data:/opt/mpf/share -e WFM_USER=admin -e WFM_PASSWORD=mpfadm <image-id>
I was then able to run a job with the "JAVAHELLOWORLD DETECTION PIPELINE" in the Workflow Manager web UI.
I hope this working example helps.
- Jeff