Skip to content
Advertisement

Can’t start web application in .WAR file : java.lang.ClassNotFoundException

I have a grails application written in Groovy. It is built and works when it’s launched with :

JavaScript

Now I want to run it with java to put it in a Docker container. This is the Dockerfile I prepared :

JavaScript

The server fails to start because of the following error:

JavaScript

When I checked the classes folder in WEB-INF, I found that the class is there in the correct path. I tried with a Tomcat setup, with Docker and without Docker and I’m still encountering the exact same error. I think something is wrong with the .WAR build. Here is the build.gradle file

build.gradle:

JavaScript

gradle.properties:

JavaScript

Maybe there is something is lacking or something is wrong with the grails/groovy version ? I’m stuck for the entire day so I would appreciate your help.


Update : Here is the Dockerfile I tried with Tomcat that I mentionned earlier. It gives me the exact same error.

JavaScript

Advertisement

Answer

I can’t believe I wasted two days straight on this because someone wrote the package with an uppercase letter. There was a class in a package :

JavaScript

When I changed it to

JavaScript

I got past this error.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement