You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Ransel Lopez <rl...@timeindustrial.com> on 2004/01/20 19:49:42 UTC

NoClassDefFoundError running axis-wsdl2java as an Ant

Hi everyone,
 
I am trying to execute an Ant Task to get java classes from my service. The problem is that I am having problem with the classpath, because when I execute my task I get java.lang.NoClassDefFoundError: javax.wsdl.Definition. I am following the steps to execute the task as I read in the documentation; my code looks like this:
 
 <target name="axis.init">
   <taskdef resource="axis-tasks.properties">
     <classpath refid="project.lib.classpath"/>
  </taskdef>
 </target>
 
 <target name="wsdl2java" depends="axis.init">
  <axis-wsdl2java 
   output="${project.output}" 
   deployScope="Application"
   verbose="true"
   serverSide="true"
   url="http://myservices/...">
      <mapping
        namespace="http://axis.apache.org/..."
        package="test.temp" />
  </axis-wsdl2java> 
 </target>

The path project.lib.classpath is already defined and include my necessary jar files (wsdl4j.jar is included there)...
 
When I debug my code I can see that my classpath is right and it supposes to include my jar files, but something is happening because at the end my task doesn't find my classes... am I missing something??? any hints??
 
Thank you in advance


Ransel López, Web Services Developer

Time Industrial, Inc.
 An Outsourced Contractor Time and Cost Tracking Service.
 -----------------------------------------------------------------------------------------
tel: 780.413.1521  fax: 780.413.0474
 http://www.TimeIndustrial.com <http://www.timeindustrial.com/>  

 -----------------------------------------------------------------------------------------
 This message and attached files, if any, is (are) intended only for the addressee(s) and may 
 contain privileged or confidential information. Any unauthorized disclosure is strictly prohibited. 
 If destined to our legal counsel, this transmission is privileged communication as between an 
 attorney and its client.
 If you have received this message in error, please notify us immediately so that we may correct 
 our internal records. Please then delete the original message. Thank you.

 
  

 
 

 


Ransel López, Web Services Developer

Time Industrial, Inc.
 An Outsourced Contractor Time and Cost Tracking Service.
 -----------------------------------------------------------------------------------------
tel: 780.413.1521  fax: 780.413.0474
 http://www.TimeIndustrial.com <http://www.timeindustrial.com/>  

 -----------------------------------------------------------------------------------------
 This message and attached files, if any, is (are) intended only for the addressee(s) and may 
 contain privileged or confidential information. Any unauthorized disclosure is strictly prohibited. 
 If destined to our legal counsel, this transmission is privileged communication as between an 
 attorney and its client.
 If you have received this message in error, please notify us immediately so that we may correct 
 our internal records. Please then delete the original message. Thank you.

 
  

 

Re: NoClassDefFoundError running axis-wsdl2java as an Ant

Posted by Steve Loughran <st...@iseran.com>.
Ransel Lopez wrote:
> Hi everyone,
>  
> I am trying to execute an Ant Task to get java classes from my service. 
> The problem is that I am having problem with the classpath, because when 
> I execute my task I get java.lang.NoClassDefFoundError: 
> javax.wsdl.Definition. I am following the steps to execute the task as I 
> read in the documentation; my code looks like this:
>  
>  <target name="axis.init">
>    <taskdef resource="axis-tasks.properties">
>      <classpath refid="*project.lib.classpath*"/>
>   </taskdef>
>  </target>
>  
>  <target name="wsdl2java" depends="axis.init">
>   <axis-wsdl2java
>    output="${project.output}"
>    deployScope="Application"
>    verbose="true"
>    serverSide="true"
>    url="http://myservices/...">
>       <mapping
>         namespace="http://axis.apache.org/..."
>         package="test.temp" />
>   </axis-wsdl2java> 
>  </target>
> The path *project.lib.classpath* is already defined and include my 
> necessary jar files (wsdl4j.jar is included there)...
>  
> When I debug my code I can see that my classpath is right and it 
> supposes to include my jar files, but something is happening because at 
> the end my task doesn't find my classes... am I missing something??? any 
> hints??


hmmm. I am thinking.

First I wondered if having * in the reference name would be a problem, 
and the answer there is 'probably not', which leaves something else.

The something else could be that javax.* classloading is special 
-Java1.4+ has some rules about 'endorsed' directories that define 
special rules about jars containing javax.* packages, rules that are for 
the most part so troublesome I dont see their value.

So:

1. which version of Java?

2. which version of Ant?

you may have found a bug in Ant1.6.0, which has changed its classloader 
behaviour...