You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Andy Redhead <an...@openinternetsolutions.com> on 2004/01/13 18:24:56 UTC

Classpath issues when calling ejb services

Hi,

 

I'm trying to build an ant task for ant 1.6 that uses a service provided by
an ejb.

 

The problem is that when I run the task, I get an error message saying that
the class I specified for "java.naming.factory.initial" cannot be found.  

 

I am trying to specify the classpath using a classpath ref, I am quite
certain that the referenced classpath accurately finds the class because the
"available" target can find it and if I print the value of my classpath
variable from within my task class, it includes the jar file.

 

If I move the jar containing the class into the ant lib directory, this
problem goes away but the next error is that the task can't find another
class that is in the classpath - I don't want to move all my classes into
the lib directory (which would rather defeat the use of a classpath at all).


 

I suspect that the problem is really my lack of understanding around how ant
loads classes for tasks, is there something I need to do within my task
class to make whatever classloader ant is using take some notice of the
classpath in my task?

 

Thanks for any suggestions

 

Andy