JBoss(Wildfly 10.0)上的Java web应用程序未通过Eclipse部署
我使用TomcatV8.0运行我的Java web应用程序,但我想尝试JBoss。我通过Eclipse添加了Wildfly 10.0(也通过Eclipse下载了运行时) 服务器启动时出现一些错误。我可以访问JBoss(Wildfly 10.0)上的Java web应用程序未通过Eclipse部署,java,eclipse,jboss,cxf,wildfly,Java,Eclipse,Jboss,Cxf,Wildfly,我使用TomcatV8.0运行我的Java web应用程序,但我想尝试JBoss。我通过Eclipse添加了Wildfly 10.0(也通过Eclipse下载了运行时) 服务器启动时出现一些错误。我可以访问http://localhost:8080很好,我将看到Wildfly的起始页。但是,我无法加载我的web应用程序 下面是我得到的错误: 15:57:49,657 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC00
http://localhost:8080
很好,我将看到Wildfly的起始页。但是,我无法加载我的web应用程序
下面是我得到的错误:
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
我看到它说这是由apachecxf引起的,但我不知道如何让JBoss使用我的版本。我知道JBoss自带了自己的ApacheCxf
JAR,但我也不知道如何改变我的beans.xml
和web.xml
来反映这种变化
我在网上找到的所有解决方案都是针对Maven项目的,但我的只是一个简单的动态Web项目
这是我的beans.xml
和web.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>
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
id="WebApp_ID" version="3.1">
<display-name>NpCWS</display-name>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<servlet>
<description>Apache CXF Endpoint</description>
<display-name>cxf</display-name>
<servlet-name>cxf</servlet-name>
<servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>cxf</servlet-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>60</session-timeout>
</session-config>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>WEB-INF/cxf-beans.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
</web-app>
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>
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
id="WebApp_ID" version="3.1">
<display-name>NpCWS</display-name>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<servlet>
<description>Apache CXF Endpoint</description>
<display-name>cxf</display-name>
<servlet-name>cxf</servlet-name>
<servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>cxf</servlet-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>60</session-timeout>
</session-config>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>WEB-INF/cxf-beans.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
</web-app>
任何帮助都将不胜感激!我真的很想学习如何使用JBoss。谢谢大家! 您的答案在WildFly为您生成的日志中: 提供适当的部署,用容器模块依赖项替换嵌入式库,或者为当前部署禁用webservices子系统,并向其添加适当的jboss-deployment-structure.xml描述符。建议使用前一种方法,因为后一种方法会导致大多数Web服务JavaEE和任何特定于JBossWS的功能被禁用 这意味着您需要提供自己的模块依赖项,以便WildFly绕过选择自己版本的
ApacheCxf
,而选择您的版本
创建一个自定义模块、一个module.xml
和一个jboss部署结构.xml
来完成此任务
有关如何执行此操作的更多详细信息,请参见此处:您的答案在WildFly为您生成的日志中: 提供适当的部署,用容器模块依赖项替换嵌入式库,或者为当前部署禁用webservices子系统,并向其添加适当的jboss-deployment-structure.xml描述符。建议使用前一种方法,因为后一种方法会导致大多数Web服务JavaEE和任何特定于JBossWS的功能被禁用 这意味着您需要提供自己的模块依赖项,以便WildFly绕过选择自己版本的
ApacheCxf
,而选择您的版本
创建一个自定义模块、一个module.xml
和一个jboss部署结构.xml
来完成此任务
有关如何执行此操作的更多详细信息,请参见此处:您是否能够解决此@m.o?您是否能够解决此@m.o?非常感谢!我能够部署它。非常感谢!我能够部署它。