Hi,
On Fri, 29 Mar 2002 21:31, Paul Hammant wrote:
> OK then only problems is one that I have known about for a while :
>
> <altrmiproxies genname="AvalonDB" srcgendir="build/genjava"
> interfaces="org.apache.avalon.db.services.DatabaseManager"
> classgendir="build/genclasses">
> <classpath>
> <pathelement location="lib/commons-altrmi-client-interfaces.jar"/>
> <pathelement location="lib/commons-altrmi-client-impl.jar"/>
> <pathelement location="lib/commons-altrmi-common.jar"/>
> <pathelement location="lib/commons-altrmi-generator.jar"/>
> <pathelement path="${build.classes}"/>
> </classpath>
> </altrmiproxies>
>
> Fails because if cannot see the classes put in ${build.classes}by a
> previous build step. If you run it a second time it works - though that
> is not a solution.
>
> My question to you (as an Ant expert) is : How do I make an ant task
> that can process class files build in a depended on compile stage. I
> could have an attribute called interfacesdir (
> interfacesdir="${build.classes}" ) and that would work, but would it be
> the right way?
Okay, the problem is that the <altrmiproxies/> task is broken. If you look at
about line 231 you will see a Class.forName() on one of the interfaces that
you are trying to AltRmic. The problem is that this will try to load the
class from the same classloader that the task was loaded in. And of course
this classloader will not contain the classes because they were not present
when the task was defined.
What I would recomend you doing would be either to do one of the following;
1. create a new AntClassLoader from the classpath data and use that to load
classes rather than Class.forName
2. Dont ever load classes for interfaces and remove all traces of Class
objects and ClassLoader objects from the task and from ProxyGeneratorImpl
I would recomend (2) but either way is good.
--
Cheers,
Pete
------------------------------------------
I just hate 'yes' men, don't you Smithers?
------------------------------------------
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>