2016-02-03 59 views
0

我想試驗WildFly AS。創造了一個非常簡單的JAX-WS例如端點:WildFly 9.0.2失敗jax-ws簡單的戰爭部署

import javax.jws.WebService; 
import javax.jws.WebMethod; 
import javax.jws.WebParam; 
import javax.ejb.Stateless; 

@WebService(serviceName = "HelloService") 
@Stateless() 
public class HelloService { 

    @WebMethod(operationName = "hello") 
    public String hello(@WebParam(name = "name") String txt) { 
     return "Hello " + txt + " !"; 
    } 
} 

試圖將其部署到服務器,但有:

Cannot upload deployment: {"WFLYCTL0288: One or more services were unable to start due to one or more indirect dependencies not being available." => {"Services that were unable to start:" => ["jboss.deployment.unit.\"SoapTest-1.0-SNAPSHOT.war\".component.HelloService.CREATE","jboss.deployment.unit.\"SoapTest-1.0-SNAPSHOT.war\".component.HelloService.START","jboss.deployment.unit.\"SoapTest-1.0-SNAPSHOT.war\".component.HelloService.VIEW.\"com.mycompany.soaptest.HelloService\".SERVICE_ENDPOINT","jboss.deployment.unit.\"SoapTest-1.0-SNAPSHOT.war\".deploymentCompleteService","jboss.deployment.unit.\"SoapTest-1.0-SNAPSHOT.war\".moduleDeploymentRuntimeInformation","jboss.deployment.unit.\"SoapTest-1.0-SNAPSHOT.war\".moduleDeploymentRuntimeInformationStart","jboss.undertow.deployment.default-server.default-host.\"/SoapTest-1.0-SNAPSHOT\"","jboss.undertow.deployment.default-server.default-host.\"/SoapTest-1.0-SNAPSHOT\".UndertowDeploymentInfoService"],"Services that may be the cause:" => ["jboss.clustering.registry.ejb.default"]}} 

Does WildFly need any special treatment to run such a simple code ? 
I have deployed the same code on WebLogic 12.1.3 (with javaee 6 target) and the deployment run without any issues. Here is my project pom: 

    <modelVersion>4.0.0</modelVersion> 
    <groupId>com.mycompany</groupId> 
    <artifactId>SoapTest</artifactId> 
    <version>1.0-SNAPSHOT</version> 
    <packaging>war</packaging> 

    <name>SoapTest</name> 

    <dependencies> 
     <dependency> 
      <groupId>javax</groupId> 
      <artifactId>javaee-web-api</artifactId> 
      <version>7.0</version> 
      <scope>provided</scope> 
     </dependency> 
    </dependencies> 

    <build> 
     <plugins> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-compiler-plugin</artifactId> 
       <version>2.3.2</version> 
       <configuration> 
        <source>1.7</source> 
        <target>1.7</target> 
       </configuration> 
      </plugin> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-war-plugin</artifactId> 
       <version>2.1.1</version> 
       <configuration> 
        <failOnMissingWebXml>false</failOnMissingWebXml> 
       </configuration> 
      </plugin> 
     </plugins> 
    </build> 

</project> 
+0

我在部署簡單的Rest端點時也有類似的行爲。 –

+0

我把你的代碼,pom.xml,部署到我的野蠻9.0.2服務器(全新安裝)的戰爭,啓動它使用獨立模式,它工作正常。我可以請求部署到http:// localhost:8080/test-1.0/HelloService/HelloService?wsdl的HelloService wsdl。你如何部署你的應用程序?你如何啓動你的野蠻服務器?你能提供更多的日誌嗎?你有沒有修改默認野蠻配置中的東西(例如編輯默認的standalone.xml文件) –

回答

0

雷米Bantos - 感謝您的建議。你指出了我的正確方向。我在啓動服務器時使用:/opt/wildfly/bin/standalone.sh而不是使用服務模式/etc/init.d/wildfly start,其中設置了重要的配置選項。我當時認爲這些失敗可能與這個不尋常的平臺(Debian/ARM - Raspberry Pi 2)有關,但這完全是我的錯誤。在/etc/default/wildfly中設置配置後,服務器啓動並且SOAP和REST示例都部署並正常工作。再次感謝Rémi!

+0

很好。我使用ubuntu上的standalone.sh在我的開發環境中啓動它,它也可以正常工作。 (我編輯standalone.conf來配置選項,如JAVA_HOME,jvm ones,...) –

+0

在我的情況下standalone.sh加載standalone.xml配置,但在服務模式standalone-full.xml被用來代替。這可能造成了區別:) –