1
votes

I have containerised a spring boot application. It is contained in a jar file. when I call the jar file separately It is working but when I run it through docker-compose up it yields the following error:

ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'crawlerController': Unsatisfied dependency expressed through field 'campaignservice'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'campaignService': Unsatisfied dependency expressed through field 'campaignrepository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'campaignRepository': Cannot resolve reference to bean 'org.springframework.data.neo4j.transaction.SharedSessionCreator#0' while setting bean property 'session'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.data.neo4j.transaction.SharedSessionCreator#0': Cannot resolve reference to bean 'sessionFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [org/springframework/boot/autoconfigure/data/neo4j/Neo4jDataAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.neo4j.ogm.session.SessionFactory]: Factory method 'sessionFactory' threw exception; nested exception is java.lang.TypeNotPresentException: Type javafx.util.Pair not present

Given that the jar works when invoked separately I assume that all of the dependencies are contained in the classpath. so I do not understand why it does not work when called through Docker

the dockerFile is :

FROM openjdk:8-jre

VOLUME /tmp
ADD target/SpringNeoServer.jar /SpringNeoServer.jar

EXPOSE 7864

ENTRYPOINT ["java", "-jar", "SpringNeoServer.jar"]
1

1 Answers

1
votes

JavaFX is not included in this version of openjdk.

Instructions to add it can be found here.