Any ideas why I am get the NoSuchMethodError below?
The method specified by the pointcut is in
com.foo.action.LoginAction.execute.
The aspect is defined in com.foo.logging.Login. (see below)
My code which is being advised does not call the aspect's aspectOf()
method.
I use build-time bytecode weaving using the ant <iajc> task.
The app is a Struts-based web app.
Dev environment:
Java 1.5
Ant 1.7.1
AspectJ 1.6.6
Thanks,
Roger
javax.servlet.ServletException: Servlet execution threw an exception
com.hyperformix.athens.filter.AthensLoginFilter.doFilter(Unknown
Source)
root cause
java.lang.NoSuchMethodError:
com.foo.logging.Login.aspectOf()Lcom/foo/logging/Login;
com.foo.action.LoginAction.execute(Unknown Source)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestPr
ocessor.java:421)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:
226)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
com.foo.athens.filter.AthensLoginFilter.doFilter(Unknown Source)
@Aspect
public class Login {
static Logger log =
Logger.getLogger(Login.class.getName());
String userName;
String roleName;
@Pointcut("call (* com.foo.LoginDAO.login(com.foo. Data)
) && args(data)")
public void login(Data data) {}
@Before("login(data)")
public void loginBefore(Data data)
{
userName = data.getUserName();
roleName = data.getRoleName();
BasicConfigurator.configure();
log.info("User " + userName + " with
role " + roleName + " about to login");
}
}
Roger Huang
_______________________________________________
aspectj-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/aspectj-users