2013-10-05 68 views
2

我試圖排除web服務子系統在我作爲JBoss 7.1.1加入了JBoss的部署,structure.xml文件,如下所示:Exluding JBoss AS中7.1.1 web服務子系統

<?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中,上述文件中出現錯誤,將「deployment」標記爲無效元素。如果我忽略錯誤和運行我的項目,我得到以下錯誤:

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 

回答

1
  • 從下面的錯誤,我可以看到戰爭文件的部署結構是不正確,所以你可以將其更改爲正確的格式,然後嘗試...

    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' 
    
  • 參考一個簡單的戰爭文件的結構如下:

    Demo.war 
    | 
    |---- META-INF 
    |   |----jboss-deployment-structure.xml 
    |   |----MANIFEST.MF 
    |   
    |---- WEB-INF 
    |   |---- classes 
    |   | 
    |   |---- lib 
    |   |  
    |   |---- web.xml 
    | 
    |---- index.jsp 
    
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遷移,只需更改架構如上。 它會工作。

相關問題