3 Replies Latest reply on Oct 12, 2011 4:52 AM by asoldano

    How to create simple WebServices on JBoss AS 7

    andreasriedel

      Hello JBosser.

       

      I've problems with webservices on JBoss AS 7. I'm unable to let the simplest examples run on JBoss 7.

       

      So let me begin. First at all I download the sample from JBoss 'jbossws-native-3.4.1.GA' and build the content by run 'ant test-jars'. This task create the output to %JBOSS_NATIVE_HOME%\output .

       

      Taken the most simple example, jaxws-samples-webmethod.war, copy it to %JBOSS_600_HOME%\server\default\deploy the webservice is deployed and the url

        http://localhost:8080/jaxws-samples-webmethod?wsdl

      is accessable and deliver the expected WSDL.

       

      Taken the same WAR to JBoss 7 in standalone profile calling this url ended up in an error:

       

       

      Microsoft Windows XP [Version 5.1.2600]
      (C) Copyright 1985-2001 Microsoft Corp.
      
      Y:\Dev\srv\jboss-as-7.0.1.Final\bin>standalone.bat
      Calling Y:\Dev\srv\jboss-as-7.0.1.Final\bin\standalone.conf.bat
      ===============================================================================
      
        JBoss Bootstrap Environment
      
        JBOSS_HOME: Y:\Dev\srv\jboss-as-7.0.1.Final
      
        JAVA: Y:\Dev\opt\sdk\j2sdk1.6.0_04\bin\java
      
        JAVA_OPTS: -Dprogram.name=standalone.bat -Xms64M -Xmx512M -XX:MaxPermSize=256M -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Dorg.jboss.resolver.warning=true -Djboss.modules.system.pkgs=org.jboss.byteman -server
      
      ===============================================================================
      
      7.0.1.Final "Zap" started in 24171ms - Started 129 of 186 services (57 services are passive or on-demand)
      07:40:48,825 INFO  [org.jboss.as.server.controller] (DeploymentScanner-threads - 2) Deployed "jaxws-samples-webmethod.war"
      07:41:08,560 INFO  [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/jaxws-samples-webmethod]] (http--127.0.0.1-8080-1) Marking servlet TestService as unavailable
      07:41:08,560 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/jaxws-samples-webmethod].[TestService]] (http--127.0.0.1-8080-1) Allocate exception for servlet TestService: java.lang.ClassCastException: org.jboss.test.ws.jaxws.sampl
      es.webmethod.EndpointImpl cannot be cast to javax.servlet.Servlet
              at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1156) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
              at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:952) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:188) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
              at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:139) [jboss-as-web-7.0.1.Final.jar:7.0.1.Final]
              at org.jboss.as.web.NamingValve.invoke(NamingValve.java:57) [jboss-as-web-7.0.1.Final.jar:7.0.1.Final]
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:154) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:667) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:952) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
              at java.lang.Thread.run(Thread.java:619) [:1.6.0_04]
      

       

             

      Do somebody know whats going wrong or whats to do to build a most simple webservice using Maven.

       

      TIA

       

      Andreas