[aosd-discuss] Tomcat and DJAsCo (AWED)

Mandeep Joshi JOSHIM at hope.ac.uk
Wed Apr 25 10:16:04 EDT 2007


Dear all,
As you might have known by now that I have been trying to run DJAsCo AOP
with Tomcat. The problem I have at the moment is that jasco cannot find
the hooks specified in the connectors and or it cannot find the
connectors itself.  Below, I have tried to briefly explain what I have
done

 I have put the connector and aspect at C:\weaver so the directory
structure looks like this
C:\weave
	QuizAsp.asp
	QuizCon.con
C:\weave\Generated\aspect
	QuizAsp.class
	QuizAsp_QuizHook.class
C:\weave\Generated\Connector
	QuizCon.class

My aspect is a simple one which implements a simple before advice :
package aspect;
class QuizAsp {
	hook QuizHook {
		QuizHook(method(..args)) {
			execution(method);
		}
		
		before(){
			System.out.println("--- Before advice. ");
			}
	}
}
and my connector also is a simple one which intercepts all the methods
of all the classes with any parameter:
static connector QuizCon {
	aspect.QuizAsp.QuizHook hook0 = new aspect.QuizAsp.QuizHook(*
*.*(*));
	hook0.before();
}

I have added set the classpath for Tomcat to include the classfiles for
aspect and connectors:
set
CLASSPATH=%CLASSPATH%;%CATALINA_HOME%\bin\bootstrap.jar;C:\weave\Generated\aspect;C:\weave\Generated\Connector;.;

I have also added jasco jar files (jasco.jar,jasco-libs.jar) in
tomcat\lib. I have also tried adding jasco jar files in the set
CLASSPATH statement.

I have set JAVA_OPTS to include JAsCo options
set JAVA_OPTS= -Djasco.hotswap.applicationserver=true -Djasco.debug=true

(i havent included -javaagent as was giving errors "[info] JNI FATAL
ERROR in native method: processing of -javaagent failed '' so I thought
i will make it work without hotswap first.)

So when i start my program, it intercepts the method execution but for
some reason it cannot find the connectors/hooks. I have surely done
something wrong here.... as it says matchin hooks=NONE whereas as
specified in the connector it should be hooking all the methods.

Is there anything wrong that i have done while setting the CLASSPATH ?? 

The snippet of my output file looks like this
========================================================================
--- JAsCo Jutta system activated ---
JASCO DEBUG: System initialized
JASCO DEBUG: jasco aspect framework operational
JASCO DEBUG: joinpoint encountered
org.globus.examples.stubs.Factory.CreateResourceResponse
org.globus.examples.services.core.factory.impl.QuizFactoryService.createResource(Lorg/globus/examples/stubs/Factory/CreateResource;)Lorg/globus/examples/stubs/Factory/CreateResourceResponse;
JASCO DEBUG: matching hooks = NONE
JASCO DEBUG: joinpoint encountered org.globus.wsrf.ResourceKey
org.globus.examples.services.core.factory.impl.QuizResourceHome.create()Lorg/globus/wsrf/ResourceKey;
JASCO DEBUG: matching hooks = NONE
JASCO DEBUG: joinpoint encountered java.lang.Object
org.globus.examples.services.core.factory.impl.QuizResource.initialize()Ljava/lang/Object;
JASCO DEBUG: matching hooks = NONE
JASCO DEBUG: joinpoint encountered void
org.globus.examples.services.core.factory.impl.QuizResource.setQuestion(Ljava/lang/String;)V
JASCO DEBUG: matching hooks = NONE
JASCO DEBUG: joinpoint encountered void
org.globus.examples.services.core.factory.impl.QuizResource.setGQ1(I)V
JASCO DEBUG: matching hooks = NONE
JASCO DEBUG: joinpoint encountered void
org.globus.examples.services.core.factory.impl.QuizResource.setGA1(I)V
JASCO DEBUG: matching hooks = NONE
============================================================================
Any help would be much much appreciated.

Thanking you in advance,
Mandeep Joshi



More information about the discuss mailing list