Here's my error.

Buildfile: build.xml

error_analysis:

BUILD FAILED
file:C:/cagn/WEB-INF/examples/BatchExample/build.xml:23: 
java.lang.NumberFormatE
xception: ${ea_survivalVar}

I tried adding dependencies, but it didn't help, plus the property is 
currently set in the same target as it is used, it seems it should be 
available.

-Mark


David McTavish wrote:

>I had a problem similar to this. What I had to do was make the secondary
>task a dependency of the first task in order to inherit the property.
>
>ie:
>
><target name="error_analysis" depends="set_attribute">
>   <echo message="${ea_survivalVar}" />
></target>
>
><target name="set_attribute">
>       <property name="ea_survivalVar" value="x" />
></target>
>
>
>d.
>
>-----Original Message-----
>From: Mark R. Diggory [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, September 25, 2002 3:32 PM
>To: [EMAIL PROTECTED]
>Subject: Properties are causing problem in 1.5
>
>
>I didn't get any response from the group so I'm reposting this message:
>
>-Mark
>
>Hello all,
>
>I'm working with nested properties in some custom tasks. The property
>"ea_survivalVar" is supposed to get set and then the the task "beta" is
>supposed to pick up its value. (See below)
>
>These work fine in 1.4.1 but now I get problems when I try to use 1.5.
>
>Now in Ant 1.5 the property "ea_survivalVar" is not available to the
>beta task. Any suggestions would be apprieciated.
>
><target name="error_analysis">
>     <batch iterations="5" name="ea">
>        <property name="ea_survivalVar" value="0.015"/>
>        <beta name="ea_survivalMean" mean="0.98" std="${ea_survivalVar}"/>
>        <antcall target="pva"/>
>     </batch>
></target>
>
>the batch tag is really simple it is just a TaskContainer that performs
>its nested tasks a specific number of times:
>
>
>      public void execute() throws BuildException {
>          if (name != null) {
>              if (iterations <= 0) {
>                  throw new BuildException("You must specify the number
>of iterations ( > 0 )",location);
>              }
>          }
>
>          for(int i = 0 ; i < iterations ; i++){
>              project.setProperty(name, Integer.toString(i));
>              for (Enumeration e = nestedTasks.elements();
>e.hasMoreElements();) {
>                  Task nestedTask = (Task)e.nextElement();
>                  nestedTask.maybeConfigure();
>                  nestedTask.perform();
>              }
>          }
>
>      }
>
>-Mark
>
>
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>  
>





--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to