> Question#1: I wish i knew all of the -D options, and what they did??
> Question#3: I wish i knew all of the weaver options, and what they did??

-Daj.weaving.verbose=true   is an alternative to including '-verbose' in the
weaver options section <weaver options="-verbose"> in the aop.xml file.

The options are discussed (badly) here:

http://www.eclipse.org/aspectj/doc/released/devguide/ltw-configuration.html

I usually stick to just specifying things in the aop.xml file and never use
-D.

The important ones being -verbose and -showWeaveInfo



> Question#4: I wish you could configure where to dump the classes??

Dump is only really for when reporting bugs as we may need to debug the
woven bytecode - do you find you need that bytecode for something?


>  Questions: What does this mean??


> debug weaving 'com.sun.jbi.filebc.> extensions.FileExtensionRegistry'
> info AspectJ Weaver Version 1.6.1 built on Thursday Jul 3, 2008 at
18:35:41 GMT
> info register classloader [EMAIL PROTECTED]
a) this line

This means a new weaver is being attached to a classloader and will weave
all code loaded by that loader. The configuration for the weaver instance is
shown on the next line:

> info using configuration
file:/C:/glassfish/domains/domain1/lib/aspects-filter.jar!/META-INF/aop.xml


> debug weaving
'com.sun.encoder.MetaRef'
b) this line

This means the class is going to go through the weaver, it does *NOT* mean
that anything is being woven within the class.  It comes out when -debug is
on to help you determine if your includes and excludes are set correctly in
your aop.xml file.  To see if the type is actually changed based on matching
your pointcuts, you should turn on -showWeaveInfo in the aop.xml.  Then you
will get messages about the individual weaving, for example:

[EMAIL PROTECTED] debug not weaving 'A'
[EMAIL PROTECTED] debug not weaving 'I'
[EMAIL PROTECTED] debug weaving 'Extender'
[EMAIL PROTECTED] weaveinfo Join point 'method-execution(int
Extender.foo())' in Type 'Extender' (A.java:14) advised by before advice
from 'X' (X.java:2)
[EMAIL PROTECTED] debug not weaving 'X'

Here i did not include A, I or X. I only included 'Extender'.  And because I
had -showWeaveInfo active in aop.xml, it showed by that Extender as modified
by the weaver.

> debug cannot weave
'javax.wsdl.factory.WSDLFactory$1'
c) this line

'cannot weave' means it cannot be woven usually due to an internal
restriction like: aspectj does not weave itself, or in this case classes in
javax.* and java.* packages cannot be woven.  However.  It is possible to
force weaving of javax packages if you really need it by adding:
-Xset:weaveJavaxPackages=true to your aop.xml weaver options section.


I know, I know, the doc around this is awful, I'm sorry :(  Any help is
appreciated to sort it out !

cheers,
Andy.


2008/9/26 Jason Weinstein <[EMAIL PROTECTED]>

>  I am fairly new (just a few days) to aspectj but after some initial
> problems am now doing this, (but perhaps not doing it the best way).
>
> Here are the things i am doing:
>
> Note: for a while i could not get things to work,. It was hard to find out
> what was going wrong, e.g. no logs.
>
>
> * In the Glassfish Admin Console (e.g. port 4848)/Application Server/JVM
> Settings/JVM Options
> I added
> -javaagent:<path>\aspectjweaver.jar
> -Daj.weaving.verbose=true
>
> Question#1: I wish i knew all of the -D options, and what they did??
>
>
> * I place my aspects-filter.jar right now in glassfish/domains/domain1/lib
> I had better success when i narrowed down my aspect's scope.
>
> Question#2: If i place it in the application classpath MY_APP/WEB-INF/lib
> will the weaving only apply to the classes loaded by the application
> classloader
>
>
> * build.xml
>
>         <iajc srcdir="${src.dir}/aop" destdir="${build.dir}/aop"
>             debug="true" source="1.6" target="1.6">
>             <classpath refid="compile.class.path" />
>         </iajc>
>
> Note: I believe this defaults to 1.3 or something. I had better success
> after changing this
>
> * WEB-INF/aop.xml
>
> <aspectj>
>     <aspects>
>         <aspect name="aspects.FilterAspect" />
>     </aspects>
>     <weaver options="-XmessageHandlerClass:aspects.AspectJMessageHandler">
>         <!--
>             <weaver options="-verbose -showWeaveInfo">
>         -->
>         <dump within="blah.*"/>
>     </weaver>
> </aspectj>
>
> Question#3: I wish i knew all of the weaver options, and what they did??
>
> Question#4: I wish you could configure where to dump the classes??
>
> Note: There are not many good examples of this aop.xml file
>
>
> * IMessageHandler
> I had better success after i started using this.
>
> package aspects;
>
> import org.aspectj.bridge.AbortException;
> import org.aspectj.bridge.IMessage;
> import org.aspectj.bridge.IMessage.Kind;
>
> public class AspectJMessageHandler implements
> org.aspectj.bridge.IMessageHandler {
>     public void dontIgnore(Kind arg0) {
>     }
>
>     public boolean handleMessage(IMessage arg0) throws AbortException {
>         // note i actually write the message to a log, basically log(new
> Date() + " " + arg0)
>         return true;
>     }
>
>     public void ignore(Kind arg0) {
>     }
>
>     public boolean isIgnoring(Kind arg0) {
>         return false;
>     }
> }
>
>
> * Questions: What does this mean??
>
>
> debug weaving 'com.sun.jbi.filebc.extensions.FileExtensionRegistry'
> info AspectJ Weaver Version 1.6.1 built on Thursday Jul 3, 2008 at 18:35:41
> GMT
> info register classloader [EMAIL PROTECTED]
> a) this line
> info using configuration
> file:/C:/glassfish/domains/domain1/lib/aspects-filter.jar!/META-INF/aop.xml
> info register aspect aspects.FilterAspect
> debug weaving
> 'com.sun.encoder.MetaRef'
> b) this line
> ...
> debug weaving 'org.apache.xml.resolver.readers.OASISXMLCatalogReader'
> debug weaving 'org.apache.xml.resolver.readers.SAXCatalogParser'
> debug cannot weave 'javax.wsdl.factory.WSDLFactory'
> debug cannot weave 'javax.wsdl.WSDLException'
> debug cannot weave
> 'javax.wsdl.factory.WSDLFactory$1'
> c) this line
>
>
>
> Andy Clement wrote:
>
> Hi,
>
> I can't answer the question...  but how to integrate ltw with appserver
> <insert app server name here> comes up on the list now and again.  So I've
> created an FAQ entry for it.  If anyone reading this can help me flesh it
> out from the purely general advice it currently includes (which Ramnivas
> wrote, thanks Ramnivas!), I will put it in there right away.
>
> Current FAQ entry:
> http://www.eclipse.org/aspectj/doc/released/faq.php#q:ltwAppServers
>
> Bug entry where anyone wishing to contribute can add
> instructions/guidelines for an application server:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=248743
>
> Andy.
>
> 2008/9/25 <[EMAIL PROTECTED]>
>
>  Hi.
>
>  I have a several applications deployed in an application server (sun app
> server / glassfish) and have written several aspects to hook into the
> current applications (for logging purposes).
>
>  I understand this is done via load time weaving.
>
>  However, I added the javaagent into the VM options, and it resulted in my
> applications not starting up right.
>
>  I have exported my aspects as a jar, and want them to become active
> whenever I put them in a specific directory.
> Do i put the aop.xml in this jar? Or does it sit somewhere else??
>
>  Im quite confused about the whole deployment issue, but believe that my
> aspects are working ok...
> Can anyone point me in the appropriate direction?
>
>  Regards,
> Andrew
>
> _______________________________________________
> aspectj-users mailing list
> [email protected]
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
>
>  ------------------------------
>
> _______________________________________________
> aspectj-users mailing [EMAIL 
> PROTECTED]://dev.eclipse.org/mailman/listinfo/aspectj-users
>
>
> _______________________________________________
> aspectj-users mailing list
> [email protected]
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
>
_______________________________________________
aspectj-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Reply via email to