You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Jacob Kjome <ho...@visi.com> on 2003/01/02 10:58:56 UTC

task question (odd behavior)

Am I going nuts or does the <available> task only find classes being 
available in java.* or javax.* packages?

I am trying to see if a particular tomcat class is available and the 
<available> task keeps not finding it.  I know it finds the jar because 
I've copied in javax.servlet.ServletConfig into the tomcat-coyote.jar and 
it finds that just fine.  It doesn't seem to be able to find 
org.apache.coyote.tomcat5.CoyoteConnector.  Note that I am using a nightly 
build of Tomcat5, so, yes, that package *does* exist.

Can someone confirm this behavior?  I don't see this quirk mentioned in the 
docs for <available>.


Jake


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: task question (odd behavior) [narrowed the problem!]

Posted by Antoine Levy-Lambert <le...@tiscali-dsl.de>.
I think that you are right that the available task checks that dependent
classes which are called by one class also exist.
You can run ant -debug to check exactly which dependency is missing.
Yours
Antoine


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: task question (odd behavior) [narrowed the problem!]

Posted by Jacob Kjome <ho...@visi.com>.
Ok, I think I narrowed this down.  It makes a little more sense, but I 
still don't fully understand why I'm seeing this behavior....

Given the path:

<path id="coyote.classpath">
       <pathelement location="${tomcat.home}/server/lib/tomcat-coyote.jar"/>
</path>


<available> finds the following class:

<available classname="org.apache.coyote.tomcat5.Constants" 
property="coyote-5-present" classpathref="coyote.classpath"/>


but it doesn't find this (or any other class that I've tested in said package):

<available classname="org.apache.coyote.tomcat5.CoyoteConnector" 
property="coyote-5-present" classpathref="coyote.classpath"/>


What's the deal here?   The only thing I can think of is that the Constants 
class doesn't have any other dependencies.  That is, it doesn't import 
classes outside the jar file that I put in the coyote.classpath whereas the 
others import classes outside said classpath and so, even though the class 
physically exists in the package where I expect it to, the <available> task 
reports that it isn't available because the coyote.classpath doesn't 
contain some of the classes that the CoyoteConnector depends on and, 
therefore, wouldn't really be available if this was the classpath being 
used for compilation or something that would require those dependencies to 
exist.  Is this right?

If so, shouldn't there, maybe, be an ignoreDependencies="true" attribute 
for the case where I really don't require full dependency checking.  I just 
want to know if the class physically exists and that is it.  I have no use 
for it otherwise.

comments?

Jake


At 03:58 AM 1/2/2003 -0600, you wrote:

>Am I going nuts or does the <available> task only find classes being 
>available in java.* or javax.* packages?
>
>I am trying to see if a particular tomcat class is available and the 
><available> task keeps not finding it.  I know it finds the jar because 
>I've copied in javax.servlet.ServletConfig into the tomcat-coyote.jar and 
>it finds that just fine.  It doesn't seem to be able to find 
>org.apache.coyote.tomcat5.CoyoteConnector.  Note that I am using a nightly 
>build of Tomcat5, so, yes, that package *does* exist.
>
>Can someone confirm this behavior?  I don't see this quirk mentioned in 
>the docs for <available>.
>
>
>Jake
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>