[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[virgo-dev] Virgo Snaps Question

Hi,
 I was wondering if anyone has used applicationContext.xml within a snap.
I have been trying to pull in some OSGI services to be autowired to my
MVC controller in a snap but it doesn't appear to be finding the OSGi
service when it trys to create the controller.

 Just curious if it is just me or if anyone else has tried this.

Thanks,

~Patsy

I do have the following in the web.xml of the snap:

   <listener>
                <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
        </listener>

        <context-param>
                <param-name>contextClass</param-name>
                <param-value>org.eclipse.virgo.web.dm.ServerOsgiBundleXmlWebApplicationContext</param-value>
        </context-param>

and I use the file applicationContext.xml in the WEB-INF folder with an
osgi:reference in it for my service. The interface used by my service is
org.jnode.driver.DeviceManager (in the error below).

When I look in the Virgo console, there is no sign of the snap consuming
the requested service and I am seeing the following error in the logs:

Context initialization failed org.springframework.beans.fac
tory.UnsatisfiedDependencyException: Error creating bean with name
'nodeController' defined in file
[/Users/pphelan/development/virgo/virgo-web-server-2.1.0.RELEASE/work/osgi/confi
guration/org.eclipse.osgi/bundles/36/data/store/org.eclipse.osgi/bundles/100/1/bundlefile/WEB-INF/classes/org/pouzinsociety/web/console/devices/NodeController.class]:
Unsatisfied d
ependency expressed through constructor argument with index 0 of type
[org.jnode.driver.DeviceManager]: : No matching bean of type
[org.jnode.driver.DeviceManager] found for depend
ency: expected at least 1 bean which qualifies as autowire candidate for
this dependency. Dependency annotations: {}; nested exception is
org.springframework.beans.factory.NoSuchBe
anDefinitionException: No matching bean of type
[org.jnode.driver.DeviceManager] found for dependency: expected at least 1
bean which qualifies as autowire candidate for this depen
dency. Dependency annotations: {}