You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by Alexander Fedorenko <af...@informex.net> on 2003/03/03 09:47:27 UTC

Error using ant task with Torque


Hello.

I discovered strange problem.
The software used is ant-1.5.1, j2sdk1.4.1 .

It does not appear using jsdk 1.3.1 , only 1.4.1 .

When I execute Ant task 'java' , I got error :

populate:
     [java] java.lang.NoClassDefFoundError:
sun/reflect/ConstructorAccessorImpl


Ant task is :

  <target name="populate" description="populare db data ">

     <java classname="module.jate.Setup" fork="false">
       <arg value="${deploy.home}/WEB-INF/classes/Torque.properties"/>
       <classpath>
       <path refid="compile.classpath"/>
            <pathelement location="${deploy.home}/WEB-INF/classes"/>
      </classpath> 
     </java>  
  </target>


and source file is :


package module.jate;

import java.util.*;
import java.sql.*;

import org.apache.torque.Torque;

public class Setup {

    public static void main(String args[]) {

    try {

      if ( args.length == 0 ) {
        System.out.println("No properties file path was specified.");
        return ;
      }

        Torque.init( args[0] );
        Torque.shutdown();

        } catch (Exception e) {
          e.printStackTrace(System.err);
        }
    }
}