0

I have a microservice that is called account.query. When I try to up services by using docker compose up command, account.query is getting an error.

  • I have also a microservice that is called account.cmd, but it is not getting an error.

I have been trying to solve this problem for hours, but I could not.

Here is Docker file my account.query microservice.

FROM adoptopenjdk:11.0.4_11-jre-hotspot
EXPOSE 5003

RUN mkdir -p /usr/app
WORKDIR /usr/app

COPY build/libs/account.query-0.0.1-SNAPSHOT.jar /usr/app/

ENV JAVA_OPTS="-Xmx32m"
CMD exec java $JAVA_OPTS -jar account.query-0.0.1-SNAPSHOT.jar

Here is Docker logs for the service.

enter image description here

Here is my github repository. https://github.com/dogaanismail/bank-solution

I would be very happy if someone could help.

Ismail Dogan
  • 295
  • 2
  • 20
  • 1
    That error message often means the jar file was built with a newer JDK than you're running it with; how did you build the jar file? The screen shot you've attached isn't that easy to read, is it possible to replace it with the text of the error message you get? – David Maze Mar 19 '22 at 15:23
  • Adding to David's comment: The screenshot says "class file version 61.0". If you look that up (for example [here](https://stackoverflow.com/questions/9170832/list-of-java-class-file-format-major-version-numbers)), you will see that the classes were apparently compiled for Java 17, but your image is using Java 11. – Marcono1234 Mar 19 '22 at 16:29

0 Answers0