Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Questions about passing injars

Hi everybody, I'm trying to use an aspect for monitoring method calls inside a jar file. If I use a jar that includes all needed files (class files) I got no problem, but when I'm using a jar that has a class that calls a method or instancietes an object from a package not include in this jar I get the following  error:
can't find type com.anycomp...(here goes the name of the missing class)
trouble in:
public class com...(here the name of the class that calls a method to that class)  extends java.lang.Object:

... Here goes the code dump of the involved class

The problem is that I only want to monitor classes included in this jar not in the others. And I don't have the jar that includes that class ;P.
Is there any way of doing code weaving of this jar without having the missing class?.

Thanks everybody apologies for my english :). 

Dave Garcia

P.D. I tried to monitor Apache Tomcat using code weaving. For this purposal I created an aspect including a pointcut that had a pointcut named Service that monitors execution of javax.Servlet.service method.
My aspect was in a file called ServletMonitor.java. I compiled all in this way:
ajc ServletMonitor.java -injars servlet.jar -outjar servlet.jar. Doing that I had inside servlet.jar the modifided classes and my aspect class ServletMonitor.class. The problem is that inside that jar ( before compiling using ajc) there was several kind of files not only class files ( for example dtd files) and in the outjars those files where missing!. My question is: is this a bug or am I doing something wrong. I suspect that's very likely that I'm doing something wrong .




Back to the top