TomcatからWildfly 10.1に移行したいので、WildflyでJerseyの残りのWebサービスをテストするためのWebアプリケーションを作成しました。私はプロジェクトを実行するときwildflyとjerseys MultiPartFeature.class
はそれがMultiPartFeature.class
に応じてエラーを示し、これは私のApplicationConfigure.java
@ApplicationPath("api")
public class ApplicationConfigure extends ResourceConfig {
public ApplicationConfigure() {
register(JacksonJaxbJsonProvider.class);
register(JacksonFeature.class);
register(MultiPartFeature.class);
packages(true, "com.example.controllers");
}
}
であり、これは(WildFlyログ)エラーです:
11:18:13,855 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 69) MSC000001: Failed to start service jboss.undertow.deployment.default-server.default-host./wildfly-webapplcation: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./wildfly-webapplcation: java.lang.RuntimeException: RESTEASY003940: Unable to instantiate MessageBodyReader
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:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
at org.jboss.threads.JBossThread.run(JBossThread.java:320)
Caused by: java.lang.RuntimeException: RESTEASY003940: Unable to instantiate MessageBodyReader
at org.jboss.resteasy.spi.ResteasyProviderFactory.registerProvider(ResteasyProviderFactory.java:1437)
at org.jboss.resteasy.spi.ResteasyProviderFactory.registerProvider(ResteasyProviderFactory.java:1368)
at org.jboss.resteasy.spi.ResteasyProviderFactory.registerProvider(ResteasyProviderFactory.java:1290)
at org.jboss.resteasy.spi.ResteasyProviderFactory.register(ResteasyProviderFactory.java:2438)
at org.jboss.resteasy.spi.ResteasyProviderFactory.register(ResteasyProviderFactory.java:99)
at org.jboss.resteasy.util.FeatureContextDelegate.register(FeatureContextDelegate.java:37)
at org.jboss.resteasy.util.FeatureContextDelegate.register(FeatureContextDelegate.java:12)
at org.glassfish.jersey.media.multipart.MultiPartFeature.configure(MultiPartFeature.java:65)
at org.jboss.resteasy.spi.ResteasyProviderFactory.registerProvider(ResteasyProviderFactory.java:1739)
at org.jboss.resteasy.spi.ResteasyProviderFactory.registerProvider(ResteasyProviderFactory.java:1368)
at org.jboss.resteasy.spi.ResteasyProviderFactory.registerProvider(ResteasyProviderFactory.java:1290)
at org.jboss.resteasy.spi.ResteasyDeployment.registration(ResteasyDeployment.java:368)
at org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:250)
at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.init(ServletContainerDispatcher.java:113)
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:250)
at io.undertow.servlet.core.ManagedServlet.createServlet(ManagedServlet.java:133)
at io.undertow.servlet.core.DeploymentManagerImpl$2.call(DeploymentManagerImpl.java:546)
at io.undertow.servlet.core.DeploymentManagerImpl$2.call(DeploymentManagerImpl.java:517)
at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42)
at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
at io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerImpl.java:559)
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
Caused by: java.lang.IllegalArgumentException: RESTEASY003900: Unable to find a public constructor for provider class org.glassfish.jersey.media.multipart.internal.MultiPartReaderServerSide
at org.jboss.resteasy.spi.ResteasyProviderFactory.createConstructorInjector(ResteasyProviderFactory.java:2255)
at org.jboss.resteasy.spi.ResteasyProviderFactory.createProviderInstance(ResteasyProviderFactory.java:2244)
at org.jboss.resteasy.spi.ResteasyProviderFactory.addMessageBodyReader(ResteasyProviderFactory.java:806)
at org.jboss.resteasy.spi.ResteasyProviderFactory.registerProvider(ResteasyProviderFactory.java:1432)
... 37 more
NetBeansはログインします。
Deploying /usr/local/wildfly-10.1.0.Final/standalone/deployments/wildfly-webapplcation-1.0.war
"{
\"WFLYCTL0080: Failed services\" => {\"jboss.undertow.deployment.default-server.default-host./wildfly-webapplcation\" => \"org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./wildfly-webapplcation: java.lang.RuntimeException: RESTEASY003940: Unable to instantiate MessageBodyReader
Caused by: java.lang.RuntimeException: RESTEASY003940: Unable to instantiate MessageBodyReader
Caused by: java.lang.IllegalArgumentException: RESTEASY003900: Unable to find a public constructor for provider class org.glassfish.jersey.media.multipart.internal.MultiPartReaderServerSide\"},
\"WFLYCTL0412: Required services that are not installed:\" => [\"jboss.undertow.deployment.default-server.default-host./wildfly-webapplcation\"],
\"WFLYCTL0180: Services with missing/unavailable dependencies\" => undefined
}"
MultiPartFeature.class
を取り除くとかなりうまく展開されます。
ところで、このアプリケーションはTomee
でうまく動作します。
どうすればよいですか?アップロードにこの機能が必要ですapi
いずれかお勧めですか?なぜ? –
私はそれをジャージーと比べることができるRESTEasyの専門家ではない。後者は私の主要な枠組みです。その答えは、なぜアプリケーションサーバーに移行することにしたのかによって大きく異なる可能性があります。ジャージーでの滞在は、特にテストカバレッジが不足している場合は、より安全です。その機能を使用せずにASに移行することは、TomcatからTomcatに移行するようなものです。同時に、ASの機能を使用してアプリケーションのサイズ、起動時間、メモリ使用量を減らし、いくつかの他の利点があります。 –
私はRestEasyを利用しようとしましたが、...私はそれと通信できないと言いましょう。あなたのお役に立ててありがとう –