Hi,
Currently we are facing a very strange problem related to class path.
We have a program which we normally run by using
ant.
To cut long story short , our program runs when we set the classpath using command prompt , and doesn't run when we try to run it through the ant ( which contains the same class path )
Here are the details
Non Working situation..
Our ant file contains following entire
</description>
<import file="prog.xml"/>
<!-- Import the prog properties -->
<property file="${prog.installLocation}/bin/prog.properties"/>
<target name="startPROG" description="Start the PROG">
<startPROG/>
</target>
....
And prog. xml contains following entries
<!-- Define the location of the prog -->
<property name="prog.installLocation" value="F:\ourprog\try"/>
<!-- ClassPath -->
<path id="task.classpath">
<pathelement location="${prog.installLocation}/lib/abc8.0-7.jar" />
<pathelement location="${prog.installLocation}/lib/abc8.0-3.jar" />
<pathelement location="${prog.installLocation}/lib/xyz8.0-227.jar" />
</path>
<echo>prog.installLocation is = "${prog.installLocation}"</echo>
<property name="cp" refid="task.classpath"/>
<echo message="Classpath is ${cp}"/>
<taskdef name="startPROG"
classname="net.xyz.ant_tasks.PROGTask"
classpathref="task.classpath" />
Now the abc8.0-7.jar , xyz8.0-227.jar contains a xml and a property file of same name , say ourprog.properties , ourprogram.xml. Though the name are same the contains are different.
When we try to run our program like , ant startPROG
We get message can not find ourprog.properties.
Now working solution
Open a command prompt
set classpath=F:\ourprog\try\abc8.0-7.jar;F:\ourprog\try\abc8.0-3.jar;F:\ourprog\try\xyz8.0-227.jar;
and then run the same command , ant startPROG
and the program WORKS.
Any idea what is going wrong here , and how can I debug further?