Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Cannot register non aspect: com$....

Title: Cannot register non aspect: com$....

Hello and Help!

Trying to use ASPECTJ to implement method tracing in an Eclipse/spring distribution:

Using aspectj 1.10 LTW and Tanuki Service wrapper on Windows.  Methods in the Wrapper and launcher are traced OK but when trying to register the same aspect for the app I get an error:

2011-01-04 16:00:43,351 ERROR [Start Level Event Dispatcher] org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor - register definition failed

java.lang.RuntimeException: Cannot register non aspect: com$compuware$mfm$mtrace$mtagent , com.compuware.mfm.mtrace.mtagent

        at org.aspectj.weaver.bcel.BcelWeaver.addLibraryAspect(BcelWeaver.java:221)

        at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.registerAspects(ClassLoaderWeavingAdaptor.java:466)

        at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.registerDefinitions(ClassLoaderWeavingAdaptor.java:290)

        at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.initialize(ClassLoaderWeavingAdaptor.java:176)

"csp-system.log" showing aspectj that IS weaving:

DEBUG  | wrapper  | 2011/01/04 16:00:33 | JVM started (PID=3160)

INFO   | jvm 1    | 2011/01/04 16:00:34 | [AppClassLoader@fabe9] info AspectJ Weaver Version 1.6.10 built on Friday Oct 22, 2010 at 03:50:26 GMT

INFO   | jvm 1    | 2011/01/04 16:00:34 | [AppClassLoader@fabe9] info register classloader sun.misc.Launcher$AppClassLoader@fabe9

INFO   | jvm 1    | 2011/01/04 16:00:34 | [AppClassLoader@fabe9] info using configuration file:/C:/aspectj-1.6.10/lib/mtaspect.jar!/META-INF/aop.xml

INFO   | jvm 1    | 2011/01/04 16:00:34 | [AppClassLoader@fabe9] info register aspect com.compuware.mfm.mtrace.mtagent

INFO   | jvm 1    | 2011/01/04 16:00:34 | [AppClassLoader@fabe9] weaveinfo Join point 'constructor-execution(void com.compuware.cos.kernel.launcher.internal.COSMain.<init>())' in Type 'com.compuware.cos.kernel.launcher.internal.COSMain' (COSMain.java:72) advised by around advice from 'com.compuware.mfm.mtrace.mtagent' (mtagent.aj:68)

Same "csp-system.log" showing aspectj NOT weaving:

INFO   | jvm 1    | 2011/01/04 16:00:43 | [DefaultClassLoader@15e2639] info AspectJ Weaver Version 1.6.10 built on Friday Oct 22, 2010 at 03:50:26 GMT

INFO   | jvm 1    | 2011/01/04 16:00:43 | [DefaultClassLoader@15e2639] info register classloader org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader@15e2639

INFO   | jvm 1    | 2011/01/04 16:00:43 | [DefaultClassLoader@15e2639] info using configuration /META-INF/aop.xml

INFO   | jvm 1    | 2011/01/04 16:00:43 | [DefaultClassLoader@15e2639] info register aspect com.compuware.mfm.mtrace.mtagent

INFO   | jvm 1    | 2011/01/04 16:00:43 | Jan 4, 2011 4:00:43 PM org.aspectj.weaver.tools.Jdk14Trace error

INFO   | jvm 1    | 2011/01/04 16:00:43 | SEVERE: register definition failed

INFO   | jvm 1    | 2011/01/04 16:00:43 | java.lang.RuntimeException: Cannot register non aspect: com$compuware$mfm$mtrace$mtagent , com.compuware.mfm.mtrace.mtagent

INFO   | jvm 1    | 2011/01/04 16:00:43 |       at org.aspectj.weaver.bcel.BcelWeaver.addLibraryAspect(BcelWeaver.java:221)

INFO   | jvm 1    | 2011/01/04 16:00:43 |       at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.registerAspects(ClassLoaderWeavingAdaptor.java:466)

Attached are:   wrapper.conf    (Service wrapper Config)

                aop.xml (aspectJ config

                csp-system.log  (Our platform output showing the good and bad)

                Dp.xml          (The first Spring config that causes aspect to fail) <<wrapper.conf>> <<aop.xml>> <<csp-system.log>> <<DataPrivacy.xml>>

Any help/guidance would be appreciated>

Thanks,

Bob


ps. I am trying to get the aspectj project into my Eclipse so I can try to debug it, but am also having problems getting to

the cvs repository. Will try tonight from home with no firewall.


The contents of this e-mail are intended for the named addressee only. It contains information that may be confidential. Unless you are the named addressee or an authorized designee, you may not copy or use it, or disclose it to anyone else. If you received it in error please notify us immediately and then destroy it.

Attachment: wrapper.conf
Description: wrapper.conf

		 <aspectj>

            <aspects>
              
             <aspect name="com.compuware.mfm.mtrace.mtagent"/>
            	 
            </aspects>

            <weaver options="-verbose -showWeaveInfo -XnoInline">

              <!-- Do not weave types within these packages -->
              
              <exclude within="org.tanukisoftware..*"/>
              <exclude within="com.compuware.mfm.mtrace..*"/>
              
            </weaver>

          </aspectj>

Attachment: csp-system.log
Description: csp-system.log

<?xml version="1.0" encoding="UTF-8"?>

<beans 
    xmlns="http://www.springframework.org/schema/beans";
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
    xmlns:osgi="http://www.springframework.org/schema/osgi";
    xmlns:jaxws="http://cxf.apache.org/jaxws";
    xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/osgi
        http://www.springframework.org/schema/osgi/spring-osgi.xsd
        http://cxf.apache.org/jaxws
        http://cxf.apache.org/schemas/jaxws.xsd";
>

	<context:load-time-weaver />

    <!--
     * Define the DataPrivacy Services Spring bean 
     -->
    <bean id="beanDataPrivacy" scope="singleton" class="com.compuware.dataprivacy.services.server.DataPrivacyServicesImpl" />
            
    <!--
     * Register DataPrivacy as OSGi Service 
     -->
    <osgi:service ref="beanDataPrivacy" interface="com.compuware.dataprivacy.services.core.IDataPrivacyServices" />
    
    <!-- 
     * Register DataPrivacy as web service
     -->
    <import resource="classpath:META-INF/cxf/cxf.xml" />
    <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
    <import resource="classpath:META-INF/cxf/cxf-extension-http.xml" />
    <import resource="classpath:META-INF/cxf/osgi/cxf-extension-osgi.xml" />
    
    <jaxws:endpoint id="DataPrivacy" implementor="#beanDataPrivacy" address="/DataPrivacy"  />
     
</beans>

Back to the top