diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/traccar/web/WebServer.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/web/WebServer.java b/src/main/java/org/traccar/web/WebServer.java index 6c8a798b4..68eee78e7 100644 --- a/src/main/java/org/traccar/web/WebServer.java +++ b/src/main/java/org/traccar/web/WebServer.java @@ -40,6 +40,8 @@ import org.eclipse.jetty.websocket.server.config.JettyWebSocketServletContainerI import org.glassfish.jersey.jackson.JacksonFeature; import org.glassfish.jersey.server.ResourceConfig; import org.glassfish.jersey.servlet.ServletContainer; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.traccar.LifecycleObject; import org.traccar.api.CorsResponseFilter; import org.traccar.api.DateParameterConverterProvider; @@ -67,6 +69,8 @@ import java.util.EnumSet; public class WebServer implements LifecycleObject { + private static final Logger LOGGER = LoggerFactory.getLogger(WebServer.class); + private final Injector injector; private final Config config; private final Server server; @@ -180,6 +184,9 @@ public class WebServer implements LifecycleObject { CorsResponseFilter.class, ResourceErrorHandler.class); resourceConfig.packages(ServerResource.class.getPackage().getName()); + if (resourceConfig.getClasses().stream().filter(ServerResource.class::equals).findAny().isEmpty()) { + LOGGER.warn("Failed to load API resources"); + } servletHandler.addServlet(new ServletHolder(new ServletContainer(resourceConfig)), "/api/*"); } |