Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

axis-java2wsdl : java.lang.NoClassDefFoundError : javax/mail/Message

843833Feb 27 2006 — edited Apr 18 2006
Hi
I've got a class named MailSender.java and I want to generate a wsdl file from this class, I use ant and axis-java2wsdl but it keeps on giving this error:
java.lang.NoClassDefFoundError: javax/mail/Message
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:219)
	at org.apache.axis.utils.ClassUtils$2.run(ClassUtils.java:168)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.apache.axis.utils.ClassUtils.loadClass(ClassUtils.java:160)
	at org.apache.axis.utils.ClassUtils.forName(ClassUtils.java:100)
	at org.apache.axis.wsdl.fromJava.Emitter.setCls(Emitter.java:2070)
	at org.apache.axis.tools.ant.wsdl.Java2WsdlAntTask.execute(Java2WsdlAntTask.java:206)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269)
	at org.apache.tools.ant.Task.perform(Task.java:364)
	at org.apache.tools.ant.Target.execute(Target.java:301)
	at org.apache.tools.ant.Target.performTasks(Target.java:328)
	at org.apache.tools.ant.Project.executeTarget(Project.java:1215)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1063)
	at org.apache.tools.ant.Main.runBuild(Main.java:632)
	at org.apache.tools.ant.Main.startAnt(Main.java:183)
	at org.apache.tools.ant.Main.start(Main.java:147)
	at org.apache.tools.ant.Main.main(Main.java:230)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at com.intellij.rt.ant.execution.AntMain2.main(AntMain2.java:13)
My ant file looks like this :
<?xml version="1.0"?>
  <project name="WebServices" default="java2wsdl" basedir="." >
      <description>Web service ant build</description>
      <property file="../build.properties"/>
      
      <path id="deploy.classpath">
          <pathelement location="${build}"/>
       </path>
      
      <path id="axis.classpath">
          <fileset dir="${lib}">
             <include name="**/*.jar"/>
          </fileset>
       </path>
      
       <taskdef resource="axis-tasks.properties" classpathref="axis.classpath"/>


      <target name="clean" >
          <delete dir="${build}"/>
      </target>

      <target name="init">
          <mkdir dir="${build}"/>
      </target>

      <target name="build" depends="init">
          <javac srcdir="${src}"  destdir="${build}" classpathref="axis.classpath"/>
				<copy todir="${build}">
						<fileset dir="${src}" includes="**/*.*"
                excludes="**/*.java,**/*.wsdd,**/*.wsdl,**/*.bpel" />
				</copy>
      </target>


   <target name="java2wsdl-MailSender" depends="build" description="Generates a WSDL description.">
          <axis-java2wsdl
                output="wsdl/mailSender.wsdl"
                location="http://localhost:8080/axis/services/MailSenderService"
                namespace="urn:mailer"
                classname="za.co.mailer.MailSender">
                <classpath refid="deploy.classpath" />
                <mapping namespace="urn:mailer" package="za.co.mailer"/>
          </axis-java2wsdl>
      </target>
  </project>
I've added the mail.jar into the lib folder, what can be wrong?
Thanx in advance
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 16 2006
Added on Feb 27 2006
1 comment
247 views