title: org.apache.cxf.tools.common.ToolException: Fail to load class
body: <p>Hi I am learning webservices for that I am creating a sample project that generate java from given wsdl(wsdl2Java) and generated code to wsdl(java2ws).
  wsdl2java is working fine but in java2wsdl I am getting exception like below in my ANT file</p>
  
  <pre><code>Buildfile: D:\sarvan\java\webservice\java2wsVSws2java\build.xml
  cxfWSDLToJava:
  [echo] **********Genarating WSDLToJava***********
  cxfJavaToWSDL:
  [echo]  ************Genarating JavaToWSDL************* 
  [java] JavaToWS Error: org.apache.cxf.tools.common.ToolException: Fail  to load class : D:\sarvan\java\webservice\java2wsVSws2java\build    \genClasses/com/saravana/webservice/services/CalServiceService.class
   compile-all:
  [javac] D:\sarvan\java\webservice\java2wsVSws2java\build.xml:54:    warning: 'includeantruntime' was not set, defaulting to     build.sysclasspath=last; set to false for repeatable builds
  [javac] Compiling 9 source files to D:\sarvan\java\webservice \java2wsVSws2java\build\genClasses
  BUILD SUCCESSFUL
  Total time: 5 seconds
  </code></pre>
  
  <p>What is the cause of the issue, Any help please!!
  My ANT:</p>
  
  <pre><code>&lt;target name="cxfJavaToWSDL" depends="cxfWSDLToJava"&gt;
  &lt;echo&gt; ************Genarating JavaToWSDL************* &lt;/echo&gt;
    &lt;java classname="org.apache.cxf.tools.java2ws.JavaToWS" fork="true"&gt;
    &lt;arg value="-wsdl"/&gt;
        &lt;arg value="-classdir"/&gt;
        &lt;arg value="${classes}"/&gt;
       &lt;arg value="-cp"/&gt;
        &lt;arg value="${classes}/**/CalServiceService.class"/&gt;
         &lt;arg value="-o"/&gt;
       &lt;arg value="${lib.dir}/CalServiceService.wsdl"/&gt;
       &lt;arg value="${classes}/com/saravana/webservice/services/CalServiceService.class"/&gt;
       &lt;classpath&gt;
          &lt;path refid="class.path"/&gt;
           &lt;pathelement location="${classes}/**/*.class"/&gt; 
       &lt;/classpath&gt;
    &lt;/java&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>&lt;target name="cxfWSDLToJava" &gt;
    &lt;echo message="**********Genarating WSDLToJava***********"/&gt;    
    &lt;java classname="org.apache.cxf.tools.wsdlto.WSDLToJava" fork="true"&gt;
       &lt;arg value="-client"/&gt;
       &lt;arg value="-d"/&gt;
       &lt;arg value="${genCode.dir}"/&gt;
       &lt;!-- &lt;arg value="-b"/&gt;
       &lt;arg value="./async_binding.xml"/&gt; --&gt;
       &lt;arg value="${lib.dir}/CalService.wsdl"/&gt;
       &lt;classpath&gt;
      &lt;path refid="class.path"/&gt;
       &lt;/classpath&gt;
    &lt;/java&gt;
  &lt;/target&gt;
  &lt;target name="compile-all" depends="cxfJavaToWSDL"&gt;
      &lt;javac debug="on" destdir="${classes}"&gt;
          &lt;src path="${genCode.dir}"/&gt;
          &lt;classpath refid="class.path"/&gt;
      &lt;/javac&gt;
  &lt;/target&gt;
  </code></pre>
  
  <p>and my properties and classpath in ANT</p>
  
  <pre><code>&lt;project name="javawsVSwsTojava" default="compile-all" basedir="."&gt;
  &lt;property name="lib.dir" location="./WebContent/WEB-INF/lib" /&gt;
  &lt;property name="genCode.dir" location="./Java Resources/generatedcode" /&gt;
  &lt;property name="classes" location="./build/genClasses" /&gt;
  &lt;property name="wsdl.location" location="" /&gt;
  &lt;path id="class.path"&gt;
      &lt;fileset dir="${lib.dir}/dependencies"&gt;
          &lt;include name="**/*.jar" /&gt;
      &lt;/fileset&gt;
  &lt;/path&gt;
  </code></pre>