|[equinox-dev] Re: Eclipse Aspects|
Description: Binary data
Am 10.06.2008 um 18:37 schrieb Rowan Limb:
no - still does not work. My jar file now looks like this:
META-INF/ META-INF/MANIFEST.MF hooktest/ hooktest/MyAspects.class org/ org/aspectj/ org/aspectj/aop.xml
I assume I just have to install that bundle (although I did 'start' it
as well). When I first install it (simplebundle being already installed)
I get this:
[org.aspectj.osgi] info triggering update for re-supplementing simplebundle [org.aspectj.osgi] info supplementing simplebundle with [hooktest]
which suggests something correct is happening ?
When I start simplebundle I just get osgi> start 19 A simple bundle!
No output from the aspects.
Also tried a completely new, clean install of equinox but made no difference.
On Tue, 2008-06-10 at 17:53 +0200, Heiko Seeberger wrote:Rowan,
If we are lucky, it is indeed simple: When using aspect bundles the aop.xml file always has to be on the bundle classpath, not in the META-INF directory. According to your config.ini it has to be in a package org.aspectj. You also could put it into hooktest if you modify config.ini (org.aspectj.weaver.loadtime.configuration=hooktest), but I would not do that (Best practice: Use always one and the same package).
Give it a try and let me know ...
Your aop.xml has to be in a org.aspectj package, not in the META-INF directory. It always has to be on the bundle classpath and must match a package
2008/6/10 Rowan Limb <rowan.limb@xxxxxx>: Heiko,
I'm sure you are right and we can crack this. I am also sure it is something simple that I have missed.
Anyway, attached is a zip file of src, manifest files and an aop.xml. Also in there is my config.ini and a text file 'screenshot' of the output of doing an 'ss' in the equinox console.
When I install simplebundle and simple-aspects in equinox and start simplebundle I get this on the console:
osgi> start 63 A simple bundle!
When I use aspectj on the commandline with the same jar files I get this:
simplebundle/simplebundle.jar:simple-aspects/simple- aspects.jar:/opt/aspectj1.6/lib/aspectjrt.jar simple.Simple
advice after Simple constructor
Before Simple println()
A simple bundle!
I saw a thread describing a similar problem on eclipsezone:
Martin Lippert answered (in reply 5) saying: Just implement your aspect inside a bundle, define the aop.xml file and "Eclipse-SupplementBundle: *" in the manifest. Thats it.
Annoyingly the original poster said the problem was solved but didn't say what the solution was!
I really appreciate you taking the time to help me on this.
On Tue, 2008-06-10 at 05:59 +0200, Heiko Seeberger wrote:for you toHi Rowan,
Don't get frustrated, we will get that thing running. I cannot see any mistakes "from here". Would it be possiblerecently asked aexport your sources and send them to me?
Am 09.06.2008 um 18:50 schrieb Rowan Limb:
I hope you don't mind me contacting you directly. Ieclipsequestion on the eclipse-dev message list regarding runningin eclipse).aspects in a standalone instance of equinox (rather thanrequests forYou were kind enough to respond and invite furthernot easyhelp. I am getting increasingly frustrated and the message list isemail.for me to use due to restrictions at work, hence my direct(simple 'hello
Progress so far:
I can get aspects to work in equinox if the java codejust aspectj onworld') AND the aspects are in one bundle.
I can get the aspects to work outside of equinox usingfile and thethe commandline with the 'hello world' code in one jarnothingaspects in a separate jar file. (this proves to me there'sseparate bundlewrong with the basic setup or my aspects definitions.
What I can not get to work is running the aspects as a- startsin equinox. I have one bundle for the 'hello world' codeinstalls and I canfine and prints to console. The separate aspects bundlewhen I startstart/stop it (not sure if I should need to do this) butdefine 2the hello world bundle nothing extra happens (my aspectsmethod callpointcuts, one for a constructor of a class and one for aconstructor andwhich will print a suitable message if 'trapped'. Bothconsole:method are in the 'hello world' bundle.
My manifest for the aspects bundle looks like this:
Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Simple Aspects Co-opt Bundle-SymbolicName: hooktest Bundle-Version: 1.0.0 Bundle-Localization: plugin Export-Package: hooktest,org.aspectj Require-Bundle: org.aspectj.runtime;visibility:=reexport Eclipse-SupplementBundle: * Bundle-ClassPath: .
When I first install the aspects bundle I get this at there-supplementing
[org.aspectj.osgi] info triggering update for[hooktest]javax.servlet [org.aspectj.osgi] info supplementing javax.servlet withre-supplementing[org.aspectj.osgi] info triggering update fororg.eclipse.osgi.services withorg.eclipse.osgi.services [org.aspectj.osgi] info supplementingre-supplementing[hooktest] [org.aspectj.osgi] info triggering update forwithorg.aspectj.runtime [org.aspectj.osgi] info supplementing org.aspectj.runtimere-supplementing[hooktest] [org.aspectj.osgi] info triggering update forwithorg.mortbay.jetty [org.aspectj.osgi] info supplementing org.mortbay.jettyre-supplementing[hooktest] [org.aspectj.osgi] info triggering update fororg.apache.commons.logging withorg.apache.commons.logging [org.aspectj.osgi] info supplementingre-supplementing[hooktest] [org.aspectj.osgi] info triggering update forwithorg.aspectj.weaver [org.aspectj.osgi] info supplementing org.aspectj.weaverre-supplementing[hooktest] [org.aspectj.osgi] info triggering update for[hooktest]simplebundle [org.aspectj.osgi] info supplementing simplebundle withthe console.
Note that simplebundle is my 'hello world' bundle.
I do not get any messages in the equinox log file or intried both 1.5
I am using org.aspectj.osgi_188.8.131.52803102211 and I'veto the bestand 1.6 of the aspectj runtime/weaver jar files.
I have looked at the slides you suggested looking at andorg.aspectjof my knowledge have followed what it says there.
I have tried placing the aop.xml file in META-INF and insuggestions wouldbut it makes not difference.
I really want to get this to work, any pointers orconfidential. Thebe much appreciated.
-- Rowan Limb Senior Researcher, Pervasive ICT Research Centre BT Group Chief Technology Office ___________________________ Office: 01473 640872 Mobile: Email: rowan.limb@xxxxxx
British Telecommunications plc Registered office: 81 Newgate Street London EC1A 7AJ Registered in England no. 1800000
This electronic message contains information from British Telecommunications plc which may be privileged orindividual(s) orinformation is intended to be for the use of theaware that anyentity named above. If you are not the intended recipient beof thisdisclosure, copying, distribution or use of the contentselectronicinformation is prohibited. If you have received thisnumbers ormessage in error, please notify us by telephone or email (to theemail system isaddress above) immediately.
Activity and use of the British Telecommunications plclawfulmonitored to secure its effective operation and for otheralso bebusiness purposes. Communications using this system willoperation and formonitored and may be recorded to secure effectiveother lawful business purposes.