Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Spring contexts and aspectj weaver
Spring contexts and aspectj weaver [message #933934] Fri, 05 October 2012 13:27 Go to next message
Charlie Mordant is currently offline Charlie MordantFriend
Messages: 88
Registered: July 2010
Member

Hi,

I think I pointed out a bug on an eclipse bundle or any other osgi-weaving feature.

As said in another post, I integrated Aspectj weaving with Virgo this way:

* Putting equinox weaving hook in the lib folder
* Adding osgi.framework.extensions=org.eclipse.equinox.weaving.hook in the config.ini
* Adding file:lib/org.eclipse.equinox.weaving.hook_1.0.200.I20120427-0800.jar in the base bundles of the userregion
* com.springsource.org.aspectj.weaver;bundle-version="0" in the bundle-import section
* org.eclipse.equinox.service.weaving;version="0",\ in the package import section
* repository:bundle/org.eclipse.equinox.weaving.aspectj, repository:bundle/org.eclipse.equinox.weaving.caching.j9 in the initial-artifacts section

Weaving works fine (I can use @Configurable), here's my aop.xml:
<!DOCTYPE aspectj PUBLIC
        "-//AspectJ//DTD//EN" "http://www.eclipse.org/aspectj/dtd/aspectj.dtd">
<aspectj>
	<weaver options="-verbose -debug">
		<!-- only weave classes in our application-specific packages -->
		<include within="net.osgiliath.view.main..*" />

	</weaver>
</aspectj>

MANIFEST:
Require-Bundle: com.springsource.org.aspectj.weaver;visibility:="reexport"
Import-Package: 
 org.springframework.beans.factory,
 org.springframework.integration.config.annotation,
 org.springframework.integration.aop,
 org.springframework.integration.transformer,
 net.osgiliath.login.factory,
 org.springframework.context.config,
 org.eclipse.gemini.blueprint.config,
 org.springframework.security.config,
 org.springframework.beans.factory.aspectj,
 org.springframework.beans.factory.annotation,
 org.springframework.beans.factory,
 org.springframework.beans.factory.wiring,
 org.springframework.beans,
 org.springframework.core,
 org.springframework.context.weaving

And my META-INF/spring/context.xml:

<context:annotation-config />
	<context:spring-configured />
	 <context:load-time-weaver aspectj-weaving="autodetect" />
	 <context:component-scan base-package="net.osgiliath.view" />



It works fine in a simple bundle.

The problem is when this bundle reference an other spring-dm/configurable powered bundle: all the beans defined in the second bundle (and scanned) are not resolved, giving me a nosuchbeandefinitionexception and resolves the beans of the first bundle (for example, it tries to wire the spring integration channels defined in the first bundle!)!

The log shows that it only scannned the first bundle META-INF/spring directory...


I'm I wrong on something, or is this a bug?

If it is, where do I create a ticket ?

Regards,

[Updated on: Fri, 05 October 2012 13:31]

Report message to a moderator

Re: Spring contexts and aspectj weaver [message #940361 is a reply to message #933934] Thu, 11 October 2012 15:07 Go to previous message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
If I've understood correctly, you're saying that you have two bundles, let's call them A and B, and they both start fine, but when you add a reference (import-package? import-bundle? require-bundle? fragment-host? or what?) from A to B, then B stops working. If so, that feels like a bug, except perhaps if you used fragment-host as then the two bundles could interfere with each other.

You case raise bugs on bugzilla.
Previous Topic:Virgo JVM not started using -server parameter
Next Topic: Virgo Tomcat Server 3.5.0 repository host returns 404
Goto Forum:
  


Current Time: Fri Apr 26 23:00:51 GMT 2024

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

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

Back to the top