Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] LTW into javax.swing

Compile Time weaving is out because I have to weave into Swing itself. I'm not about to recompile anything that's in javax or java. I have looked at that page and found the -debug option, which gives me what you see below. Now this tells me that my code gets woven (as it should), org.jdesktop is excluded (as it should) and javax.swing is never even passed to the weaver. Why? The -Xset:weaveJavaxPackages=true is there, and <include within="javax.swing..*"/> is there too.


[AppClassLoader@19134f4] debug weaving '<mystuff>.AppClientApp'   //this is my main() class
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.SingleFrameApplication'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.Application'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.AbstractBean'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.AbstractBean$EDTPropertyChangeSupport'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.Application$NotifyingEvent'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.Application$NoApplication'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.Application$1'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.ApplicationContext'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.ResourceManager'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.ActionManager'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.ApplicationActionMap'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.LocalStorage'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.LocalStorage$LocalIO'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.LocalStorage$PersistenceServiceIO'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.LocalStorage$LocalFileIO'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.LocalStorage$LSException'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.LocalStorage$RectanglePD'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.SessionStorage'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.SessionStorage$WindowProperty'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.SessionStorage$Property'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.SessionStorage$TabbedPaneProperty'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.SessionStorage$SplitPaneProperty'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.SessionStorage$TableProperty'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.TaskService'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.TaskService$TaskPCL'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.ResourceMap'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.ResourceConverter$ResourceConverterException'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.ResourceMap$InjectFieldException'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.ResourceMap$PropertyInjectionException'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.ResourceMap$LookupException'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.ResourceConverter'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.ResourceMap$ColorStringConverter'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.ResourceConverter$BooleanResourceConverter'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.ResourceConverter$IntegerResourceConverter'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.ResourceConverter$INumberResourceConverter'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.ResourceConverter$MessageFormatResourceConverter'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.ResourceConverter$FloatResourceConverter'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.ResourceConverter$NumberResourceConverter'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.ResourceConverter$DoubleResourceConverter'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.ResourceConverter$LongResourceConverter'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.ResourceConverter$ShortResourceConverter'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.ResourceConverter$ByteResourceConverter'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.ResourceConverter$URLResourceConverter'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.ResourceConverter$URIResourceConverter'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.ResourceMap$IconStringConverter'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.ResourceMap$ImageStringConverter'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.ResourceMap$FontStringConverter'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.ResourceMap$KeyStrokeStringConverter'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.ResourceMap$DimensionStringConverter'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.ResourceMap$PointStringConverter'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.ResourceMap$RectangleStringConverter'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.ResourceMap$InsetsStringConverter'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.ResourceMap$EmptyBorderStringConverter'
Xlib:  extension "RANDR" missing on display ":0.0".
Sep 28, 2009 10:46:36 AM <mystuff>.AppClientApp setupLogger
INFO: Logger started: Mon Sep 28 10:46:36 CEST 2009
[AppClassLoader@19134f4] debug weaving '<mystuff>.AppClientLoginFrame'
[MethodUtil@1402eeb] info AspectJ Weaver Version 1.6.5 built on Thursday Jun 18, 2009 at 03:42:32 GMT
[MethodUtil@1402eeb] info register classloader sun.reflect.misc.MethodUtil@1402eeb
[MethodUtil@1402eeb] info using configuration file:/<mystuff>/workspace/Client/lib/tooltipWrangler.jar!/META-INF/aop.xml
[MethodUtil@1402eeb] info register aspect <mystuff>.Wrangler
[MethodUtil@1402eeb] debug cannot weave 'sun.reflect.misc.Trampoline'
[AppClassLoader@19134f4] debug weaving '<mystuff>.AppClientLoginFrame$1'
[AppClassLoader@19134f4] debug weaving '<mystuff>.AppClientApp$1'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.View'
[AppClassLoader@19134f4] debug weaving '<mystuff>.AppClientView'
[AppClassLoader@19134f4] weaveinfo Join point 'method-call(java.lang.String javax.swing.JMenuItem.getToolTipText())' in Type '<mystuff>.AppClientView' (AppClientView.java:596) advised by before advice from '<mystuff>.Wrangler' (Wrangler.aj:33)
[AppClassLoader@19134f4] weaveinfo Join point 'method-call(java.lang.String javax.swing.JMenuItem.getToolTipText(java.awt.event.MouseEvent))' in Type '<mystuff>.AppClientView' (AppClientView.java:598) advised by before advice from '<mystuff>.Wrangler' (Wrangler.aj:12)
[AppClassLoader@19134f4] weaveinfo Join point 'method-call(void <mystuff>.ToolTipSettings.omgAfunction())' in Type '<mystuff>.AppClientView' (AppClientView.java:599) advised by before advice from '<mystuff>.Wrangler' (Wrangler.aj:40)
[AppClassLoader@19134f4] weaveinfo Join point 'method-call(void <mystuff>.ToolTipSettings.omganotherfunction())' in Type '<mystuff>.AppClientView' (AppClientView.java:601) advised by before advice from <mystuff>.Wrangler' (Wrangler.aj:46)
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.FrameView'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.Application$DoWaitForEmptyEventQ'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.Task'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.swingworker.SwingWorker'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.swingworker.AccumulativeRunnable'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.swingworker.SwingWorker$4'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.swingworker.SwingPropertyChangeSupport'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.swingworker.SwingWorker$3'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.swingworker.SwingWorker$DoSubmitAccumulativeRunnable'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.swingworker.SwingWorker$2'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.swingworker.SwingWorker$1'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.swingworker.SwingWorker$StateValue'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.Task$StatePCL'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.swingworker.SwingWorker$6'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.swingworker.SwingWorker$7'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.swingworker.SwingPropertyChangeSupport$1'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.Task$1'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.Task$BlockingScope'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.application.TaskEvent'
[AppClassLoader@19134f4] debug not weaving 'org.jdesktop.swingworker.SwingWorker$5'


2009/9/25 Andy Clement <andrew.clement@xxxxxxxxx>
Hi,

Take a look at:
http://andrewclement.blogspot.com/2009/02/load-time-weaving-basics.html
and try some of the debug/verbose options there - that will tell you
whether the classloader is able to pass the types you are interested
to a weaver.  If they cannot be passed to a weaver they will never be
woven, regardless of options or pointcuts.  Can you use compile time
weaving? That would definetly work.

Andy

2009/9/25 Kajetan Abt <kdansky@xxxxxxxxx>:
> That did not work, I get an identical behaviour. Still, thanks for finding a
> bug.
>
> 2009/9/25 <jeanlouis.pasturel@xxxxxxxxxxxxxxxxxx>
>>
>> I have made the same error few months ago. You have to set only one Xset
>> like :
>>
>> -Xset:weaveJavaxPackages=true,weaveJavaPackages=true
>>
>>
>>
>>
>>
>> Jean-Louis Pasturel
>>
>>
>>
>> ________________________________
>>
>> De : aspectj-users-bounces@xxxxxxxxxxx
>> [mailto:aspectj-users-bounces@xxxxxxxxxxx] De la part de Kajetan Abt
>> Envoyé : vendredi 25 septembre 2009 14:14
>> À : aspectj-users@xxxxxxxxxxx
>> Objet : [aspectj-users] LTW into javax.swing
>>
>>
>>
>> What I am trying to do: Swing has support for Tooltips, but that
>> functionality is very basic. There are two functions (SetToolTip() and
>> GetToolTip()) which either take a String argument or return one. I would
>> like to have different Tooltips, to be precise, different verbosity levels,
>> for all tooltips in my project. Of course I could either overload all used
>> JComponents (hah!) or use some other nontrivial approach (manage my own
>> listeners...) to set these values anew every time the user changes the
>> verbosity level.
>>
>> But on the other hand, having an Aspect weave into GetToolTip() would
>> instantly solve my issues, as I could then change the return parameter (read
>> from a properties file). I have managed to figure out how to basically do
>> this, and it works, as long as I am weaving into my own code (I suppose it
>> would work at compile time even). But for some reason, weaving into Swing
>> fails without error messages, it just does not happen. I assume the class
>> loader has my classes prepared before the weaver kicks in, but I have
>> absolutely no idea how to do that different. There is also not a lot of
>> literature on the subject and I only assume this happens because I've read
>> somewhere that writing a classloader might be necessary (without explanation
>> as to why or how). I am settnig the option to the weaver to include javax,
>> but it won't find JComponent. If I don't exclude the org.jdesktop package,
>> it even tries to find the superclasses of some of the jdesktop parts at
>> javax.jnlp.*, so it doesn't completely fail.
>> As for the call I want to intercept: javax.swing.ToolTipManager is the
>> class that calls my target function. It never gets woven.
>>
>> As for the code I use:
>>
>> aop.xml:
>>          <aspectj>
>>             <aspects>
>>               <aspect name="<something>.weaver.
>>
>> Wrangler"/>
>>                <include within="<something>..*"/>
>>                <include within="javax.swing..*"/>
>>                <exclude within="org.jdesktop..*"/>
>>             </aspects>
>>             <weaver options="-verbose -Xset:weaveJavaxPackages=true
>> -Xset:weaveJavaPackages=true -showWeaveInfo" >
>>                <include within="<something>..*"/>
>>                <include within="javax.swing..*"/>
>>                <exclude within="org.jdesktop..*"/>
>>             </weaver>
>>           </aspectj>
>>
>> public aspect Wrangler {
>>     before(JComponent component):
>>         call( public String JComponent.getToolTipText(MouseEvent) )
>>         && target(component)
>>         {
>>             System.out.println("Intercepted!");
>>             //target.setToolTip("My new thing");
>>         }
>> }
>>
>> The output I get:
>> [AppClassLoader@19134f4] weaveinfo Join point
>> 'method-call(java.lang.String javax.swing.JMenuItem.getToolTipText())' in
>> Type <something>.gui.AppClientView' (AppClientView.java:596) advised by
>> before advice from '<something>.weaver.Wrangler' (Wrangler.aj:33)
>>
>> And all other calls I make myself. Changing this to execution or anything
>> like that does not help at all. No Javax.Swing classes are woven at all.
>>
>> *********************************
>> This message and any attachments (the "message") are confidential and
>> intended solely for the addressees.
>> Any unauthorised use or dissemination is prohibited.
>> Messages are susceptible to alteration.
>> France Telecom Group shall not be liable for the message if altered,
>> changed or falsified.
>> If you are not the intended addressee of this message, please cancel it
>> immediately and inform the sender.
>> ********************************
>>
>> _______________________________________________
>> aspectj-users mailing list
>> aspectj-users@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>>
>
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
>
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users


Back to the top