Hi,
i am struggling with the installation of a Spring DM based application into the Virgo server. The application is created using the following configuration:
Eclipse 3.7.2
Spring OSGI 1.2.1 with the dependent spring framework bundles 2.5.6
It works just fine when started from within eclipse as an OSGI Framework. My intention was to deploy the application in a tomcat server using the equinox servlet bridge. Then I thought I could as well use the Virgo server. But I have a hard time getting a proper configuration for the virgo.
In order to provide a spring managed webservice I use the eclipse servlet registry extension to add a spring dispatcher servlet. For some reasons this application bundle explicitly depends on some spring bundles (e.g. org.springframework.web).
Now the problem is that Virgo is not able to resolve the dependency. I get the following error message:
[2012-05-11 09:19:50.685] fs-watcher <DE0002E> Installation of plan 'xxx.server.plan' version '1.0.0' failed. org.eclipse.vir
el.osgi.framework.UnableToSatisfyBundleDependenciesException: Unable to satisfy dependencies of bundle 'xxx.server' at version '1.0.0': Cannot
e: xxx.server
Resolver report:
A Require-Bundle could not be resolved because of a uses directive conflict. Caused by missing constraint in bundle <xxx.server_1.0.0>
constraint: <Require-Bundle: org.springframework.context; bundle-version="[2.5.6]">
A Require-Bundle could not be resolved because of a uses directive conflict. Caused by missing constraint in bundle <xxx.server_1.0.0>
constraint: <Require-Bundle: org.springframework.aop; bundle-version="[2.5.6]">
A Require-Bundle could not be resolved because of a uses directive conflict. Caused by missing constraint in bundle <xxx.server_1.0.0>
constraint: <Require-Bundle: org.springframework.web; bundle-version="[2.5.6]">
<?xml version="1.0" encoding="UTF-8"?>
<plan name="xxx.server.plan" version="1.0.0" scoped="false" atomic="true"
xmlns="http://www.eclipse.org/virgo/schema/plan"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.eclipse.org/virgo/schema/plan
http://www.eclipse.org/virgo/schema/plan/eclipse-virgo-plan.xsd">
<artifact type="bundle" name="xxx.server" version="[1.0.0, 1.0.0]"/>
</plan>
From what I have read in the Virgo User Guide, the Virgo Spring bundles are part of the kernel and cannot be used from the user region. I have tried to put the respective bundles into the usr repository and load them via the org.eclipse.virgo.kernel.userregion.properties.initialArtifacts. I see the following output when starting virgo:
[2012-05-11 09:42:37.107] system-artifacts <DE0000I> Installing bundle 'org.eclipse.equinox.http.registry' version '1.1.100.v2011050
[2012-05-11 09:42:37.279] system-artifacts <DE0001I> Installed bundle 'org.eclipse.equinox.http.registry' version '1.1.100.v20110502
[2012-05-11 09:42:37.310] system-artifacts <DE0004I> Starting bundle 'org.eclipse.equinox.http.registry' version '1.1.100.v20110502'
[2012-05-11 09:42:37.325] start-signalling-2 <DE0005I> Started bundle 'org.eclipse.equinox.http.registry' version '1.1.100.v20110502'.
[2012-05-11 09:42:37.638] system-artifacts <DE0000I> Installing bundle 'org.eclipse.core.runtime' version '3.7.0.v20110110'.
[2012-05-11 09:42:37.763] system-artifacts <DE0001I> Installed bundle 'org.eclipse.core.runtime' version '3.7.0.v20110110'.
[2012-05-11 09:42:37.779] system-artifacts <DE0004I> Starting bundle 'org.eclipse.core.runtime' version '3.7.0.v20110110'.
[2012-05-11 09:42:37.779] start-signalling-2 <DE0005I> Started bundle 'org.eclipse.core.runtime' version '3.7.0.v20110110'.
[2012-05-11 09:42:39.810] system-artifacts <DE0000I> Installing bundle 'org.springframework.web' version '3.0.5.RELEASE'.
[2012-05-11 09:42:39.857] system-artifacts <DE0001I> Installed bundle 'org.springframework.web' version '3.0.5.RELEASE'.
[2012-05-11 09:42:39.872] system-artifacts <DE0004I> Starting bundle 'org.springframework.web' version '3.0.5.RELEASE'.
[2012-05-11 09:42:39.872] start-signalling-2 <DE0005I> Started bundle 'org.springframework.web' version '3.0.5.RELEASE'.
[2012-05-11 09:42:44.185] system-artifacts <DE0000I> Installing bundle 'org.springframework.context' version '3.0.5.RELEASE'.
[2012-05-11 09:42:44.247] system-artifacts <DE0001I> Installed bundle 'org.springframework.context' version '3.0.5.RELEASE'.
[2012-05-11 09:42:44.263] system-artifacts <DE0004I> Starting bundle 'org.springframework.context' version '3.0.5.RELEASE'.
[2012-05-11 09:42:44.263] start-signalling-2 <DE0005I> Started bundle 'org.springframework.context' version '3.0.5.RELEASE'.
[2012-05-11 09:42:46.872] system-artifacts <DE0000I> Installing bundle 'org.springframework.aop' version '3.0.5.RELEASE'.
[2012-05-11 09:42:46.903] system-artifacts <DE0001I> Installed bundle 'org.springframework.aop' version '3.0.5.RELEASE'.
[2012-05-11 09:42:46.919] system-artifacts <DE0004I> Starting bundle 'org.springframework.aop' version '3.0.5.RELEASE'.
[2012-05-11 09:42:46.934] start-signalling-2 <DE0005I> Started bundle 'org.springframework.aop' version '3.0.5.RELEASE'.
[2012-05-11 09:42:47.466] system-artifacts <DE0000I> Installing bundle 'org.springframework.osgi.web' version '1.2.1'.
[2012-05-11 09:42:47.497] system-artifacts <DE0001I> Installed bundle 'org.springframework.osgi.web' version '1.2.1'.
[2012-05-11 09:42:47.513] system-artifacts <DE0004I> Starting bundle 'org.springframework.osgi.web' version '1.2.1'.
[2012-05-11 09:42:47.513] start-signalling-2 <DE0005I> Started bundle 'org.springframework.osgi.web' version '1.2.1'.
[2012-05-11 09:42:48.981] system-artifacts <DE0000I> Installing bundle 'com.springsource.net.sf.cglib' version '2.1.3'.
[2012-05-11 09:42:48.997] system-artifacts <DE0001I> Installed bundle 'com.springsource.net.sf.cglib' version '2.1.3'.
[2012-05-11 09:42:49.012] system-artifacts <DE0004I> Starting bundle 'com.springsource.net.sf.cglib' version '2.1.3'.
[2012-05-11 09:42:49.012] start-signalling-2 <DE0005I> Started bundle 'com.springsource.net.sf.cglib' version '2.1.3'.
First thing I notice is that instead of installing my versions of the spring framework bundles (provided via the usr repository), the kernel bundles are installed. But at least they are installed. Since I have not specified a maximum version for my dependent spring bundles I would expect the kernel bundles to resolve the dependency. I have also tried to set a max version for my dependent spring bundles. I tried [2.5.6, 4.0.0). Same result. I have tried to load the dependent spring bundles within my application plan. If I add for example
<artifact type="bundle" name="org.springframework.context" version="[2.5.6]"/>
I get the following error:
[2012-05-11 09:50:28.926] fs-watcher <HD0002E> Hot deploy failed for file 'xxx.server.plan'. org.eclipse.virgo.kernel.deploye
DeploymentException: Cannot determine the artifact identity of the file 'C:\PROGRA~2\VIRGO-~2.REL\pickup\xxx.server.plan'
at org.eclipse.virgo.kernel.install.artifact.internal.StandardInstallArtifactTreeInclosure.determineIdentity(StandardInstallArtifactTreeInclosure
40)
If I add the same without a version restriction
<artifact type="bundle" name="org.springframework.context"/>
The kernel bundle is loaded but I still get the same error as stated above, indicating the Virgo is "Unable to satisfy dependencies of bundle".
Now I am left without any idea and I would be glad If someone could enlighten me on the question how to get the Virgo configured for user region usage of Spring/Spring DM.
Regards,
Thorsten