Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] aspect to weave jsp not working

Hello All,

I am using LTW to weave servlets and jsps in my tomcat based web
application. Recently, my aspects for JSPs started behaving 'erratically'
(nothing displayed in terms of weaveinfo and no evidence of advice execution
i.e., no logs written). On rare occasions (after i've restarted tomcat for
the nth time), they would work for sometime but suddenly stop working when I
make seemingly innocuous changes to my jsp aspect and restart the server. I
am not able to figure out why. My aspect for servlets works fine all the
time so far and uses the same logging framework.
Here is my JSP Aspect:
aspect JSPAspect extends GenericAspect{

	pointcut JSPPC():
		within(javax.servlet.jsp.HttpJspPage+) &&
		execution(* _jspService(HttpServletRequest, HttpServletResponse));
		
	before() :JSPPC(){
		Log2File.write("Before processing _jspService","JSP"); //Log2File is my
logger
	}

	after():JSPPC() {
		Log2File.write("After processing _jspService","JSP"); //Log2File is my
logger
	}
}

GenericAspect is an abstract aspect which I've used as a base for all my
aspects. It has a non-trivial constructor. My aspects for servlets also
extend GenericAspect and the latter's constructor gets executed for the
servlet aspect but not the jsp aspect. Here is a snippet of output from
tomcat:
[StandardClassLoader@bd6a5f] info AspectJ Weaver Version 1.6.9 built on
Monday Jul 5, 2010 at 15:28:35 GMT
[StandardClassLoader@bd6a5f] info register classloader
org.apache.catalina.loader.StandardClassLoader@bd6a5f
[StandardClassLoader@bd6a5f] info using configuration
file:/C:/Program%20Files/Apache%20Tomcat%204.0/lib/test/test.jar!/META-INF/aop-ajc.xml
[StandardClassLoader@bd6a5f] info register aspect
myTests.test.aspects.HttpServletAspect
[StandardClassLoader@bd6a5f] info register aspect
myTests.test.aspects.JSPAspect
[StandardClassLoader@bd6a5f] info register aspect
myTests.test.aspects.GenericAspect

Please suggest possible reasons if you can! The LTW weaver has
'-showWeaveInfo' and '-verbose' options and I can see joinpoints woven for
my http servlets but not for my jsps! Please suggest some pointers! Thank
you very much!

-Arvind
-- 
View this message in context: http://aspectj.2085585.n4.nabble.com/aspect-to-weave-jsp-not-working-tp2546688p2546688.html
Sent from the AspectJ - users mailing list archive at Nabble.com.


Back to the top