Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » AspectJ LTW on Virgo 3.6.2
icon5.gif  AspectJ LTW on Virgo 3.6.2 [message #1067659] Tue, 09 July 2013 20:29 Go to next message
Rigas Grigoropoulos is currently offline Rigas GrigoropoulosFriend
Messages: 9
Registered: November 2012
Junior Member
I am trying to get AspectJ LTW working on Virgo (3.6.2.RELEASE on JRE 1.6.0_37). The aspect and classes to weave are contained in the same bundle. Other topics in the forum suggest that getting this working is as simple as setting <context:load-time-weaver aspectj-weaving="on"/> or configuring Virgo to run with the equinox weaving hooks when weaving aspects contained in a different bundle. I have tried various combinations with no luck.
I attach a simple project which works properly when run as a JUnit test but when I deploy it as a bundle I get the "Found load-time weaver bean for bundle ... Switching to ServerLoadTimeWeaver" but the aspect is not called.
What am I doing wrong?
  • Attachment: LTW.zip
    (Size: 8.41KB, Downloaded 136 times)
Re: AspectJ LTW on Virgo 3.6.2 [message #1069770 is a reply to message #1067659] Tue, 16 July 2013 14:17 Go to previous messageGo to next message
Florian Waibel is currently offline Florian WaibelFriend
Messages: 166
Registered: June 2010
Senior Member
Hi Rigas,

I changed your maven-bundle-plugin configuration to
				<configuration>
					<instructions>
						<Bundle-Blueprint>OSGI-INF/blueprint/blueprint.xml</Bundle-Blueprint>
						<Import-Library>
							org.springframework.spring
						</Import-Library>
						<Import-Package>
							!org.osgi.service.blueprint,
							org.aspectj.lang,
							*
						</Import-Package>
						<Export-Package>org.aaaa</Export-Package>
					</instructions>
				</configuration>



and simplyfied the consumer

	@PostConstruct
	protected void start() {
		LOG.info(this.getClass().getSimpleName() + ".start()");
		service.sayHello("Rigas");
	}


and your Aspect is called:

INFO  region-dm-1 org.aaaa.impl.HelloWorldServiceConsumerImpl                       HelloWorldServiceConsumerImpl.start()
ERROR region-dm-1 System.err    [KernelBundleClassLoader@492396a8] debug weaving 'org.aaaa.impl.Aspects'
INFO  region-dm-1 org.aaaa.impl.Aspects                                             sayHello called
INFO  region-dm-1 org.aaaa.impl.HelloWorldServiceImpl                               sayHello: Rigas


Hope this helps,
florian
Re: AspectJ LTW on Virgo 3.6.2 [message #1070348 is a reply to message #1069770] Wed, 17 July 2013 19:41 Go to previous message
Florian Waibel is currently offline Florian WaibelFriend
Messages: 166
Registered: June 2010
Senior Member
Inspired by your LTW.zip I have put together an example on GitHUB

Previous Topic:Installing bundle via plan fails
Next Topic:schema resolution
Goto Forum:
  


Current Time: Sat Apr 27 04:13:00 GMT 2024

Powered by FUDForum. Page generated in 0.03338 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top