ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <>
Subject Re: classloader problem?
Date Wed, 07 May 2008 14:59:51 GMT
Christofer Jennings wrote:
> I think I have a classloader problem.
> I've made a custom task that looks through classes for a method annotation,
> then makes a report. I've got junit tests that work in my IDE showing that
> the annotations can be found. But when I run the task the annotations are
> not recognized. .... That is, the annotation is there. I can read its type.
> But if I ask the method for an annotation matching the class it doesn't
> match. (Yes, the class matches the reported type.: e.g.,
> So I think I have a classloader problem. My task accepts a path to find the
> classes with the annotations. It creates a classloader from the ant project,
> passing in the given path. My theory is that the classes loaded by my task
> are on a different classloader than the MyAnnotation.class and that is why
> they don't match. ... Sound right? .... If so how do I get them on the same
> classloader?

I think that hypothesis sounds right, but don't know where to deal with 
it. Can you load the tags you want to look for in the classloader that 
you are loading the classes in?

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message