Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Virgo imports merge problem: is it a bug?
Virgo imports merge problem: is it a bug? [message #722986] Wed, 07 September 2011 11:29 Go to next message
Alexey Romanov is currently offline Alexey Romanov
Messages: 263
Registered: May 2010
Senior Member
I have two bundles:

1. ru.focusmedia.jump-osgi, version 0.2.3:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: ru.focusmedia.jump-osgi
Bundle-SymbolicName: ru.focusmedia.jump-osgi
Bundle-Version: 0.2.3
Bundle-Vendor: focusmedia
Export-Package: ru.focusmedia.jump,ru.focusmedia.jump.annotation,ru.fo
 cusmedia.jump.binding,ru.focusmedia.jump.binding.impl,ru.focusmedia.j
 ump.binding.impl.headers,ru.focusmedia.jump.binding.impl.presencer,ru
 .focusmedia.jump.binding.impl.types,ru.focusmedia.jump.binding.spi,ru
 .focusmedia.jump.protocol,ru.focusmedia.jump.protocol.impl,ru.focusme
 dia.jump.protocol.spi
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Package: org.apache.mina.core.buffer;version="2.0.2",org.apache
 .mina.core.file;version="2.0.2",org.apache.mina.core.filterchain;vers
 ion="2.0.2",org.apache.mina.core.future;version="2.0.2",org.apache.mi
 na.core.polling;version="2.0.2",org.apache.mina.core.service;version=
 "2.0.2",org.apache.mina.core.session;version="2.0.2",org.apache.mina.
 core.write;version="2.0.2",org.slf4j;version="1.5.6",ru.focusmedia.co
 mms.binary,ru.focusmedia.comms.buffer


2. ru.focusmedia.poim-protocol, version 2.0.1. It wraps jump-0.2.3.jar (because it's also used in non-OSGi context), and both imports and exports jump packages, as described at OSGi Alliance blog:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: POIM_Protocol
Bundle-SymbolicName: ru.focusmedia.poim-protocol;singleton:=true
Bundle-Version: 2.0.1
Bundle-ClassPath: POIM_Protocol.jar,
 lib/jump-0.2.3.jar
Export-Package: ru.focusmedia.jump;version="0.2.3",
 ru.focusmedia.jump.annotation;version="0.2.3",
 ru.focusmedia.jump.binding;version="0.2.3",
 ru.focusmedia.jump.binding.impl;version="0.2.3",
 ru.focusmedia.jump.binding.impl.headers;version="0.2.3",
 ru.focusmedia.jump.binding.impl.presencer;version="0.2.3",
 ru.focusmedia.jump.binding.impl.types;version="0.2.3",
 ru.focusmedia.jump.binding.spi;version="0.2.3",
 ru.focusmedia.jump.protocol;version="0.2.3",
 ru.focusmedia.jump.protocol.impl;version="0.2.3",
 ru.focusmedia.jump.protocol.spi;version="0.2.3",
 ru.focusmedia.odp.poim.protocol,
 ru.focusmedia.odp.poim.protocol.requests,
 ru.focusmedia.odp.poim.protocol.responses
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Require-Bundle: org.apache.mina.core;bundle-version="2.0.2",
 ru.focusmedia.comms-osgi;bundle-version="1.0.0"
Bundle-Vendor: Focus Media
Import-Package: org.slf4j;version="1.6.1",
 ru.focusmedia.jump;version="[0.2.3,0.2.3]",
 ru.focusmedia.jump.annotation;version="[0.2.3,0.2.3]",
 ru.focusmedia.jump.binding;version="[0.2.3,0.2.3]",
 ru.focusmedia.jump.binding.impl;version="[0.2.3,0.2.3]",
 ru.focusmedia.jump.binding.impl.headers;version="[0.2.3,0.2.3]",
 ru.focusmedia.jump.binding.impl.presencer;version="[0.2.3,0.2.3]",
 ru.focusmedia.jump.binding.impl.types;version="[0.2.3,0.2.3]",
 ru.focusmedia.jump.binding.spi;version="[0.2.3,0.2.3]",
 ru.focusmedia.jump.protocol;version="[0.2.3,0.2.3]",
 ru.focusmedia.jump.protocol.impl;version="[0.2.3,0.2.3]",
 ru.focusmedia.jump.protocol.spi;version="[0.2.3,0.2.3]"


Now, when I have a package which depends on both of them, I get this exception:
[2011-09-07 15:22:42.937]  TCP Connection(2)-127.0.0.1 <DE0002E> Installation of plan 'pshd.plan' version '3.2.0' failed. org.eclipse.virgo.kernel.deployer.core.DeploymentException: Error merging expanded imports for [bundle 'pshd.plan-3.2-ru.focusmedia.odp.pshd.jpa' version '3.2.0' in scope 'pshd.plan-3.2', bundle 'pshd.plan-3.2-ru.focusmedia.odp.ssd.db' version '3.2.0' in scope 'pshd.plan-3.2', bundle 'pshd.plan-3.2-synthetic.context' version '3.2.0' in scope 'pshd.plan-3.2', bundle 'pshd.plan-3.2-ru.focusmedia.poim-protocol' version '2.0.1' in scope 'pshd.plan-3.2', bundle 'pshd.plan-3.2-ru.focusmedia.odp.pshd.video' version '3.2.0' in scope 'pshd.plan-3.2', bundle 'pshd.plan-3.2-ru.focusmedia.odp.poim.server' version '3.2.0' in scope 'pshd.plan-3.2', bundle 'pshd.plan-3.2-ru.focusmedia.odp.ssd' version '3.1.0' in scope 'pshd.plan-3.2']
	at org.eclipse.virgo.kernel.deployer.core.internal.ImportExpandingTransformer.expandImports(ImportExpandingTransformer.java:112)
	at org.eclipse.virgo.kernel.deployer.core.internal.ImportExpandingTransformer.expandImportsOfBundlesInScopedPlan(ImportExpandingTransformer.java:89)
	at org.eclipse.virgo.kernel.deployer.core.internal.ImportExpandingTransformer$ImportExpandingTreeVisitor.visit(ImportExpandingTransformer.java:76)
	at org.eclipse.virgo.util.common.ThreadSafeArrayListTree.visit(ThreadSafeArrayListTree.java:165)
	at org.eclipse.virgo.kernel.deployer.core.internal.ImportExpandingTransformer.transform(ImportExpandingTransformer.java:58)
	at org.eclipse.virgo.kernel.install.pipeline.stage.transform.internal.TransformationStage.doProcessTree(TransformationStage.java:55)
	at org.eclipse.virgo.kernel.install.pipeline.stage.AbstractPipelineStage.process(AbstractPipelineStage.java:41)
	at org.eclipse.virgo.kernel.install.pipeline.internal.StandardPipeline.doProcessTree(StandardPipeline.java:62)
	at org.eclipse.virgo.kernel.install.pipeline.internal.CompensatingPipeline.doProcessTree(CompensatingPipeline.java:72)
	at org.eclipse.virgo.kernel.install.pipeline.stage.AbstractPipelineStage.process(AbstractPipelineStage.java:41)
	at org.eclipse.virgo.kernel.install.pipeline.internal.StandardPipeline.doProcessTree(StandardPipeline.java:62)
	at org.eclipse.virgo.kernel.install.pipeline.stage.AbstractPipelineStage.process(AbstractPipelineStage.java:41)
	at org.eclipse.virgo.kernel.deployer.core.internal.PipelinedApplicationDeployer.driveInstallPipeline(PipelinedApplicationDeployer.java:271)
	at org.eclipse.virgo.kernel.deployer.core.internal.PipelinedApplicationDeployer.doInstall(PipelinedApplicationDeployer.java:151)
	at org.eclipse.virgo.kernel.deployer.core.internal.PipelinedApplicationDeployer.install(PipelinedApplicationDeployer.java:123)
	at org.eclipse.virgo.kernel.deployer.core.internal.PipelinedApplicationDeployer.deploy(PipelinedApplicationDeployer.java:190)
	at org.eclipse.virgo.kernel.deployer.management.StandardDeployer.deploy(StandardDeployer.java:52)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenReturn(ConvertingMethod.java:167)
	at com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIntrospector.java:96)
	at com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIntrospector.java:33)
	at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:208)
	at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:120)
	at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:262)
	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
	at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
	at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1427)
	at javax.management.remote.rmi.RMIConnectionImpl.access$200(RMIConnectionImpl.java:72)
	at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1265)
	at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1360)
	at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:788)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
	at sun.rmi.transport.Transport$1.run(Transport.java:159)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:662)
Caused by: org.eclipse.virgo.kernel.osgi.framework.ImportMergeException: cannot merge imports of package 'ru.focusmedia.jump.protocol.spi' from sources 'Import-Library 'org.springframework.spring' version '3.0.0.RELEASE'(null), Import-Bundle 'ru.focusmedia.jump-osgi' version '0.2.3', Import-Bundle 'pshd.plan-3.2-ru.focusmedia.poim-protocol' version '2.0.1'' because of disjoint bundle version ranges [2.0.1, 2.0.1] and [0.2.3, 0.2.3]
	at org.eclipse.virgo.kernel.userregion.internal.importexpansion.AbstractTrackedPackageImports.mergeBundleVersionRanges(AbstractTrackedPackageImports.java:219)
	at org.eclipse.virgo.kernel.userregion.internal.importexpansion.AbstractTrackedPackageImports.mergeAttributes(AbstractTrackedPackageImports.java:138)
	at org.eclipse.virgo.kernel.userregion.internal.importexpansion.AbstractTrackedPackageImports.mergePackageImport(AbstractTrackedPackageImports.java:119)
	at org.eclipse.virgo.kernel.userregion.internal.importexpansion.AbstractTrackedPackageImports.doMerge(AbstractTrackedPackageImports.java:104)
	at org.eclipse.virgo.kernel.userregion.internal.importexpansion.AbstractTrackedPackageImports.merge(AbstractTrackedPackageImports.java:79)
	at org.eclipse.virgo.kernel.userregion.internal.importexpansion.ImportExpansionHandler.getAdditionalPackageImports(ImportExpansionHandler.java:235)
	at org.eclipse.virgo.kernel.userregion.internal.importexpansion.ImportExpansionHandler.expandImports(ImportExpansionHandler.java:206)
	at org.eclipse.virgo.kernel.userregion.internal.importexpansion.ImportExpansionHandler.expandImportsIfNecessary(ImportExpansionHandler.java:174)
	at org.eclipse.virgo.kernel.userregion.internal.importexpansion.ImportExpansionHandler.expandImports(ImportExpansionHandler.java:112)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
	at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:58)
	at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:62)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
	at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
	at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:56)
	at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:39)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
	at org.springframework.osgi.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:59)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
	at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
	at $Proxy63.expandImports(Unknown Source)
	at org.eclipse.virgo.kernel.deployer.core.internal.ImportExpandingTransformer.expandImports(ImportExpandingTransformer.java:107)
	... 47 common frames omitted

But it seems to me disjoint bundle versions shouldn't matter: the package versions can be merged and that should be enough. Is this correct?

[Updated on: Wed, 07 September 2011 11:31]

Report message to a moderator

Re: Virgo imports merge problem: is it a bug? [message #722992 is a reply to message #722986] Wed, 07 September 2011 11:43 Go to previous messageGo to next message
Chris Frost is currently offline Chris Frost
Messages: 230
Registered: January 2010
Location: Southampton, England
Senior Member

Hi,

Your versions are not disjoint, as 'ru.focusmedia.jump-osgi' does not give versions for it's export packages they will use the bundle version. So to use the package form the logs, both bundles are exporting 'ru.focusmedia.jump.protocol.spi' at version 0.2.3 as well as several other packages. This is generally referred to as the 'split-packages' problem.

Chris.


------------------------------------------------
Chris Frost, Twitter @cgfrost
Springsource, a divison of VMware.
Re: Virgo imports merge problem: is it a bug? [message #722998 is a reply to message #722992] Wed, 07 September 2011 11:58 Go to previous message
Alexey Romanov is currently offline Alexey Romanov
Messages: 263
Registered: May 2010
Senior Member
Ah, here is an explanation: https://bugs.eclipse.org/bugs/show_bug.cgi?id=330643 The problem was using Import-Bundle for both bundles. The error message is still a bit misleading, IMHO...

[Updated on: Wed, 07 September 2011 12:14]

Report message to a moderator

Previous Topic:Corrupt bean cache? Autowiring fails.
Next Topic:"jmxPermissions.vbs(23, 2) SWbemServicesEx: Not found"
Goto Forum:
  


Current Time: Sun Oct 26 04:40:25 GMT 2014

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

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