Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] Exception in thread "main"java.lang.NoClassDefFoundError

Hi Andy,

Okay, so I reverted back to double-dots. The doc was not very clear,
which is why I tried single-dots. But still, I get the same error:

Exception in thread "main" java.lang.NoClassDefFoundError
	at $AllProbeAspect.aspectOf(Unknown Source)
	at
com.verisign.common.properties.PropertyManager.getInstance(PropertyManag
er.java:81)
	at com.verisign.jtaps.test.Test.calc(Test.java:19)
	at com.verisign.jtaps.test.Test.main(Test.java:29)

Notice that there is no class name specified; when I trap all exceptions
in the debugger, what I see is a null error message, and the causation
member self-references the lexically enclosing exception instance, as if
somewhere someone did something evil like:

  NoClassDefFoundError error = new NoClassDefFoundError();
  error.initCause(error);
  throw error;

The information I Google'd did not turn up any hints that worked.

What sort of approach might I use to dianose and resolve this issue? 

Thanks in advance,

Bob

-----Original Message-----
From: aspectj-users-bounces@xxxxxxxxxxx
[mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Andy Clement
Sent: Monday, June 30, 2008 5:14 PM
To: aspectj-users@xxxxxxxxxxx
Subject: Re: [aspectj-users] Exception in thread
"main"java.lang.NoClassDefFoundError

In AspectJ syntax, the expression

pkg.*

means any type in package 'pkg'.  If your type is in pkg.subpkg then it
will not match that expression.  Two dots are needed to include types in
the package or any sub-package.

pkg..*

Going by the aop.xml in your previous email, you are using
org.apache.log4j.*  and that doesn't match
org.apache.log4j.spi.RootLogger, so it is not excluded from the weaving
process.

The doc is here:
http://www.eclipse.org/aspectj/doc/released/devguide/ltw-configuration.h
tml
but i'll say that if you aren't familiar with the double dot notation,
it isn't explicitly indicated there as what you need to use, and the
example on that page is a bit unclear.  we could do with improving that
doc.

cheers,
Andy.

2008/6/30 Buck, Robert <rbuck@xxxxxxxxxxxx>:
> Hello,
>
> I have been grappling with an issue for a couple weeks now. No 
> information in the documentation, on the web via google, seems to 
> point me in the right direction. I looked through the aspectj 
> database, and nothing there to help either.
>
> I put together a simple hello world application to diagnose an issue I

> see when using aspectj in a larger scale application. Here is my
question...
>
> Why, when I specifically tell aspectj not to weave log4j, does it try
to?
> (assuming the stack trace below hints this, because the standalone 
> application works properly).
>
> Or, is there a bug in the aspectj agent that would cause this?
>
> Or, is there a bug in aspectj with respect to static initializer
blocks?
>
> Exception in thread "main" java.lang.NoClassDefFoundError  at 
> org.apache.log4j.spi.RootLogger.<init>(RootLogger.java:46)
>  at org.apache.log4j.LogManager.<clinit>(LogManager.java:80)
>  at org.apache.log4j.Logger.getLogger(Logger.java:118)
>  at
> com.verisign.common.properties.PropertyManager.<clinit>(PropertyManage
> r.java:47)  at com.verisign.jtaps.test.Test.calc(Test.java:19)
>  at com.verisign.jtaps.test.Test.main(Test.java:29)
> Thanks
>
> Bob
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
>
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users


Back to the top