I downloaded your example and trying to run locally. I am getting below error.
java.lang.NullPointerException
at io.happycoding.ServerMain.main (ServerMain.java:29)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:254)
at java.lang.Thread.run (Thread.java:834)
at the line:
URL webAppDir =
ServerMain.class.getClassLoader().getResource(“META-INF/resources”);
webAppContext.setResourceBase(webAppDir.toURI().toString());
I think this is because the code expects a webapp directory inside the src/main directory. In this example, that directory is empty, but GitHub doesn’t store empty directories.
To fix this, create an empty webapp directory inside the project structure:
I have the same error, the problem is that in line 27 of the ServerMain class the URL object is defined as null
URL webAppDir = ServerMain.class.getClassLoader().getResource(“META-INF/resources”);
then the error jump in line 29:
webAppContext.setResourceBase(webAppDir.toURI().toString());