You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Rasmus Rasmussen <ra...@infonation.se> on 2000/11/27 16:52:26 UTC

Unexpected element "available"

Hello there,

I'm using task "available" like this

  <available classname="org.whatever.Myclass" property="Myclass.present" />

and get the error

  Unexpected element "available"

I verified that the classfile resides in ant.jar. Other tasks in ant.jar are
obviously accessed successfully. What am i doing wrong?

Re: Unexpected element "available"

Posted by Stefan Bodewig <bo...@apache.org>.
Rasmus Rasmussen <ra...@infonation.se> wrote:

> Thanks! I'll put those <available> tasks in the <init> task then...

Not sure what you are talking about, I vaguely remember something
called <init> in very old versions of Ant.

I'd suggest you upgrade to Ant 1.2 and put it into a <target> all other
targets that need this available task depend on.

Stefan

RE: Unexpected element "available"

Posted by Rasmus Rasmussen <ra...@infonation.se>.
Thanks! I'll put those <available> tasks in the <init> task then...

Q: shouldn't it be possible to have <available> nested inside a <project>
also? I don't see the purpose...


-----Original Message-----
From: Stefan Bodewig [mailto:bodewig@apache.org]
Sent: Monday, November 27, 2000 5:54 PM
To: ant-user@jakarta.apache.org
Subject: Re: Unexpected element "available"


Rasmus Rasmussen <ra...@infonation.se> wrote:

> Hello there,
>
> I'm using task "available" like this
>
>   <available classname="org.whatever.Myclass"
>   property="Myclass.present" />
>
> and get the error
>
>   Unexpected element "available"
>
> I verified that the classfile resides in ant.jar. Other tasks in
> ant.jar are obviously accessed successfully. What am i doing wrong?

Usually Ant would tell you it couldn't find the task definition if it
was a CLASSPATH problem. This looks more like a problem in the
document structure of your XML file, i.e. <available> is probably not
nested inside a <target> (or this one is not nested into a <project>).

The most common error I find in my own buildfiles is that I close tags
by accident, something like

<target name="foo" />
  <available ...>
</target>

could cause an error like the one you've reported (remove the slash in
the start tag of <target>).

Stefan


Re: Unexpected element "available"

Posted by Stefan Bodewig <bo...@apache.org>.
Rasmus Rasmussen <ra...@infonation.se> wrote:

> Hello there,
> 
> I'm using task "available" like this
> 
>   <available classname="org.whatever.Myclass"
>   property="Myclass.present" />
> 
> and get the error
> 
>   Unexpected element "available"
> 
> I verified that the classfile resides in ant.jar. Other tasks in
> ant.jar are obviously accessed successfully. What am i doing wrong?

Usually Ant would tell you it couldn't find the task definition if it
was a CLASSPATH problem. This looks more like a problem in the
document structure of your XML file, i.e. <available> is probably not
nested inside a <target> (or this one is not nested into a <project>).

The most common error I find in my own buildfiles is that I close tags
by accident, something like

<target name="foo" />
  <available ...>
</target>

could cause an error like the one you've reported (remove the slash in
the start tag of <target>).

Stefan