Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] [newbie] General help needed here.....

I think you should file a AJDT bug for the first problem.

For Tomcat issue: I had used almost the same combination in a recent project. The differences were an older version of AJDT, an older version of Eclipse (I think 3.0M8), and the compatible Sysdeo plugin, with Tomcat 4.1x. I didn't see the issues you are facing (although I did have to restart Tomcat more frequently). Other difference is that I wasn't calling aspectj-related stuff directly from my JSP pages (Struts action did the calling).

Couple of guesses/pointers:
- Did you copy aspectjrt.jar to webapps/<app>/lib?
- What happens when you build/deploy through Ant?

-Ramnivas

===
Ramnivas Laddad,
Author, AspectJ in Action
http://ramnivas.com



Jerry Jalenak wrote:

Ramnivas,

It was limited to the lack of markers in the outline view.  While we've been
e-mail back and forth, I went ahead and coded up a simple little .JSP page
to call the Logon_Action via Struts, and I've run into a new problem.  As
long as the webapp has an AspectJ nature, I cannot get the webapp to
initialize correctly (unable to create my ActionForm beans, for example).
Also, whenever I try to compile a JSP, I get hot-code replacement errors in
Eclipse, and my instance of Tomcat dies.  If I remove the AspectJ nature,
everything seems to work OK (no aspect-related stuff obviously).  Until I
can get everything working again (Eclipse + webapp + Struts + AspectJ)
without problems, I can't move forward.

Is anyone running Eclipse 3.0 + Sysdeo Tomcat plugin with AspectJ?  I'm
having all sorts of problems...

Thanks.

Jerry Jalenak
Development Manager, Web Publishing
LabOne, Inc.
10101 Renner Blvd.
Lenexa, KS  66219
(913) 577-1496

jerry.jalenak@xxxxxxxxxx


-----Original Message-----
From: Ramnivas Laddad [mailto:ramnivas@xxxxxxxxxxxxxxx]
Sent: Friday, July 16, 2004 3:44 PM
To: aspectj-users@xxxxxxxxxxx
Subject: Re: [aspectj-users] [newbie] General help needed here.....


Your aspect looks fine to me (and as reply to your other email, you don't need to import the Action type since you aren't referring to it in your pointcut expression).

Is the problem you are facing limited to Eclipse outline view not showing markers you expect or it is that your advice isn't executed? What happens when you call Logon_Action.execute() directly from, say, a main() method in one of your classes?

-Ramnivas

===
Ramnivas Laddad,
Author, AspectJ in Action
http://ramnivas.com

Jerry Jalenak wrote:

Ramnivas,

I've double checked the imports in the aspect to make sure
that all of the
referred types are there - here's the entire aspect :

/*
* Created on Jul 16, 2004
*/
package org.labone.membersolutions.aspects;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import org.labone.membersolutions.framework.actions.*;

/**
* @author jjalenak
*/
public aspect MemberSolutions_BaseActionAspect
{
  // ~ Pointcut definitions
pointcut actionCall() : (execution(public ActionForward
Logon_Action.execute(ActionMapping,
ActionForm, HttpServletRequest, HttpServletResponse)));
// ~ Advice definitions Object around() : actionCall()
  {
      System.out.println("here i am");
      return proceed();
  }
}

I've changed the before() advice to an around() advice as I
will eventually
want to wrap the actual execute method with the advice. It
seems like it
ought to be working OK; I just can't figure this one out.....

Jerry Jalenak
Development Manager, Web Publishing
LabOne, Inc.
10101 Renner Blvd.
Lenexa, KS  66219
(913) 577-1496

jerry.jalenak@xxxxxxxxxx




-----Original Message-----
From: Ramnivas Laddad [mailto:ramnivas@xxxxxxxxxxxxxxx]
Sent: Friday, July 16, 2004 2:29 PM
To: aspectj-users@xxxxxxxxxxx
Subject: Re: [aspectj-users] [newbie] General help needed here.....


Hi Jerry,

Otávio's suggestion of using execution() PCD is the right one.

It is okay to use any number of aspects crosscutting a class. Just a guess: Do you have every referred type in the pointcut definition (in your case ActionMapping, ActionForm, HttpServletRequest, HttpServletResponse) appropriately imported.

-Ramnivas

===

Ramnivas Laddad,
Author, AspectJ in Action
http://ramnivas.com

Jerry Jalenak wrote:

Otavio,

Thanks for the reply. Change the PCD from call to execution
didn't seem to
change anything. However, I starting to think I have
something else wrong.
In the AspectJ Visualizer perspective, I am only seeing
where one aspect has
been applied (I have two). Is it not possible to have more
than one aspect
class?

Thanks....

Jerry Jalenak
Development Manager, Web Publishing
LabOne, Inc.
10101 Renner Blvd.
Lenexa, KS  66219
(913) 577-1496

jerry.jalenak@xxxxxxxxxx




-----Original Message-----
From: Otávio Augusto Lazzarini Lemos [mailto:oall@xxxxxxxxxxx]
Sent: Friday, July 16, 2004 1:31 PM
To: aspectj-users@xxxxxxxxxxx
Subject: Re: [aspectj-users] [newbie] General help needed
here.....
You should use an execution PCD. In your example the calls to
Logon_action.execute(ActionMapping, ActionForm,
HttpServletRequest,
HttpServletResponse) are the intercepted join points, and
not the actual
execution of the method (try to look at the places where you call the method).
Tell me if it works with the execution instead of the call PCD.

Otávio

Citando Jerry Jalenak <Jerry.Jalenak@xxxxxxxxxx>:

First, thanks to Rod, Adrian, and Ramnivas for their help
the other day.  I
think I'm starting to get the hang of this....

That being said, I'm stuck as to why the following doesn't
work.  I've just
upgraded to the AJDT 1.1.11 plug-in, if it matters.

Here's the aspect :

	public aspect MemberSolutions_BaseActionAspect
	{
	    // ~ Pointcut definitions
pointcut actionCall() : (call(public ActionForward Logon_Action.execute(ActionMapping, ActionForm,
HttpServletRequest,
HttpServletResponse)));
// ~ Advice definitions before() : actionCall()
	    {
	        System.out.println("here i am");
	    }
	}

and the class I'm trying to weave it into :

	public class Logon_Action extends Action
	{
	    public ActionForward execute(ActionMapping _actionMapping,
	            ActionForm _actionForm, HttpServletRequest _request,
	            HttpServletResponse _response)
	    {
	        Logon_ActionForm form = (Logon_ActionForm) _actionForm;
	        return null;
	    }
	}

Everything compiles OK (no errors, anyway), but when I
check the class I
don't see any indication that the aspect is being applied.
I expect to see
an indicator on the first statement of the class....

I'm probably being dense on this, and it's something really
stupid, but I
can't seem to figure it out.  Any help?

Thanks guys!

Jerry Jalenak
Development Manager, Web Publishing
LabOne, Inc.
10101 Renner Blvd.
Lenexa, KS  66219
(913) 577-1496

jerry.jalenak@xxxxxxxxxx


This transmission (and any information attached to it) may
be confidential
and
is intended solely for the use of the individual or entity
to which it is
addressed. If you are not the intended recipient or the
person responsible
for
delivering the transmission to the intended recipient, be
advised that you
have received this transmission in error and that any use,
dissemination,
forwarding, printing, or copying of this information is
strictly prohibited.
If you have received this transmission in error, please
immediately notify
LabOne at the following email address:
securityincidentreporting@xxxxxxxxxx
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/aspectj-users

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/aspectj-users

This transmission (and any information attached to it) may
be confidential and is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient or the person responsible for delivering the transmission to the intended recipient, be advised that you have received this transmission in error and that any use, dissemination, forwarding, printing, or copying of this information is strictly prohibited. If you have received this transmission in error, please immediately notify LabOne at the following email address: securityincidentreporting@xxxxxxxxxx
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/aspectj-users



_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/aspectj-users

This transmission (and any information attached to it) may
be confidential and is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient or the person responsible for delivering the transmission to the intended recipient, be advised that you have received this transmission in error and that any use, dissemination, forwarding, printing, or copying of this information is strictly prohibited. If you have received this transmission in error, please immediately notify LabOne at the following email address: securityincidentreporting@xxxxxxxxxx
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/aspectj-users



_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/aspectj-users


This transmission (and any information attached to it) may be confidential and is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient or the person responsible for delivering the transmission to the intended recipient, be advised that you have received this transmission in error and that any use, dissemination, forwarding, printing, or copying of this information is strictly prohibited. If you have received this transmission in error, please immediately notify LabOne at the following email address: securityincidentreporting@xxxxxxxxxx

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/aspectj-users



Back to the top