Jenkins with Spring Boot = Exceptioniitializererror

Asked

Viewed 55 times

-3

I have an application developed with spring-boot. If I manually call the jar generated via Maven by the java -jar command, the application starts normally, and we can use it here.

However, to publish in the environments (homologation, production etc) we use the Jenkins.

The procedure consists of:

  1. Get the last commit on gitlab
  2. Call the Maven clean package. With the Build he continues in the next steps:
  3. Abort previous running application
  4. Move the previous application to a backup directory
  5. Play the new version of the application
  6. Execute (nohup java -jar)

It runs, the process stays in the air, but requests return error 500:

{
    "timestamp": 1585850905158,
    "status": 500,
    "error": "Internal Server Error",
    "exception": "java.lang.ExceptionInInitializerError",
    "message": "No message available",
    "path": "/endpoint/da/aplicacao"
}

It suggests that the process is stuck (since the application is running) and Jenkins closes the job by timeout. But what I can’t understand is that even using the nohup, this process still seems to be stuck in the job of Jenkins.

Someone’s been through something like this?

  • Check and post the server logs, not just the return json of the request

  • @nullptr At the moment I am doing just that because the application was not generating log. echo "java -jar nomedojar.jar" | at now but stumbled upon a mistake that believe which is not related. !

1 answer

0


We were able to solve the problem by calling the generated application:

Instead of just

nohup java -jar

was added the nice to give priority to implementation:

nohup nice java -jar  $NOMEDOARQUIVOJAR

With this the application has been published and is already running!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.