Джерси с GZipEncoder ошибка развертывания на WildFly
У меня есть простой Джерси спокойный сервис, который отлично работает. Я только что добавил GZipEncoder, и после этого я не могу развернуть свою войну на WildFly 10/9.0.2. Исключение выдается во время развертывания.
Я думаю, что зависимость отсутствует, но выброшенное исключение ничего не говорит о:
2016-05-17 21:04:39,906 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 77) MSC000001: Failed to start service jboss.undertow.deployment.default-server.default-host."/szar-1.0": org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host."/szar-1.0": java.lang.NullPointerException
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:85)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at org.jboss.threads.JBossThread.run(JBossThread.java:320)
Caused by: java.lang.NullPointerException
at org.jboss.resteasy.core.ConstructorInjectorImpl.<init>(ConstructorInjectorImpl.java:45)
at org.jboss.resteasy.core.InjectorFactoryImpl.createConstructor(InjectorFactoryImpl.java:52)
at org.jboss.resteasy.spi.ResteasyProviderFactory.injectedInstance(ResteasyProviderFactory.java:2236)
at org.jboss.resteasy.core.interception.JaxrsInterceptorRegistry$AbstractInterceptorFactory.createInterceptor(JaxrsInterceptorRegistry.java:169)
at org.jboss.resteasy.core.interception.JaxrsInterceptorRegistry$OnDemandInterceptorFactory.initialize(JaxrsInterceptorRegistry.java:187)
at org.jboss.resteasy.core.interception.JaxrsInterceptorRegistry$OnDemandInterceptorFactory.checkInitialize(JaxrsInterceptorRegistry.java:202)
at org.jboss.resteasy.core.interception.JaxrsInterceptorRegistry$OnDemandInterceptorFactory.getInterceptor(JaxrsInterceptorRegistry.java:213)
at org.jboss.resteasy.core.interception.JaxrsInterceptorRegistry$AbstractInterceptorFactory.postMatch(JaxrsInterceptorRegistry.java:150)
at org.jboss.resteasy.core.interception.JaxrsInterceptorRegistry.postMatch(JaxrsInterceptorRegistry.java:404)
at org.jboss.resteasy.core.ResourceMethodInvoker.<init>(ResourceMethodInvoker.java:108)
at org.jboss.resteasy.core.ResourceMethodRegistry.processMethod(ResourceMethodRegistry.java:280)
at org.jboss.resteasy.core.ResourceMethodRegistry.register(ResourceMethodRegistry.java:251)
at org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:221)
at org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:193)
at org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:179)
at org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:156)
at org.jboss.resteasy.core.ResourceMethodRegistry.addPerRequestResource(ResourceMethodRegistry.java:75)
at org.jboss.resteasy.spi.ResteasyDeployment.registration(ResteasyDeployment.java:430)
at org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:241)
at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.init(ServletContainerDispatcher.java:112)
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.init(HttpServletDispatcher.java:36)
at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:117)
at org.wildfly.extension.undertow.security.RunAsLifecycleInterceptor.init(RunAsLifecycleInterceptor.java:78)
at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:103)
at io.undertow.servlet.core.ManagedServlet$DefaultInstanceStrategy.start(ManagedServlet.java:230)
at io.undertow.servlet.core.ManagedServlet.createServlet(ManagedServlet.java:131)
at io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerImpl.java:511)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:101)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:82)
... 6 more
2016-05-17 21:04:39,908 ERROR [org.jboss.as.controller.management-operation] (XNIO-1 task-10) WFLYCTL0013: Operation ("add") failed - address: ([("deployment" => "szar-1.0.war")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.undertow.deployment.default-server.default-host.\"/szar-1.0\"" => "org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host.\"/szar-1.0\": java.lang.NullPointerException
Caused by: java.lang.NullPointerException"}}
2016-05-17 21:04:39,909 ERROR [org.jboss.as.server] (XNIO-1 task-10) WFLYSRV0021: Deploy of deployment "szar-1.0.war" was rolled back with the following failure message:
{"WFLYCTL0080: Failed services" => {"jboss.undertow.deployment.default-server.default-host.\"/szar-1.0\"" => "org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host.\"/szar-1.0\": java.lang.NullPointerException
Caused by: java.lang.NullPointerException"}}
2016-05-17 21:04:39,930 INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) WFLYSRV0028: Stopped deployment szar-1.0.war (runtime-name: szar-1.0.war) in 20ms
2016-05-17 21:04:39,931 INFO [org.jboss.as.controller] (XNIO-1 task-10) WFLYCTL0183: Service status report
WFLYCTL0186: Services which failed to start: service jboss.undertow.deployment.default-server.default-host."/szar-1.0"
Эта война работает на Tomcat без каких-либо изменений. Если я удалю GZipEncoder, то смогу также использовать thwar на WildFly.
JerseyApplication.java
@ApplicationPath("services")
public class JerseyApplication extends ResourceConfig {
public JerseyApplication() {
packages("a.b.services");
enableFor(this, GZipEncoder.class, DeflateEncoder.class);
}
}
WelcomeService.java
@Path("/welcome")
public class WelcomeService {
@GET
@Path("hello")
public Response helloWorld() {
String welcomeMessage = "Hello World!";
return Response.ok(welcomeMessage).build();
}
}
специалист
<dependencies>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-server</artifactId>
<version>2.22.2</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet-core</artifactId>
<version>2.22.2</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet</artifactId>
<version>2.22.2</version>
</dependency>
</dependencies>