13 Replies Latest reply on Nov 5, 2006 10:10 AM by Dasari Prasad

    EJB3 WebServices

    Leos Urban Newbie

      Hi,
      I created very simple application (hello.ear) with very simple WebService.

      File application.xml (EAR descriptor):

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" "http://java.sun.com/dtd/application_1_3.dtd">
      <application>
       <display-name>Hello Enterprise Archive</display-name>
       <module>
       <ejb>Hello-SBI.jar</ejb>
       </module>
       <module>
       <ejb>Hello-SBS.jar</ejb>
       </module>
      </application>
      


      Interface file HelloRemote.java:
      package cz.qds.hello.sbi;
      import java.rmi.Remote;
      import javax.jws.WebMethod;
      import javax.jws.WebService;
      @WebService()
      //@SOAPBinding(style=Style.RPC)
      public interface HelloRemote extends Remote
      {
       @WebMethod()
       public String sayHello();
      }
      
      


      Note: there is one difference from Tutorial - I cannot compile it when @SOAPBinding(style=Style.RPC) is in code. Reason of this error ( "org/jboss/lang/Annotation.class not found" ) is in jbossws14.jar which contains SOAPBinding class (my mean).
      My compile time libraries are jboss-annotation-ejb3.jar, jboss-ejb3x.jar, jboss-ejb3.jar, ejb3-persistence.jar, hibernate3.jar, hibernate-entitymanager.jar and hibernate-annotations.jar

      Bean file HelloBean:
      package cz.qds.hello.sbs;
      import cz.qds.hello.sbi.*;
      import javax.ejb.*;
      import javax.jws.WebService;
      import javax.persistence.*;
      @Stateless
      @WebService(endpointInterface="cz.qds.hello.sbi.HelloRemote")
      public class HelloBean
      {
       public String sayHello()
       {
       return "Hello!" ;
       }
      }
      


      Fine. Compile succeed. Deploy succeed.

      When I test it with "http://localhost:8080/Hello.ear/HelloBean?wsdl" then I obtain error 404 with "The requested resource (/Hello.ear/HelloBean) is not available.".

      JBOSS 4.0.4.GA with EJB3 RC7 installed.

      Where is problem?
      Does someone successfully use Jboss EJB3 WebServices?

      Thank you very much,
      Leos

        • 1. Re: EJB3 WebServices
          Leos Urban Newbie

          One comment:
          I tested it with "http://localhost:8080/Hello/HelloBean?wsdl" because my ear name is "Hello.ear".
          Result (=Error) is the same.

          Leos

          • 2. Re: EJB3 WebServices
            Leos Urban Newbie

            When I tried to compile the webservice task from the tutorial I got the same error.

             [javac] /usr/java/jboss-EJB-3.0_RC7-FD/docs/tutorial/webservice/src/org/jboss/tutorial/webservice/bean/Calculator.java:31: incompatible types
             [javac] found : javax.jws.WebService
             [javac] required: java.lang.annotation.Annotation
             [javac] @WebService
             [javac] ^
             [javac] /usr/java/jboss-EJB-3.0_RC7-FD/docs/tutorial/webservice/src/org/jboss/tutorial/webservice/bean/Calculator.java:32: incompatible types
            


            What is current state of webservices support in JBOSS EJB3 ??

            Leonell

            • 3. Re: EJB3 WebServices
              Leos Urban Newbie

              Nobody did test @WebService ???

              • 4. Re: EJB3 WebServices
                Novice

                How hard can it be to figure out which jar file is missing on your classpath?

                • 5. Re: EJB3 WebServices
                  Doug Palmer Newbie

                  Uncomment @SOAPBinding

                  Set your classpath to contain the jars from jboss/server/default/lib; jboss/server/default/deploy/ejb3.deployer; jboss/server/default/deploy/jbossws.sar

                  Compile, build and deploy your jar. Then check http://localhost:8080/jbossws/services. You will see a list of all of your deployed jbossws services with links to their wsdl files.

                  Regards
                  Doug

                  • 6. Re: EJB3 WebServices
                    matt kanninen Newbie

                    The fix is to include every jar from
                    jboss/server/default/lib; and
                    jboss/server/default/deploy/ejb3.deployer in the classpath?

                    That seems like overkill to compile a helloworld.

                    • 7. Re: EJB3 WebServices
                      Leos Urban Newbie

                      I tried every jars from "all" because I have installed EJB3 into "all" (and not "default").
                      And result ( demo based on distribution example) with jboss 404 GA + EJB3RC8:

                       [javac] Compiling 1 source file to /home/lur/JavaProjects/Qds/JbossWS-EJB3Demo-SBI/build/classes
                       [javac] /home/lur/JavaProjects/Qds/JbossWS-EJB3Demo-SBI/src/cz/qds/wsdemo/sbi/ExampleRemote.java:10: incompatible types
                       [javac] found : javax.jws.WebService
                       [javac] required: java.lang.annotation.Annotation
                       [javac] @WebService
                       [javac] ^
                       [javac] /home/lur/JavaProjects/Qds/JbossWS-EJB3Demo-SBI/src/cz/qds/wsdemo/sbi/ExampleRemote.java:11: incompatible types
                       [javac] found : javax.jws.soap.SOAPBinding
                       [javac] required: java.lang.annotation.Annotation
                       [javac] @SOAPBinding(style=Style.RPC)
                       [javac] ^
                       [javac] /home/lur/JavaProjects/Qds/JbossWS-EJB3Demo-SBI/src/cz/qds/wsdemo/sbi/ExampleRemote.java:11: duplicate annotation
                       [javac] @SOAPBinding(style=Style.RPC)
                       [javac] ^
                       [javac] /home/lur/JavaProjects/Qds/JbossWS-EJB3Demo-SBI/src/cz/qds/wsdemo/sbi/ExampleRemote.java:14: incompatible types
                       [javac] found : javax.jws.WebMethod
                       [javac] required: java.lang.annotation.Annotation
                       [javac] @WebMethod int add(int x, int y);
                       [javac] ^
                       [javac] /home/lur/JavaProjects/Qds/JbossWS-EJB3Demo-SBI/src/cz/qds/wsdemo/sbi/ExampleRemote.java:15: incompatible types
                       [javac] found : javax.jws.WebMethod
                       [javac] required: java.lang.annotation.Annotation
                       [javac] @WebMethod int subtract(int x, int y);
                       [javac] ^
                       [javac] 5 errors
                      
                      BUILD FAILED
                      /home/lur/JavaProjects/Qds/JbossWS-EJB3Demo-SBI/nbproject/build-impl.xml:240: The following error occurred while executing this line:
                      /home/lur/JavaProjects/Qds/JbossWS-EJB3Demo-SBI/nbproject/build-impl.xml:123: Compile failed; see the compiler error output for details.
                      
                      Total time: 2 seconds
                      
                      


                      Leonell

                      • 8. Re: EJB3 WebServices
                        Doug Palmer Newbie

                        I've just noticed 2 errors in your code.

                        Firstly, you don't need the () after the @WebService and @WebMethod annotations.

                        Secondly, you don't need to import classes from a package that you are a member of. So you need to remove the extra import statement from HelloBean.

                        Regards
                        Doug

                        • 9. Re: EJB3 WebServices
                          Leos Urban Newbie

                          Hello Doug,
                          ANT output is from (other) example:

                          package cz.qds.wsdemo.sbi;
                          
                          import javax.jws.WebService;
                          import javax.jws.WebMethod;
                          import java.rmi.Remote;
                          import java.rmi.RemoteException;
                          import javax.jws.soap.SOAPBinding;
                          import javax.jws.soap.SOAPBinding.Style;
                          
                          @WebService
                          @SOAPBinding(style=Style.RPC)
                          public interface ExampleRemote extends Remote
                          {
                           @WebMethod int add(int x, int y);
                           @WebMethod int subtract(int x, int y);
                          }
                          


                          Thanks,
                          Leonell

                          • 10. Re: EJB3 WebServices
                            Doug Palmer Newbie

                            Can you post your ant script too? It still looks like you are missing some jars. Did you include the jars from server/all/deploy/jbossws.sar and server/all/deploy/ejb3.deployer?

                            Regards
                            Doug

                            • 11. Re: EJB3 WebServices
                              Leos Urban Newbie

                              Yes. But this is Netbeans project, parameters for script are readed from project.properties file:
                              File: project.properties:

                              application.args=
                              build.classes.dir=${build.dir}/classes
                              build.classes.excludes=**/*.java,**/*.form
                              # This directory is removed when the project is cleaned:
                              build.dir=build
                              build.generated.dir=${build.dir}/generated
                              # Only compile against the classpath explicitly listed here:
                              build.sysclasspath=ignore
                              build.test.classes.dir=${build.dir}/test/classes
                              build.test.results.dir=${build.dir}/test/results
                              debug.classpath=\
                               ${run.classpath}
                              debug.test.classpath=\
                               ${run.test.classpath}
                              # This directory is removed when the project is cleaned:
                              dist.dir=dist
                              dist.jar=${dist.dir}/JbossWS-EJB3Demo-SBI.jar
                              dist.javadoc.dir=${dist.dir}/javadoc
                              file.reference.activation.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/activation.jar
                              file.reference.antlr-2.7.6.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/antlr-2.7.6.jar
                              file.reference.autonumber-plugin.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/autonumber-plugin.jar
                              file.reference.avalon-framework.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/avalon-framework.jar
                              file.reference.bcel.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/bcel.jar
                              file.reference.bindingservice-plugin.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/bindingservice-plugin.jar
                              file.reference.bsf.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/bsf.jar
                              file.reference.bsh-1.3.0.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/bsh-1.3.0.jar
                              file.reference.bsh-deployer.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/bsh-deployer.jar
                              file.reference.cglib.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/cglib.jar
                              file.reference.commons-collections.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/commons-collections.jar
                              file.reference.commons-httpclient.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/commons-httpclient.jar
                              file.reference.commons-logging.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/commons-logging.jar
                              file.reference.ejb3-persistence.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/ejb3-persistence.jar
                              file.reference.hibernate-annotations.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/hibernate-annotations.jar
                              file.reference.hibernate-entitymanager.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/hibernate-entitymanager.jar
                              file.reference.hibernate3.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/hibernate3.jar
                              file.reference.hsqldb-plugin.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/hsqldb-plugin.jar
                              file.reference.hsqldb.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/hsqldb.jar
                              file.reference.jacorb.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/jacorb.jar
                              file.reference.javassist.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/javassist.jar
                              file.reference.javax.servlet.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/javax.servlet.jar
                              file.reference.javax.servlet.jsp.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/javax.servlet.jsp.jar
                              file.reference.jboss-annotations-ejb3.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/deploy/ejb3.deployer/jboss-annotations-ejb3.jar
                              file.reference.jboss-backport-concurrent.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/jboss-backport-concurrent.jar
                              file.reference.jboss-cache.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/jboss-cache.jar
                              file.reference.jboss-common-jdbc-wrapper.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/jboss-common-jdbc-wrapper.jar
                              file.reference.jboss-ejb3.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/deploy/ejb3.deployer/jboss-ejb3.jar
                              file.reference.jboss-ejb3x.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/deploy/ejb3.deployer/jboss-ejb3x.jar
                              file.reference.jboss-hibernate.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/jboss-hibernate.jar
                              file.reference.jboss-iiop.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/jboss-iiop.jar
                              file.reference.jboss-j2ee.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/jboss-j2ee.jar
                              file.reference.jboss-jaxrpc.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/jboss-jaxrpc.jar
                              file.reference.jboss-jca.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/jboss-jca.jar
                              file.reference.jboss-jsr77.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/jboss-jsr77.jar
                              file.reference.jboss-jsr88.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/jboss-jsr88.jar
                              file.reference.jboss-management.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/jboss-management.jar
                              file.reference.jboss-monitoring.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/jboss-monitoring.jar
                              file.reference.jboss-remoting-int.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/jboss-remoting-int.jar
                              file.reference.jboss-remoting.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/jboss-remoting.jar
                              file.reference.jboss-saaj.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/jboss-saaj.jar
                              file.reference.jboss-serialization.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/jboss-serialization.jar
                              file.reference.jboss-srp.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/jboss-srp.jar
                              file.reference.jboss-transaction.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/jboss-transaction.jar
                              file.reference.jboss.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/jboss.jar
                              file.reference.jbossha.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/jbossha.jar
                              file.reference.jbossmq.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/jbossmq.jar
                              file.reference.jbossretro-rt.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/jbossretro-rt.jar
                              file.reference.jbosssx.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/jbosssx.jar
                              file.reference.jbossws14.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/deploy/jbossws14.sar/jbossws14.jar
                              file.reference.jgroups.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/jgroups.jar
                              file.reference.jmx-adaptor-plugin.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/jmx-adaptor-plugin.jar
                              file.reference.jnpserver.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/jnpserver.jar
                              file.reference.jpl-pattern.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/jpl-pattern.jar
                              file.reference.jpl-util.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/jpl-util.jar
                              file.reference.jstl.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/jstl.jar
                              file.reference.log4j.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/log4j.jar
                              file.reference.mail-plugin.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/mail-plugin.jar
                              file.reference.mail.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/mail.jar
                              file.reference.mysql-connector-java-3.1.6-bin.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/mysql-connector-java-3.1.6-bin.jar
                              file.reference.pg74.215.jdbc2ee.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/pg74.215.jdbc2ee.jar
                              file.reference.properties-plugin.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/properties-plugin.jar
                              file.reference.quartz-all-1.5.2.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/quartz-all-1.5.2.jar
                              file.reference.scheduler-plugin-example.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/scheduler-plugin-example.jar
                              file.reference.scheduler-plugin.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/scheduler-plugin.jar
                              file.reference.snmp-support.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/snmp-support.jar
                              file.reference.standard.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/standard.jar
                              file.reference.wsdl4j.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/deploy/jbossws14.sar/wsdl4j.jar
                              file.reference.wsdl4j.jar-1=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/wsdl4j.jar
                              file.reference.xmlentitymgr.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/lib/xmlentitymgr.jar
                              file.reference.xmlsec.jar=../../../../../var/jboss-4.0.4.GA-ejb3rc8fd/server/all/deploy/jbossws14.sar/xmlsec.jar
                              jar.compress=false
                              javac.classpath=\
                               ${file.reference.jbossws14.jar}:\
                               ${file.reference.wsdl4j.jar}:\
                               ${file.reference.xmlsec.jar}:\
                               ${file.reference.jboss-annotations-ejb3.jar}:\
                               ${file.reference.jboss-ejb3.jar}:\
                               ${file.reference.jboss-ejb3x.jar}:\
                               ${file.reference.activation.jar}:\
                               ${file.reference.antlr-2.7.6.jar}:\
                               ${file.reference.autonumber-plugin.jar}:\
                               ${file.reference.avalon-framework.jar}:\
                               ${file.reference.bcel.jar}:\
                               ${file.reference.bindingservice-plugin.jar}:\
                               ${file.reference.bsf.jar}:\
                               ${file.reference.bsh-1.3.0.jar}:\
                               ${file.reference.bsh-deployer.jar}:\
                               ${file.reference.cglib.jar}:\
                               ${file.reference.commons-collections.jar}:\
                               ${file.reference.commons-httpclient.jar}:\
                               ${file.reference.commons-logging.jar}:\
                               ${file.reference.ejb3-persistence.jar}:\
                               ${file.reference.hibernate-annotations.jar}:\
                               ${file.reference.hibernate-entitymanager.jar}:\
                               ${file.reference.hibernate3.jar}:\
                               ${file.reference.hsqldb-plugin.jar}:\
                               ${file.reference.hsqldb.jar}:\
                               ${file.reference.jacorb.jar}:\
                               ${file.reference.javassist.jar}:\
                               ${file.reference.javax.servlet.jar}:\
                               ${file.reference.javax.servlet.jsp.jar}:\
                               ${file.reference.jboss-backport-concurrent.jar}:\
                               ${file.reference.jboss-cache.jar}:\
                               ${file.reference.jboss-common-jdbc-wrapper.jar}:\
                               ${file.reference.jboss-hibernate.jar}:\
                               ${file.reference.jboss-iiop.jar}:\
                               ${file.reference.jboss-j2ee.jar}:\
                               ${file.reference.jboss-jaxrpc.jar}:\
                               ${file.reference.jboss-jca.jar}:\
                               ${file.reference.jboss-jsr77.jar}:\
                               ${file.reference.jboss-jsr88.jar}:\
                               ${file.reference.jboss-management.jar}:\
                               ${file.reference.jboss-monitoring.jar}:\
                               ${file.reference.jboss-remoting-int.jar}:\
                               ${file.reference.jboss-remoting.jar}:\
                               ${file.reference.jboss-saaj.jar}:\
                               ${file.reference.jboss-serialization.jar}:\
                               ${file.reference.jboss-srp.jar}:\
                               ${file.reference.jboss-transaction.jar}:\
                               ${file.reference.jboss.jar}:\
                               ${file.reference.jbossha.jar}:\
                               ${file.reference.jbossmq.jar}:\
                               ${file.reference.jbossretro-rt.jar}:\
                               ${file.reference.jbosssx.jar}:\
                               ${file.reference.jgroups.jar}:\
                               ${file.reference.jmx-adaptor-plugin.jar}:\
                               ${file.reference.jnpserver.jar}:\
                               ${file.reference.jpl-pattern.jar}:\
                               ${file.reference.jpl-util.jar}:\
                               ${file.reference.jstl.jar}:\
                               ${file.reference.log4j.jar}:\
                               ${file.reference.mail-plugin.jar}:\
                               ${file.reference.mail.jar}:\
                               ${file.reference.mysql-connector-java-3.1.6-bin.jar}:\
                               ${file.reference.pg74.215.jdbc2ee.jar}:\
                               ${file.reference.properties-plugin.jar}:\
                               ${file.reference.quartz-all-1.5.2.jar}:\
                               ${file.reference.scheduler-plugin-example.jar}:\
                               ${file.reference.scheduler-plugin.jar}:\
                               ${file.reference.snmp-support.jar}:\
                               ${file.reference.standard.jar}:\
                               ${file.reference.wsdl4j.jar-1}:\
                               ${file.reference.xmlentitymgr.jar}
                              # Space-separated list of extra javac options
                              javac.compilerargs=
                              javac.deprecation=false
                              javac.source=1.5
                              javac.target=1.5
                              javac.test.classpath=\
                               ${javac.classpath}:\
                               ${build.classes.dir}:\
                               ${libs.junit.classpath}
                              javadoc.additionalparam=
                              javadoc.author=false
                              javadoc.encoding=
                              javadoc.noindex=false
                              javadoc.nonavbar=false
                              javadoc.notree=false
                              javadoc.private=false
                              javadoc.splitindex=true
                              javadoc.use=true
                              javadoc.version=false
                              javadoc.windowtitle=
                              meta.inf.dir=${src.dir}/META-INF
                              platform.active=default_platform
                              run.classpath=\
                               ${javac.classpath}:\
                               ${build.classes.dir}
                              # Space-separated list of JVM arguments used when running the project
                              # (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
                              # or test-sys-prop.name=value to set system properties for unit tests):
                              run.jvmargs=
                              run.test.classpath=\
                               ${javac.test.classpath}:\
                               ${build.test.classes.dir}
                              src.dir=src
                              


                              I can send here build.xml and build-impl.xml but they are big and does not contain specification of JAR files.

                              Thanks,
                              Leonell

                              • 12. Re: EJB3 WebServices
                                Doug Palmer Newbie

                                Your project.properties contains references to the necessary jars but javac.classpath does not contain an entry for them. So they aren't being used at compile time. You need to add them to the javac classpath.

                                Regards
                                Doug

                                • 13. Re: EJB3 WebServices
                                  Dasari Prasad Newbie

                                  I had tested one webservice example in jboss4.0.5GA & ejb3(version RC9, i suppose) the following are files

                                  SimpleWS.java

                                  package com.htc.htcws;
                                  import javax.ejb.Remote;
                                  @Remote
                                  public interface SimpleWS extends java.rmi.Remote
                                  {
                                  public String greet(String person)
                                  throws java.rmi.RemoteException;
                                  }

                                  SimpleWSBean.java

                                  package com.htc.htcws;

                                  import javax.jws.WebService;
                                  import javax.jws.WebMethod;
                                  import javax.ejb.Remote;
                                  import javax.ejb.Stateless;
                                  import javax.jws.soap.SOAPBinding;
                                  import javax.jws.soap.SOAPBinding.Style;
                                  import org.jboss.annotation.ejb.RemoteBinding;

                                  @Stateless
                                  @WebService(name="EndpointInterface",
                                  targetNamespace="http://htcws.htc.com/jaws",
                                  serviceName="SimpleWSService")
                                  @RemoteBinding(jndiBinding="/ejb3/EJB3EndpointInterface") @Remote(com.htc.htcws.SimpleWS.class)
                                  @SOAPBinding(style=SOAPBinding.Style.RPC)

                                  public class SimpleWSBean implements SimpleWS
                                  {
                                  @WebMethod
                                  public String greet(String person)
                                  {
                                  return "Hi "+person+" all Good Wishes for Diwali";
                                  }

                                  }

                                  the build.xml

                                  <?xml version="1.0" ?>




































































                                  first i ran
                                  from my directory >ant

                                  then started server

                                  d:\jbossejb3\bin>run -c all

                                  then tested the client

                                  SimpleWSClient.java

                                  package com.htc.htcws;

                                  import javax.xml.rpc.ServiceFactory;
                                  import javax.xml.rpc.Service;
                                  import javax.xml.namespace.QName;
                                  import java.net.URL;

                                  public class SimpleWSClient
                                  {


                                  public static void main(String[] args)
                                  {
                                  final String _NAMESPACE = "http://htcws.htc.com/jaws";
                                  final String _SERVICE = "SimpleWSService";


                                  try
                                  {
                                  URL url =
                                  new URL("http://localhost:8080/simpws/SimpleWSBean?wsdl");

                                  QName qName = new QName(_NAMESPACE,_SERVICE);
                                  if(args.length!=1)

                                  {
                                  System.out.print("Give the person-name as args[0]");
                                  System.exit(1);
                                  }



                                  ServiceFactory sFactory = ServiceFactory.newInstance();

                                  Service service = sFactory.createService(url,qName);

                                  SimpleWS invoker =
                                  (SimpleWS)service.getPort(SimpleWS.class);

                                  String res = invoker.greet(args[0]);
                                  System.out.println("Response is :"+res);
                                  }
                                  catch(Exception ex)
                                  {
                                  System.err.println("Caught the exception as"+ex);
                                  }
                                  }

                                  }

                                  > ant java

                                  it is working fine (except a warning that log4j not configured)

                                  just made a beginning may be helpful to you

                                  all good luck
                                  Prasad DTR
                                  rajendra32@yahoo.co.uk