Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] AspectJ will not run in an EclipseRCP application

Firstly, your plugins with aspects need to depend on the
"org.aspectj.runtime" plugin. This needs to be specified in your
MANIFEST.MF file (or plugin.xml). Secondly, check that the
"org.aspectj.runtime" plugin is present in your exported eclipse
product.

Regards,

Matt.

On 12/03/07, Uwe.Neukam@xxxxxxxxxxxxxx <Uwe.Neukam@xxxxxxxxxxxxxx> wrote:



Hi all,

I'm new in working with AspectJ. I just take it for logging over java
annotation (@Logging). My problem is, the aspects would not run in the RCP
Application, when the libraries are eclipse plugins. Here I become a
NoAspectBoudException. First Time I just look, about the classpath, but the
runtime archive from AspectJ is available. Next I have set a environment
variable ASPECTJRT_LIB (equivalent eclipse), no success. And at the end, I
have seen, that the aspect in plugin archives would not run, but in core
java archives, they will still do their job. The phenomen is, in the eclipse
IDE with AJDT, when I run the RCP application (over product configuration),
all the aspects will be run fine and all loooking good, but when I build a
RCP Application over EXPORT/Eclipse product with AspectJ support and start
the application, I become a NoAspectBoundException.

Here a Code Snippet:

public aspect LoggingAspect pertypewithin(@Logging *)
{
  ...
  static aspect Worker
  {
    pointcut createLoggingOwner():staticinitialization(@Logging *);

    after():createLoggingOwner()
    {
      Signature signature =  thisJoinPoint.getSignature();
      Class clazz = signature.getDeclaringType();
      LoggingAspect object = LoggingAspect.aspectOf(clazz);

      // read Annotation
      Logging at =
(Logging)clazz.getAnnotation(Logging.class);
    }
  }
}

The pointcut will not run, only in plugin jars.


Has anything ideas, thanks.
Uwe


Back to the top