3 Replies Latest reply on Jan 16, 2008 1:30 PM by estahn

    Seam 2.0, Eclipse IDE - Problem creating Webservices

    estahn

      Hi guys,

      I try to create a simple webservice without success. I hope someone can point me to a solution. I created a seam project with Eclipse IDE (JBoss Tools) which work like a charm. I can drag&drop JSF components into pages, deploy them via Eclipse [url=http://in.relation.to/3388.lace][1][/url] and so on.

      The webservice functionality should be tested with the following classes, inspired by the seambay example and this Howto [url=http://www.mail-archive.com/jboss-user@lists.jboss.org/msg58851.html][2][/url//www.mail-archive.com/jboss-user@lists.jboss.org/msg58851.html][2][/url].

      package org.domain.Test.entity;
      
      import javax.jws.WebService;
      
      @WebService
      public interface TestServiceRemote {
       boolean login(String username, String password);
       boolean logout();
      }

      package de.ventasoft.services.Test.entity;
      
      import javax.ejb.Stateless;
      import javax.jws.WebMethod;
      import javax.jws.WebService;
      
      @Stateless
      @WebService(name = "TestService", serviceName = "TestService")
      public class TestService implements TestServiceRemote {
       @WebMethod
       public boolean login(String username, String password) {
       return true;
       }
      
       @WebMethod
       public boolean logout() {
       return true;
       }
      }


      The classes are located in src/model/.... I put the standard-jaxws-endpoint-config.xml in every seam-META-INF directory i could found. The deployment runs without any errors but unfortunately nothings happens. There is also no endpoint registered at http://localhost:8080/jbossws/services.

      Any advice how to do this would be highly appreciated.

      Regards
      Enrico Stahn

      [1] http://in.relation.to/3388.lace
      [2] http://www.mail-archive.com/jboss-user@lists.jboss.org/msg58851.html

        • 1. Re: Seam 2.0, Eclipse IDE - Problem creating Webservices
          tim_ph

          I got it working on 2.0.0.CR1.

          The interface should have @Remote instead of @WebService

          standard-jaxws-endpoint-config.xml should be in your deployed
          proj.ear/proj.jar/META-INF directory.

          That should do it.

          • 2. Re: Seam 2.0, Eclipse IDE - Problem creating Webservices
            estahn

            Thanks, looks like the deployment will try to publish the webservice. Is it possible to do the same with an war file?

            I get the following result with JBoss AS 4.2.2.GA and JBoss Seam 2.0.0.GA:

            org.jboss.deployment.DeploymentInfo@e66bd1cd { url=file:/C:/Users/stahn/Desktop/Downloads/jboss-4.2.2.GA/server/default/deploy/SoapTest4-ear.ear/ }
             deployer: org.jboss.deployment.EARDeployer@1123eb0
             status: Deployment FAILED reason: Could not create deployment: file:/C:/Users/stahn/Desktop/Downloads/jboss-4.2.2.GA/server/default/deploy/SoapTest4-ear.ear/SoapTest4-ejb.jar/; - nested throwable: (java.lang.LinkageError: JAXB 2.0 API is being loaded from the bootstrap classloader, but this RI (from jar:file:/C:/Users/stahn/Desktop/Downloads/jboss-4.2.2.GA/server/default/tmp/deploy/tmp2289jaxb-impl.jar!/com/sun/xml/bind/v2/model/impl/ModelBuilder.class) needs 2.1 API. Use the endorsed directory mechanism to place jaxb-api.jar in the bootstrap classloader. (See http://java.sun.com/j2se/1.5.0/docs/guide/standards/))
             state: FAILED
             watch: file:/C:/Users/stahn/Desktop/Downloads/jboss-4.2.2.GA/server/default/deploy/SoapTest4-ear.ear/META-INF/application.xml
             altDD: null
             lastDeployed: 1200506104074
             lastModified: 1200506085415
             mbeans:
             persistence.units:ear=SoapTest4-ear.ear,jar=SoapTest4-ejb.jar,unitName=SoapTest4 state: Started
             jboss.j2ee:ear=SoapTest4-ear.ear,jar=SoapTest4-ejb.jar,name=TenderNoticeCollectorService,service=EJB3 state: Started


            Any hints on that?

            Regards
            Enrico