Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to run docker image - no main manifest attribute, in app.jar [duplicate]

Tags:

java

docker

maven

Unable to run a docker image built. When I run with the command

docker run -p 8080:8080 -t {image prefix name}/{image name}

I get a message "no main manifest attribute, in app.jar"

Using docker-maven-plugin and tried maven-assembly-plugin with main class called out explicitly.

docker version Boot2Docker 1.7.0

like image 754
RSG Avatar asked Jun 26 '15 17:06

RSG


1 Answers

The manifest inside the jar file inside the Docker image does not contain what you expect it to, causing the failure to start when running with java -jar ...

I would suggest you debug your procedure locally first:

  • Is the MANIFEST.MF file present?
  • Is it in the exact location expected by the JVM when invoking java as you do?
  • Is the line "Main-Class: classname" present in the MANIFEST.MF file?
  • Is the class name given that exact name as the class you want to invoke is named?
  • Is the classpath given in MANIFEST.MF as you expect it to be?
  • Is the class to be invoke present in that classpath?

Further details in the official Oracle documentation in https://docs.oracle.com/javase/tutorial/deployment/jar/appman.html with friends.

like image 97
Thorbjørn Ravn Andersen Avatar answered Nov 14 '22 08:11

Thorbjørn Ravn Andersen