Spring contexts and aspectj weaver [message #933934] |
Fri, 05 October 2012 13:27 |
|
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
|
|
|
|
Powered by
FUDForum. Page generated in 0.04418 seconds