views:

316

answers:

1

Hey Guys,

here is my build.xml

<?xml version="1.0" standalone="yes"?>

<path id='axis2.classpath'> 
<fileset dir='D:\Tools\axis2-1.5.1-bin\axis2-1.5.1\lib'>
            <include name='**/*.jar' />
        </fileset>  
</path>

<path id='compiled.class.path'>
<fileset dir='./bin/pkg'>
            <include name='*.class' />
        </fileset>  
</path>

<taskdef resource="axis-tasks.properties" classpathref="axis2.classpath" />

<target name="run" >        
    <axis-java2wsdl 
        output="out/TestService.wsdl"
        location="http://localhost:8080/axis2/service/TestService"
        namespace="service"
        classname="TestService">
        <classpath refid="compiled.class.path"/>        
        <mapping namespace="TestService" package="pkg"/>
    </axis-java2wsdl>
</target> 

here is my file structure:

prj->bin->pkg->TestService.class/////////// prj->src->pkg->TestService.java/////////// prj->build.xml

I get java.lang.ClassNotFoundException: TestService.

Can anybody tell me how to fix it? Thanks so much. !!!!!!!!!!!!!

A: 

Is TestService in a package called "pkg", or is it in the default package (i.e., no package)? If it's in a package called "pkg", you want to define your "compiled.class.path" like:

<path id='compiled.class.path'>
   <fileset dir='./bin'>
      <include name='**/*.class' />
   </fileset>  
</path>
Rob Heiser
I tried this way, but the exception is the same :D That classnotfound: TestService. Does axis-java2wsdl task ignore classpath tag? Is that true? Thanks.
Oh, you probably need to do:classname=pkg.TestService
Rob Heiser
you are talking about the classname within <axis-java2wsdl output="out/TestService.wsdl" location="http://localhost:8080/axis2/service/TestService" namespace="service" classname="TestService"> <classpath refid="compiled.class.path"/> <mapping namespace="TestService" package="pkg"/> </axis-java2wsdl>am I right? I tried it. does not work, :D. Thanks though.