2

我试图通过添加一个 jboss-deployment-structure.xml 文件来排除我的 jboss AS 7.1.1 中的webservices子系统,该文件如下所示:

<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
    <deployment>
        <exclude-subsystems>
            <subsystem name="webservices" />
        </exclude-subsystems>
    </deployment>
</jboss-deployment-structure>

在 Eclipse 中,我在上述文件中收到一个错误,将“部署”标记为无效元素。如果我忽略错误并运行我的项目,则会收到以下错误:

19:40:15,531 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.deployment.unit."CXF.war".STRUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit."CXF.war".STRUCTURE: Failed to process phase STRUCTURE of deployment "CXF.war"
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) [rt.jar:1.6.0_45]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [rt.jar:1.6.0_45]
    at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_45]
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: Error loading jboss-structure.xml from C:\jboss-as-7.1.1.Final\jboss-as-7.1.1.Final\standalone\deployments\CXF.war\WEB-INF\jboss-deployment-structure.xml
    at org.jboss.as.server.deployment.module.descriptor.DeploymentStructureDescriptorParser.parse(DeploymentStructureDescriptorParser.java:277) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.as.server.deployment.module.descriptor.DeploymentStructureDescriptorParser.parse(DeploymentStructureDescriptorParser.java:249) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.as.server.deployment.module.descriptor.DeploymentStructureDescriptorParser.deploy(DeploymentStructureDescriptorParser.java:134) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
    ... 5 more
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[2,1]
Message: Unexpected element '{urn:jboss:deployment-structure:1.2}jboss-deployment-structure'
    at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:108)
    at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:69)
    at org.jboss.as.server.deployment.module.descriptor.DeploymentStructureDescriptorParser.parse(DeploymentStructureDescriptorParser.java:271) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
    ... 8 more
4

3 回答 3

6

基于此 URL 的答案: 如何使用 Apache CXF 2.6.7 作为我的战争项目的依赖项,而不是安装在 JBoss 7.1 模块中的 CXF?

请注意,排除子系统功能和部署结构:1.2 已在 7.1.2 中添加,因此不适用于 7.1.1。

我正在使用 JBoss AS 7.1.1,所以这解释了它。

于 2013-10-05T18:00:51.250 回答
1
  • 从下面的错误中我可以看到部署的war文件的结构不正确,所以你可以把它改成正确的格式,然后尝试...

    19:40:15,531 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.deployment.unit."CXF.war".STRUCTURE:     
    
  • 从以下错误 - urn:jboss:deployment-structure:1.2 命名子系统不存在(我认为它可能是 - urn:jboss:domain:deployment-scanner:1.1)并且它还显示“解析器错误”所以检查xml文件还:

    Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[2,1]
    Message: Unexpected element '{urn:jboss:deployment-structure:1.2}jboss-deployment-structure'
    
  • 一个简单的war文件结构供参考如下:

    Demo.war
    |
    |---- META-INF  
    |           |----jboss-deployment-structure.xml
    |           |----MANIFEST.MF
    |          
    |---- WEB-INF 
    |           |---- classes
    |           |   
    |           |---- lib
    |           |      
    |           |---- web.xml
    |
    |---- index.jsp
    
于 2013-10-11T11:15:50.527 回答
0
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee
/web-app_3_0.xsd"
metadata-complete="false">

如果你想从 weblogic 迁移到 JBoss,只需像上面那样更改架构。它会起作用。

于 2014-03-07T12:01:17.337 回答