Skip to main content

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

My problem is that I'm trying to insert a pointcut inside a class file included
inside a jar file. But this class has attributes and method calls to other
classes some included in this jar, some not included. The problem is that I
included in my classpath all the jars inside my /lib directory ( I'm trying to
monitor a server behaviour and all jar files are placed in this directory) but
one class is still missing and I can't find it. 
Is there any way of doing compilation without having this missing class? I have
the guarantee that only the jar included in the injar has the method that I'm
trying to monitor with my pointcut.

Any idea about how doing it without having that class? 

Regards from spain

Dave Garcia

P.D. Thanks everybody specially to Wes, this is the second time you helped 
 me. :) 

> (1) To resolve but not weave a required class, 
>     put it on the classpath.
> 
> (2) Ajc only writes .class files it generates to output.jar
>     You'll have to copy resources, etc.
> 
> 
> Good luck -
> Wes
> 
> David Garcia Garcia wrote:
> > 
> > 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 .
> > 
> > _______________________________________________
> > 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
> 


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

----- End forwarded message -----




Back to the top