Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Issues deploying aspects

Title: Issues deploying aspects

Excuse my newbie questions, but I am having some problems getting aspects to work correctly.

When I try the following aspect on my code:

import javax.ejb.*;

public aspect Security {
    pointcut callingMethod() : target(SessionBean) && call(public * *(..));

    before(): callingMethod() {
        System.out.println("Entering " + thisJoinPoint);
        Object[] tmp = thisJoinPoint.getArgs();
        for (int i = 0; i < tmp.length; i++) {
            SecurityChecker.check(tmp[i], SecurityChecker.TEXT);
        }
    }
}

I get the following error when deploying:

Unable to deploy EJB: erm-ejb.jar from erm-ejb.jar:

In EJB JobTranslationBean, the primary key field named ajc$tjp_0 is not a CMP managed field.
        at weblogic.ejb20.compliance.EJBComplianceChecker.check(EJBComplianceChecker.java:268)
        at weblogic.ejb20.compliance.EJBComplianceChecker.checkDeploymentInfo(EJBComplianceChecker.java:232)
        at weblogic.ejb20.ejbc.EJBCompiler.complianceCheckJar(EJBCompiler.java:810)
        at weblogic.ejb20.ejbc.EJBCompiler.checkCompliance(EJBCompiler.java:766)
        ...etc


Now this presents several questions:
1) When I have specified SessionBean, why does aspectj touch JobTranslationBean which is an EntityBean?
2) Since it has touched my EntityBean, why has it put an additional field on it?
3) JobTranslationBean is in a seperate package, I only want my aspect to effect the classes in the package it itself is in. How can I do that?

Thanks in advance
James

Setup:
Java 1.4.2
aspectj-1.1.1
Weblogic 8.1


Back to the top