当我尝试从Jboss 7迁移业务应用程序时,我遇到了问题。
我得到了这个堆栈跟踪:
247341 [ServerService Thread Pool -- 5] ERROR org.jboss.msc.service.fail - MSC000001: Failed to start service jboss.undertow.deployment.default-server.default-host./starnet
org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./starnet: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'JSONReferentielGeolocBenefRessource' defined in "/D:/CloudStation/Slim/CloudStation/004_Developpement/star/Workspace/starnet-bom/starnet-web/target/starnet-web-6.0.4-SNAPSHOT/WEB-INF/classes/net/star/starnet/web/rest/auth/ressources/json/JSONReferentielGeolocBenefRessource.class": Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.jboss.resteasy.spi.InjectorFactory.createPropertyInjector(Ljava/lang/Class;)Lorg/jboss/resteasy/spi/PropertyInjector;
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: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'JSONReferentielGeolocBenefRessource' defined in "/D:/CloudStation/Slim/CloudStation/004_Developpement/star/Workspace/starnet-bom/starnet-web/target/starnet-web-6.0.4-SNAPSHOT/WEB-INF/classes/net/star/starnet/web/rest/auth/ressources/json/JSONReferentielGeolocBenefRessource.class": Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.jboss.resteasy.spi.InjectorFactory.createPropertyInjector(Ljava/lang/Class;)Lorg/jboss/resteasy/spi/PropertyInjector;
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:442)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:458)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:339)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:306)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
at javax.servlet.GenericServlet.init(GenericServlet.java:244)
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.NoSuchMethodError: org.jboss.resteasy.spi.InjectorFactory.createPropertyInjector(Ljava/lang/Class;)Lorg/jboss/resteasy/spi/PropertyInjector;
at org.jboss.resteasy.plugins.spring.SpringBeanProcessor$ResteasyBeanPostProcessor.getInjector(SpringBeanProcessor.java:133)
at org.jboss.resteasy.plugins.spring.SpringBeanProcessor$ResteasyBeanPostProcessor.postProcessAfterInitialization(SpringBeanProcessor.java:125)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:407)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1426)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
... 37 more
247349 [management-handler-thread - 2] ERROR org.jboss.as.server - WFLYSRV0021: Deploy of deployment "starnet-web-6.0.4-SNAPSHOT.war" was rolled back with the following failure message:
{
"WFLYCTL0080: Failed services" => {"jboss.undertow.deployment.default-server.default-host./starnet" => "org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./starnet: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'JSONReferentielGeolocBenefRessource' defined in \"/D:/CloudStation/Slim/CloudStation/004_Developpement/star/Workspace/starnet-bom/starnet-web/target/starnet-web-6.0.4-SNAPSHOT/WEB-INF/classes/net/star/starnet/web/rest/auth/ressources/json/JSONReferentielGeolocBenefRessource.class\": Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.jboss.resteasy.spi.InjectorFactory.createPropertyInjector(Ljava/lang/Class;)Lorg/jboss/resteasy/spi/PropertyInjector;
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'JSONReferentielGeolocBenefRessource' defined in \"/D:/CloudStation/Slim/CloudStation/004_Developpement/star/Workspace/starnet-bom/starnet-web/target/starnet-web-6.0.4-SNAPSHOT/WEB-INF/classes/net/star/starnet/web/rest/auth/ressources/json/JSONReferentielGeolocBenefRessource.class\": Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.jboss.resteasy.spi.InjectorFactory.createPropertyInjector(Ljava/lang/Class;)Lorg/jboss/resteasy/spi/PropertyInjector;
Caused by: java.lang.NoSuchMethodError: org.jboss.resteasy.spi.InjectorFactory.createPropertyInjector(Ljava/lang/Class;)Lorg/jboss/resteasy/spi/PropertyInjector;"},
"WFLYCTL0412: Required services that are not installed:" => ["jboss.undertow.deployment.default-server.default-host./starnet"],
"WFLYCTL0180: Services with missing/unavailable dependencies" => undefined
}
[2018-01-17 03:20:41,313] Artifact starnet-web:war exploded: Error during artifact deployment. See server log for details.
[2018-01-17 03:20:41,314] Artifact starnet-web:war exploded: java.lang.Exception: {"WFLYCTL0080: Failed services" => {"jboss.undertow.deployment.default-server.default-host./starnet" => "org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./starnet: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'JSONReferentielGeolocBenefRessource' defined in \"/D:/CloudStation/Slim/CloudStation/004_Developpement/star/Workspace/starnet-bom/starnet-web/target/starnet-web-6.0.4-SNAPSHOT/WEB-INF/classes/net/star/starnet/web/rest/auth/ressources/json/JSONReferentielGeolocBenefRessource.class\": Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.jboss.resteasy.spi.InjectorFactory.createPropertyInjector(Ljava/lang/Class;)Lorg/jboss/resteasy/spi/PropertyInjector;
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'JSONReferentielGeolocBenefRessource' defined in \"/D:/CloudStation/Slim/CloudStation/004_Developpement/star/Workspace/starnet-bom/starnet-web/target/starnet-web-6.0.4-SNAPSHOT/WEB-INF/classes/net/star/starnet/web/rest/auth/ressources/json/JSONReferentielGeolocBenefRessource.class\": Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.jboss.resteasy.spi.InjectorFactory.createPropertyInjector(Ljava/lang/Class;)Lorg/jboss/resteasy/spi/PropertyInjector;
Caused by: java.lang.NoSuchMethodError: org.jboss.resteasy.spi.InjectorFactory.createPropertyInjector(Ljava/lang/Class;)Lorg/jboss/resteasy/spi/PropertyInjector;"},"WFLYCTL0412: Required services that are not installed:" => ["jboss.undertow.deployment.default-server.default-host./starnet"],"WFLYCTL0180: Services with missing/unavailable dependencies" => undefined}
我已经更新了我的pom.xml,以便与Wildfly上相同版本的resteasy匹配
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId>
<version>3.0.19.Final</version><!--$NO-MVN-MAN-VER$ -->
<scope>provided</scope>
</dependency>
我还添加了一个部署描述符,以便停用Jboss上的某些模块,并使用Jboss的resteasy。
<jboss-deployment-structure>
<ear-subdeployments-isolated>false</ear-subdeployments-isolated>
<deployment>
<exclude-subsystems>
<subsystem name="webservices" />
</exclude-subsystems>
<dependencies>
<module name="javax.xml.ws.api" export="true" />
<module name="javax.jws.api" export="true" />
</dependencies>
</deployment>
</jboss-deployment-structure>
您有什么想法可以解决这个问题吗? 提前致谢