ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Farid Izem" <farid.i...@gmail.com>
Subject Re: Question about Classpath
Date Sat, 20 Jan 2007 09:12:34 GMT
Hi julying,

My jdbc driver is in lib directory there is no problem.
My main problem is the simple build.xml script doesn't work at all
To specify the classpath :


<project basedir="/projets/ESE/esepro02" default="mysql">

        <description>
                main project with many futures
        </description>

        <path id="projet.classpath">
            <pathelement location="classes/" />
            <pathelement location="lib/" />
        </path>

        <target name="mysql">
                <classpath refid="projet.classpath" />
                <echo message="Hello World" />
        </target>

</project>
i have still the problem with the classpath tag.

I can't see what i am doing wrong.

Thanks for you help.

Kind Regards,

Farid.

On 1/20/07, julying <njnjut@gmail.com> wrote:
>
>
> make sure your mysql connector is the right version to your driver class!
> and you can use some ant debug tools to print the stracktrace of it's
> procession to make sure
> your lib is in !
> ------------------
> julying
> 2007-01-20
>
> -------------------------------------------------------------
> 发件人:Farid Izem
> 发送日期:2007-01-20 06:39:24
> 收件人:user@ant.apache.org
> 抄送:
> 主题:Question about Classpath
>
> Hi all,
>
> I'm new to ant and i d'like to make a connexion to a mysql database.
> To do that, i hava done the following scripts :
>
>
> <project basedir="/projets/ESE/esepro02" default="mysql">
>
>        <description>
>                main project with many futures
>        </description>
>
>        <path id="projet.classpath">
>            <pathelement location="classes/" />
>            <pathelement location="lib/" />
>        </path>
>
>
>        <target name="mysql">
>                <sql
>                        driver="com.mysql.jdbc.Driver"
>                        url="jdbc:mysql//localhost:3306/BROWSE"
>                        userid="XXXXX"
>                        password="YYYYY"
>                ><![CDATA[
>                        show tables;
>                ]]>
>                </sql>
>        </target>
>
> </project>
>
> But, i get the following error :
>
> mysql:
>
> BUILD FAILED
> /LNXVOL01/projets/ESE/esepro02/build2.xml:19: Class Not Found: JDBC driver
> com.mysql.jdbc.Driver could not be loaded
>
> I try adding <classpath refid="projet.classpath" /> in the mysql task
> without success, i get the following error :
>
> Buildfile: build2.xml
>
> mysql:
>
> BUILD FAILED
> /LNXVOL01/projets/ESE/esepro02/build2.xml:14: Problem: failed to create
> task
> or type classpath
> Cause: The name is undefined.
> Action: Check the spelling.
> Action: Check that any custom tasks/types have been declared.
> Action: Check that any <presetdef>/<macrodef> declarations have taken
> place.
>
> Can anyone help solving this issue with the classpath element.
>
> I'm using ant 1.7.0 and JVM 1.5.0_10-b03
>
>
>
> Kind Regards,
>
> Farid
>
>
>
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message