泽西岛停止与InjectionManagerFactory一起工作
在Tomcat 8.5.11中运行Jersey API时,出现以下错误,导致API停止: HTTP状态500-Servlet Jersey REST Service的Servlet.init()抛出异常 类型例外报告 Servlet Jersey REST Service的消息Servlet.init()抛出异常 描述服务器遇到内部错误,导致服务器无法满足此请求。 例外 javax.servlet.ServletException:用于Servlet Jersey REST Service的Servlet.init()引发了异常org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:474)org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve。 java:79)org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624)org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)org.apache.coyote.http11.Http11Processor。服务(Http11Processor.java:783)org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)org.apache.coyote.AbstractProtocol $ ConnectionHandler.process(AbstractProtocol.java:798)org.apache.tomcat.util。 net.NioEndpoint $ SocketProcessor.doRun(NioEndpoint.java:1434)org.apache.tomcat.util.net.SocketProcessorBase。运行(SocketProcessorBase.java:49)java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:617)org.apache.tomcat.util。 thread.TaskThread $ WrappingRunnable.run(TaskThread.java:61)java.lang.Thread.run(Thread.java:745) 根本原因 java.lang.IllegalStateException:找不到InjectionManagerFactory。org.glassfish.jersey.internal.inject.Injections.lookupInjectionManagerFactory(Injections.java:97)org.glassfish.jersey.internal.inject.Injections.createInjectionManager(Injections.java:89)org.glassfish.jersey.server.ApplicationHandler。 (ApplicationHandler.java:282)org.glassfish.jersey.servlet.WebComponent。(WebComponent.java:335)org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:178)org.glassfish.jersey.servlet。 ServletContainer.init(ServletContainer.java:370)javax.servlet.GenericServlet.init(GenericServlet.java:158)org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:474)org.apache.catalina.valves。 ErrorReportValve.invoke(ErrorReportValve.java:79)org.apache.catalina.valves。 应用程序使用以下gradle依赖项进行构建: dependencies { compile ( // REST "org.glassfish.jersey.containers:jersey-container-servlet:2.+", "javax.servlet:javax.servlet-api:4.+", // REST Token "org.bitbucket.b_c:jose4j:0.+", // MongoDB "org.hibernate.ogm:hibernate-ogm-bom:5.+", …