juneau-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ishita Singh <ishitasingh1...@gmail.com>
Subject Outreachy Internship
Date Thu, 10 Oct 2019 10:08:46 GMT

I am facing the following problems while making the Dockerfile

1. First approach - Create a jar file of the app and run.
    Issue - There is no manifest file. I tried adding a manifest file using
the command - jar -cvfm example.jar manifest.txt *.java
Manifest file contents-
Manifest-Version: 1.0
Created-By: 1.8.0_171 (Oracle Corporation)
Main-Class: org.apache.juneau.petstore.App

Got the below error on running  java -jar example.jar
Error: Could not find or load main class org.apache.juneau.petstore.App

2. Second approach - Run the application with mvn spring-boot:run
    Issue - On running the docker image I get the below error
SEVERE: Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'petStoreService' defined in class path resource
[org/apache/juneau/petstore/AppConfiguration.class]: Bean instantiation via
factory method failed; nested exception is
org.springframework.beans.BeanInstantiationException: Failed to instantiate
[org.apache.juneau.petstore.service.PetStoreService]: Factory method
'petStoreService' threw exception; nested exception is
java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException

The app runs locally with the mvn command.
To reproduce the error you can clone
Then run the below commands inside juneau-petstore directory.
docker build . -t image
docker run --rm -it image:latest

View raw message