I wanted to change some small things to my App engine backend but I could not upload it anymore to the Appengine Google Cloud. So I updated the version of the appengine sdk to version 1.9.21 (like in another project which still updates).
Now I get the following error while running the project:
java.lang.NoClassDefFoundError: com/google/api/server/spi/guice/GuiceSystemServiceServletModule
When I deploy it I allways get this error:
java.lang.NoClassDefFoundError: nl/mynamespace/guice/FDGuiceSystemServiceServletModule
This class should be included in com.google.appengine:appengine-endpoints:1.9.22 What can be wrong?
The strange thing is that I changed nothing on the Guice part and in another project it is working the same way...
FDGuiceServletContextListener.java:
public class FDGuiceServletContextListener extends GuiceServletContextListener {
@Override
protected Injector getInjector() {
return Guice.createInjector(new FDGuiceSystemServiceServletModule());
}
}
FDGuiceSystemServiceServletModule.java
public class FDGuiceSystemServiceServletModule extends GuiceSystemServiceServletModule {
@Override
protected void configureServlets() {
super.configureServlets();
Set<Class<?>> serviceClasses = new HashSet<>();
serviceClasses.add(DashboardApi.class);
serviceClasses.add(SalesAPI.class);
serviceClasses.add(LeadsApi.class);
serveGuiceSystemServiceServlet("/_ah/spi/*", serviceClasses);
}
}
web.xml
[..]
<filter>
<filter-name>guiceFilter</filter-name>
<filter-class>com.google.inject.servlet.GuiceFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>guiceFilter</filter-name>
<url-pattern>/_ah/spi/*</url-pattern>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>nl.mynamespace.guice.FDGuiceServletContextListener</listener-class>
</listener>
[..]