Java 在WildFly 8.1上运行Jersey2 REST客户端时出现问题

Java 在WildFly 8.1上运行Jersey2 REST客户端时出现问题,java,jersey-2.0,jersey-client,wildfly-8,Java,Jersey 2.0,Jersey Client,Wildfly 8,我正在尝试将我的REST客户端嵌入到Jersey 2.13应用服务器WildFly 8.1中。我知道WF8有自己的REST客户端实现(RestEasy)。而且WF8不愿意让泽西活下去。它截取Jersey并替换为自己的类 这是我的异常日志: java.lang.LinkageError: org/glassfish/jersey/media/multipart/internal/FormDataParamValueFactoryProvider org.glassfish.jersey.media

我正在尝试将我的REST客户端嵌入到
Jersey 2.13
应用服务器
WildFly 8.1
中。我知道WF8有自己的REST客户端实现(RestEasy)。而且WF8不愿意让泽西活下去。它截取Jersey并替换为自己的类

这是我的异常日志:

java.lang.LinkageError: org/glassfish/jersey/media/multipart/internal/FormDataParamValueFactoryProvider
org.glassfish.jersey.media.multipart.internal.FormDataParameterInjectionFeature.configure(FormDataParameterInjectionFeature.java:77)
org.jboss.resteasy.spi.ResteasyProviderFactory.registerProvider(ResteasyProviderFactory.java:1673)
org.jboss.resteasy.spi.ResteasyProviderFactory.registerProvider(ResteasyProviderFactory.java:1310)
org.jboss.resteasy.spi.ResteasyProviderFactory.registerProvider(ResteasyProviderFactory.java:1232)
org.jboss.resteasy.spi.ResteasyProviderFactory.register(ResteasyProviderFactory.java:2364)
org.jboss.resteasy.spi.ResteasyProviderFactory.register(ResteasyProviderFactory.java:97)
org.jboss.resteasy.util.FeatureContextDelegate.register(FeatureContextDelegate.java:37)
org.jboss.resteasy.util.FeatureContextDelegate.register(FeatureContextDelegate.java:12)
org.glassfish.jersey.media.multipart.MultiPartFeature.configure(MultiPartFeature.java:64)
org.jboss.resteasy.spi.ResteasyProviderFactory.registerProvider(ResteasyProviderFactory.java:1673)
org.jboss.resteasy.spi.ResteasyProviderFactory.registerProvider(ResteasyProviderFactory.java:1310)
org.jboss.resteasy.spi.ResteasyProviderFactory.registerProvider(ResteasyProviderFactory.java:1232)
org.jboss.resteasy.spi.ResteasyProviderFactory.register(ResteasyProviderFactory.java:2364)
org.jboss.resteasy.client.jaxrs.internal.ClientConfiguration.register(ClientConfiguration.java:168)
org.jboss.resteasy.client.jaxrs.internal.ClientWebTarget.register(ClientWebTarget.java:351)
org.jboss.resteasy.client.jaxrs.internal.ClientWebTarget.register(ClientWebTarget.java:23)
com.jaspersoft.jasperserver.jaxrs.client.core.JerseyRequest.<init>(JerseyRequest.java:104)
com.jaspersoft.jasperserver.jaxrs.client.core.JerseyRequest.buildRequest(JerseyRequest.java:62)
com.jaspersoft.jasperserver.jaxrs.client.core.JerseyRequest.buildRequest(JerseyRequest.java:55)
com.jaspersoft.jasperserver.jaxrs.client.apiadapters.serverInfo.ServerInfoService.buildServerInfoRequest(ServerInfoService.java:44)
com.jaspersoft.jasperserver.jaxrs.client.apiadapters.serverInfo.ServerInfoService.edition(ServerInfoService.java:51)
il.alex.jboss.example.MainServlet.doGet(MainServlet.java:26)
javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61)
io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:113)
io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:56)
io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45)
io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:61)
io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58)
io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70)
io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76)
io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:240)
io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:227)
io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:73)
io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:146)
io.undertow.server.Connectors.executeRootHandler(Connectors.java:177)
io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:727)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
java.lang.Thread.run(Thread.java:745)
我得到


不确定它是否有效,但尝试评论

<subsystem xmlns="urn:jboss:domain:jaxrs:1.0"/> 

从您的wildfly配置文件

如果您在独立模式下运行wildfly,请在standalone.xml中编辑它
或者domain.xml

在我看来,我们得到的新错误更像是一个xml验证错误。经历了这一切之后,您似乎遇到了麻烦:)
2014-10-28 05:20:14,308] Artifact jboss-another-example:war exploded: Artifact is being deployed, please wait...
[0m17:20:14,570 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-5) JBAS015876: Starting deployment of "jboss_another_example_war_exploded.war" (runtime-name: "jboss_another_example_war_exploded.war")
[0m[31m17:20:15,571 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.deployment.unit."jboss_another_example_war_exploded.war".STRUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit."jboss_another_example_war_exploded.war".STRUCTURE: JBAS018733: Failed to process phase STRUCTURE of deployment "jboss_another_example_war_exploded.war"
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:166) [wildfly-server-8.1.0.Final.jar:8.1.0.Final]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_40-ea]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_40-ea]
    at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_40-ea]
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS018748: Error loading jboss-deployment-structure.xml from /Users/alex/IdeaProjects/jboss-another-example/out/artifacts/jboss_another_example_war_exploded.war/WEB-INF/jboss-deployment-structure.xml
    at org.jboss.as.server.deployment.module.descriptor.DeploymentStructureDescriptorParser.parse(DeploymentStructureDescriptorParser.java:322) [wildfly-server-8.1.0.Final.jar:8.1.0.Final]
    at org.jboss.as.server.deployment.module.descriptor.DeploymentStructureDescriptorParser.parse(DeploymentStructureDescriptorParser.java:294) [wildfly-server-8.1.0.Final.jar:8.1.0.Final]
    at org.jboss.as.server.deployment.module.descriptor.DeploymentStructureDescriptorParser.deploy(DeploymentStructureDescriptorParser.java:158) [wildfly-server-8.1.0.Final.jar:8.1.0.Final]
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:159) [wildfly-server-8.1.0.Final.jar:8.1.0.Final]
    ... 5 more
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[5,13]
Message: JBAS018754: Unexpected content of type 'element start', name is '{urn:jboss:domain:jaxrs:1.0}subsystem', text is: 'null'
    at org.jboss.as.server.deployment.module.descriptor.JBossDeploymentStructureParser12.unexpectedContent(JBossDeploymentStructureParser12.java:1194) [wildfly-server-8.1.0.Final.jar:8.1.0.Final]
    at org.jboss.as.server.deployment.module.descriptor.JBossDeploymentStructureParser12.parseExcludeSubsystem(JBossDeploymentStructureParser12.java:1100) [wildfly-server-8.1.0.Final.jar:8.1.0.Final]
    at org.jboss.as.server.deployment.module.descriptor.JBossDeploymentStructureParser12.parseModuleStructureSpec(JBossDeploymentStructureParser12.java:366) [wildfly-server-8.1.0.Final.jar:8.1.0.Final]
    at org.jboss.as.server.deployment.module.descriptor.JBossDeploymentStructureParser12.parseDeployment(JBossDeploymentStructureParser12.java:267) [wildfly-server-8.1.0.Final.jar:8.1.0.Final]
    at org.jboss.as.server.deployment.module.descriptor.JBossDeploymentStructureParser12.readElement(JBossDeploymentStructureParser12.java:244) [wildfly-server-8.1.0.Final.jar:8.1.0.Final]
    at org.jboss.as.server.deployment.module.descriptor.JBossDeploymentStructureParser12.readElement(JBossDeploymentStructureParser12.java:69) [wildfly-server-8.1.0.Final.jar:8.1.0.Final]
    at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:110)
    at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:69)
    at org.jboss.as.server.deployment.module.descriptor.DeploymentStructureDescriptorParser.parse(DeploymentStructureDescriptorParser.java:316) [wildfly-server-8.1.0.Final.jar:8.1.0.Final]
    ... 8 more

[0m[31m17:20:15,578 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 2) JBAS014613: Operation ("deploy") failed - address: ([("deployment" => "jboss_another_example_war_exploded.war")]) - failure description: {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"jboss_another_example_war_exploded.war\".STRUCTURE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"jboss_another_example_war_exploded.war\".STRUCTURE: JBAS018733: Failed to process phase STRUCTURE of deployment \"jboss_another_example_war_exploded.war\"
    Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS018748: Error loading jboss-deployment-structure.xml from /Users/alex/IdeaProjects/jboss-another-example/out/artifacts/jboss_another_example_war_exploded.war/WEB-INF/jboss-deployment-structure.xml
    Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[5,13]
Message: JBAS018754: Unexpected content of type 'element start', name is '{urn:jboss:domain:jaxrs:1.0}subsystem', text is: 'null'"}}
[0m[31m17:20:15,582 ERROR [org.jboss.as.server] (management-handler-thread - 2) JBAS015870: Deploy of deployment "jboss_another_example_war_exploded.war" was rolled back with the following failure message: 
{"JBAS014671: Failed services" => {"jboss.deployment.unit.\"jboss_another_example_war_exploded.war\".STRUCTURE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"jboss_another_example_war_exploded.war\".STRUCTURE: JBAS018733: Failed to process phase STRUCTURE of deployment \"jboss_another_example_war_exploded.war\"
    Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS018748: Error loading jboss-deployment-structure.xml from /Users/alex/IdeaProjects/jboss-another-example/out/artifacts/jboss_another_example_war_exploded.war/WEB-INF/jboss-deployment-structure.xml
    Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[5,13]
Message: JBAS018754: Unexpected content of type 'element start', name is '{urn:jboss:domain:jaxrs:1.0}subsystem', text is: 'null'"}}
[0m[0m17:20:15,586 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015877: Stopped deployment jboss_another_example_war_exploded.war (runtime-name: jboss_another_example_war_exploded.war) in 4ms
[0m[0m17:20:15,589 INFO  [org.jboss.as.controller] (management-handler-thread - 2) JBAS014774: Service status report
JBAS014777:   Services which failed to start:      service jboss.deployment.unit."jboss_another_example_war_exploded.war".STRUCTURE

[0m[2014-10-28 05:20:15,667] Artifact jboss-another-example:war exploded: Error during artifact deployment. See server log for details.
[2014-10-28 05:20:15,669] Artifact jboss-another-example:war exploded: java.lang.Exception: {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"jboss_another_example_war_exploded.war\".STRUCTURE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"jboss_another_example_war_exploded.war\".STRUCTURE: JBAS018733: Failed to process phase STRUCTURE of deployment \"jboss_another_example_war_exploded.war\"
    Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS018748: Error loading jboss-deployment-structure.xml from /Users/alex/IdeaProjects/jboss-another-example/out/artifacts/jboss_another_example_war_exploded.war/WEB-INF/jboss-deployment-structure.xml
    Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[5,13]
Message: JBAS018754: Unexpected content of type 'element start', name is '{urn:jboss:domain:jaxrs:1.0}subsystem', text is: 'null'"}}
<subsystem xmlns="urn:jboss:domain:jaxrs:1.0"/>