Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] setting -javaagent:aspectjweaver.jar results inClassCircularityError

On Tue, Jan 12, 2010 at 2:39 AM, Andy Clement <andrew.clement@xxxxxxxxx> wrote:
> Hi,
>
> Sorry I am really quite late coming into this discussion with my responses.
>
>> Note that I have no aspects defined so there is no compilation involved.
>
> What do you hope to see if you exclude everything?   (and why not
> 'exclude within="*"' rather than an include that nothing will match?)
> I thought the problem we were trying to resolve was a
> ClassCircularityError - I'm not quite sure why you have moved to
> having no aspects?  Are you, for now, just trying to get the message
> out about the weaver shutting down due to there being no aspects?

Sort of. I did have aspects but it seemed to me the ClassCircularity
error was not due to any aspect loading. So I removed all the aspects.
To follow Jean-Louis's advice I first excluded some classes. Next I
wanted to try excluding everything. I wasn't sure if exclude
within="*" was the right syntax so I settled on include within="foo.*"
which I knew won't match anything.

>> I still get the same error.
>
> is this the classcircularityerror? or something else?

Yes, class circularity error on org.apache.log4j.LogManager.

>> 4. The VM is not started using java(w).exe on command line. There is a
>> container that starts it using JNI
>
> I really don't know what difference this makes, I have no experience
> setting an agent via any other route than -javaagent...  If it works
> when started 'normally' but fails when launched in this special way,
> then it must be contributing to the issue, but as I mentioned above, I
> thought we were investigating a ClassCircularity problem, are we also
> looking at a problem where the agent sometimes isn't started up?

I don't understand it much either. I don't have much visibility into
how it is all implemented. I just know a few pointcuts that I need to
put around advices on so I can measure how they change from one
development build drop to the next. This used to work with the
previous build, which too had the JNI starting jvm, custom class
loader, etc and I am not able to figure out what changed that this
breaks now.

The ClassCircularity is the error that the JVM reports. I don't know
whether the agent started or not. The INFO output from the agent is
absent. But I do not get the error if I don't specify the javaagent,
nor do I get it if I use a simple do nothing agent. It appears only
when the agent is specified. So there is something in the agent that
triggers the error. What is it I can't figure out.

>> 5. There is a custom classloader.
>
> As I say, as long as it is behaving, it will get a weaver instance
> associated and weaving will occur.
>
>> I am running out of ideas and steam and will be really grateful for
>> any help you can provide. Thank you in advance.
>
> All I can say is there seem to be a lot of factors in the mix here and
> trying to debug them all at once seems a bit tricky.  There are some
> trace options you can turn on for the weaver, documented here:
> http://www.eclipse.org/aspectj/doc/released/pdguide/trace.html . I
> never use them myself but they may tell you if anything is running.

I will try this next. Its already pretty late here so if not today
then tomorrow.

> Why not use compile time weaving just to get something behaving,
> perhaps even fix the ClassCircularity issue via compile time weaving
> rather than attempting to resolve it in ltw.  If you compile time
> weave and run the result it will give you the same behaviour as ltw -
> producing the same CCE which we can then fix without worrying about
> LTW configuration.  Then you can look at getting the LTW config setup
> right...

Hmmm. I have been using ltw since what I want to measure changes from
one run to next, several times in a day. But perhaps ctw (if that is
an acceptable phrase :-) will help me fix the issue so I will give it
a shot.

Thanks again. I will be back tomorrow with new results.


Back to the top