JBoss上的Java Web应用程序(Wildfly 10.0)没有通过Eclipse部署

时间:2016-05-26 20:17:21

标签: java eclipse jboss cxf wildfly

我使用Tomcat v8.0来运行我的Java Web应用程序,但是我想尝试JBoss。我通过Eclipse添加了Wildfly 10.0(也通过Eclipse下载了运行时)。

服务器启动时出现一些错误。我可以访问Y就好了,我会看到Wildfly的起始页面。但是,我无法加载我的网络应用程序。

这是我得到的错误:

http://localhost:8080

我看到它说它是由15:57:49,657 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC000001: Failed to start service jboss.deployment.unit."NpCWS.war".PARSE: org.jboss.msc.service.StartException in service jboss.deployment.unit."NpCWS.war".PARSE: WFLYSRV0153: Failed to process phase PARSE of deployment "NpCWS.war" at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:154) at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) 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) Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYWS0059: Apache CXF library (cxf-2.7.18.jar) detected in ws endpoint deployment; either provide a proper deployment replacing embedded libraries with container module dependencies or disable the webservices subsystem for the current deployment adding a proper jboss-deployment-structure.xml descriptor to it. The former approach is recommended, as the latter approach causes most of the webservices Java EE and any JBossWS specific functionality to be disabled. at org.jboss.as.webservices.deployers.WSLibraryFilterProcessor.deploy(WSLibraryFilterProcessor.java:70) at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:147) ... 5 more 引起的,但我无法弄清楚如何让JBoss使用我的版本。我知道JBoss有自己的Apache CXF罐子,但我也无法弄清楚如何更改我的Apache CXFbeans.xml来反映这一变化。

我在网上找到的所有解决方案都是针对Maven项目的,但我的只是一个简单的动态Web项目。

这是我的web.xmlbeans.xml

web.xml

beans.xml

<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd"> <import resource="classpath:META-INF/cxf/cxf.xml" /> <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" /> <import resource="classpath:META-INF/cxf/cxf-servlet.xml" /> <!-- HELLO SERVICE --> <jaxws:endpoint xmlns:tns="http://ws.cloudlet.org/" id="helloservice" implementor="org.cloudlet.ws.HelloServiceImpl" wsdlLocation="wsdl/test/helloserviceimpl.wsdl" endpointName="tns:HelloServiceImplPort" serviceName="tns:HelloServiceImplService" address="/HelloServiceImplPort"> <jaxws:features> <bean class="org.apache.cxf.feature.LoggingFeature" /> </jaxws:features> </jaxws:endpoint> <!-- CALCULATOR SERVICE --> <jaxws:endpoint xmlns:tns="http://ws.cloudlet.org/" id="calculatorservice" implementor="org.cloudlet.ws.CalculatorServiceImpl" wsdlLocation="wsdl/test/calculatorserviceimpl.wsdl" endpointName="tns:CalculatorServiceImplPort" serviceName="tns:CalculatorServiceImplService" address="/CalculatorServiceImplPort"> <jaxws:features> <bean class="org.apache.cxf.feature.LoggingFeature" /> </jaxws:features> </jaxws:endpoint> </beans>

web.xml

任何帮助将不胜感激!我真的想学习如何使用JBoss。谢谢!

1 个答案:

答案 0 :(得分:2)

您的答案就在WildFly为您生成的日志中:

  

提供适当的部署,使用容器模块依赖项替换嵌入式库,或者为当前部署禁用webservices子系统,为其添加适当的jboss-deployment-structure.xml描述符。建议使用前一种方法,因为后一种方法会导致大多数Web服务Java EE和任何JBossWS特定功能被禁用。

意味着您需要提供自己的模块依赖关系,以便WildFly绕过选择自己的Apache CXF版本而不是选择您的版本。

创建自定义模块,module.xmljboss-deployment-structure.xml来完成此操作。

有关如何执行此操作的详细信息,请访问:https://docs.jboss.org/author/display/AS7/Class+Loading+in+AS7