2016-02-03 55 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被用来代替。这可能造成了区别:) –