Timing on deploying a Plan [message #926403] |
Fri, 28 September 2012 16:19 |
Justin Stewart Messages: 6 Registered: September 2012 |
Junior Member |
|
|
Hi, all -
I have a simple plan file that deploys 7 subsystem bundles, each of which exposes and references services.
<?xml version="1.0" encoding="UTF-8"?>
<plan name="my.plan" version="1.0.0" scoped="false" atomic="true">
<artifact type="bundle" name="interfaces.internal" version="0"/>
<artifact type="bundle" name="subsystems.data" version="0"/>
<artifact type="bundle" name="subsystems.settings" version="0"/>
<artifact type="bundle" name="subsystems.aaa" version="0"/>
<artifact type="bundle" name="subsystems.devices" version="0"/>
<artifact type="bundle" name="subsystems.restful" version="0"/>
<artifact type="bundle" name="subsystems.mitigation" version="0"/>
<artifact type="bundle" name="subsystems.web" version="0"/>
</plan>
Unfortunately, it is not working - the errors seem to indicate a race condition, since they are not determinate (they change with each run). But they're all similar to this:
[2012-09-28 09:49:23.970] region-dm-9 <AG0000E> Application context creation failure for bundle 'subsystems.aaa' version '1.0.0.SNAPSHOT'. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'aaaSubsystemImpl' defined in URL [file:/opt/virgo-tomcat-server/work/org.eclipse.virgo.kernel.deployer_3.5.0.RELEASE/staging/global/bundle/subsystems.aaa/1.0.0.SNAPSHOT/aaa-1.0.0.SNAPSHOT.jar/subsystems/aaa/AaaSubsystemImpl.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [subsystems.aaa.AaaSubsystemImpl]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'subsystems.aaa.AaaSubsystemImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private interfaces.internal.subsystems.aaa.GroupsDataSource subsystems.aaa.AaaSubsystemImpl.groupsDataSource; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [interfaces.internal.subsystems.aaa.GroupsDataSource] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:965)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:911)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
Sometimes the error refers to a different bundle, but it's the same scenario - a service one bundle has published to Virgo cannot be autowired to another bundle that is referencing it. (Note that I don't have any cyclic service usage.)
However, if instead of using the plan file, I copy each bundle (in the same order) to the Virgo pickup directory with a five second delay between each bundle deploy, I see no errors and the application works just fine.
With the plan file, it's almost like the services of each bundle don't have time to be registered and initialized before they are referenced - and thus the autowiring problem.
Is there something I'm missing or is this a known issue?
Thanks.
Justin
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02109 seconds