title: calling WS from ant
body: <p>I have written a java WS and hosted it </p>
  
  <pre><code>@WebService
  public class DBConnectionCheck{
  
      @WebMethod
      public synchronized boolean dbServerState(final String SERVERNAME,final String USER_ID,final String USER_PASSWORD
              ,final String VENDOR,final String PORT,final String CONNECTOR_TYPE)
      {
               .............}
      @WebMethod
           @WebMethod
      public synchronized boolean oracleDBState(......)
           {
  ..............
            }
  </code></pre>
  
  <p>I had generated the stubs and wrote the client also....</p>
  
  <pre><code>      public class CheckRegressionStatus {
  
  
  
  public static void main(String args[]) throws PreRequisticException
  {
  
      Properties resourceMangerProps = new Properties();
  
      /**
       * Instantiate the generated Service
       */
      com.cordys.autopilot.InfraStructure.servercheck.stub.ReadInfraResourceAvaliabiltyService service1 = new com.cordys.autopilot.InfraStructure.servercheck.stub.ReadInfraResourceAvaliabiltyService();
  
      com.cordys.autopilot.InfraStructure.servercheck.stub.ReadInfraResourceAvaliabilty res = service1.getReadInfraResourceAvaliabiltyPort();
  
      /**
       * Instantiate the generated Service
       */
      com.cordys.autopilot.InfraStructure.dbstate.stub.DBConnectionCheckService                              service = new com.cordys.autopilot.InfraStructure.dbstate.stub.DBConnectionCheckService();
  
  
      com.cordys.autopilot.InfraStructure.dbstate.stub.DBConnectionCheck dbConnectionCheckProxy = service.getDBConnectionCheckPort();
  </code></pre>
  
  <p>This works perfect when called from Eclipse or Netbeans </p>
  
  <p>But when I wrote an ant code to invoke it </p>
  
  <pre><code>&lt;java classname="....InfraStructure.CheckRegressionStatus"&gt;                 
                      &lt;classpath&gt;
                          &lt;pathelement path="XYZ.jar"/&gt;          
                      &lt;/classpath&gt;
  &lt;/java&gt;
  </code></pre>
  
  <p>It is throwing the following error</p>
  
  <pre><code>  [java] javax.xml.ws.WebServiceException: Provider com.sun.xml.internal.ws.spi.ProviderImpl not f
    [java]     at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:194)
    [java]     at org.apache.tools.ant.taskdefs.Java.run(Java.java:747)
    [java]     at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:201)
    [java]     at org.apache.tools.ant.taskdefs.Java.execute(Java.java:104)
    [java]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
    [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [java]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
    [java]     at java.lang.reflect.Method.invoke(Method.java:597)
    [java]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
    [java]     at org.apache.tools.ant.Task.perform(Task.java:348)
    [java]     at org.apache.tools.ant.Target.execute(Target.java:357)
    [java]     at org.apache.tools.ant.Target.performTasks(Target.java:385)
    [java]     at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
    [java]     at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
    [java]     at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41
    [java]     at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
    [java]     at org.apache.tools.ant.Main.runBuild(Main.java:698)
    [java]     at org.apache.tools.ant.Main.startAnt(Main.java:199)
    [java]     at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
    [java]     at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
    [java] Caused by: javax.xml.ws.WebServiceException: Provider com.sun.xml.internal.ws.spi.Provide
    [java]     at javax.xml.ws.spi.FactoryFinder.newInstance(FactoryFinder.java:33)
    [java]     at javax.xml.ws.spi.FactoryFinder.find(FactoryFinder.java:128)
    [java]     at javax.xml.ws.spi.Provider.provider(Provider.java:83)
    [java]     at javax.xml.ws.Service.&lt;init&gt;(Service.java:56)
  </code></pre>