Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » conflicting values of bundle-symbolic-name(Deploying a *.plan yields error that two bundle-symbolic-name's are in conflict)
conflicting values of bundle-symbolic-name [message #754710] Thu, 03 November 2011 23:03 Go to next message
Geoffry Roberts is currently offline Geoffry RobertsFriend
Messages: 29
Registered: March 2011
Junior Member
All,

Why is there a conflict?

Thanks


I attempted to deploy my first Plan. It's throwing a error that doesn't make sense.

The error:

Caused by: org.eclipse.virgo.kernel.osgi.framework.ImportMergeException: cannot merge imports of package 'ca.uhn.hl7v2.model.v25.datatype'
from sources 'Import-Bundle 'obh.plan-1-hapi.base' version '1.0.0.201111031406', Import-Bundle 'obh.plan-1-hapi.v25-12' version '1.0.0.201111031406''
because of conflicting values 'obh.plan-1-hapi.v25-12', 'obh.plan-1-hapi.base' of attribute 'bundle-symbolic-name'

What is meant by "conflicting values" if the names of the two bundles in question are different?

To wit -- from the manifests:
Bundle-SymbolicName: hapi.base
Bundle-SymbolicName: hapi.v25-12


I've included the full text of the manifests below followed by the contents of the file obh.plan.


The manifest from hapi.base:

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: HapiBase
Bundle-SymbolicName: hapi.base
Bundle-Version: 1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Export-Package: ca.uhn.hl7v2;uses:="ca.uhn.hl7v2.model",
 ca.uhn.hl7v2.app;
  uses:="ca.uhn.hl7v2.parser,
   javax.swing,
   ca.uhn.hl7v2.llp,
   ca.uhn.hl7v2.model",
 ca.uhn.hl7v2.conf,
 ca.uhn.hl7v2.conf.check;uses:="ca.uhn.hl7v2,ca.uhn.hl7v2.model,ca.uhn.hl7v2.conf.spec.message",
 ca.uhn.hl7v2.conf.classes.abs;uses:="ca.uhn.hl7v2.model",
 ca.uhn.hl7v2.conf.classes.exceptions,
 ca.uhn.hl7v2.conf.parser;uses:="ca.uhn.hl7v2.conf.spec",
 ca.uhn.hl7v2.conf.spec;uses:="ca.uhn.hl7v2.conf.spec.usecase,ca.uhn.hl7v2.conf.spec.message",
 ca.uhn.hl7v2.conf.spec.message;uses:="ca.uhn.hl7v2.conf.spec",
 ca.uhn.hl7v2.conf.spec.usecase,
 ca.uhn.hl7v2.conf.store,
 ca.uhn.hl7v2.llp,
 ca.uhn.hl7v2.model;uses:="ca.uhn.hl7v2.parser,ca.uhn.hl7v2,ca.uhn.hl7v2.validation",
 ca.uhn.hl7v2.model.primitive;uses:="ca.uhn.hl7v2.model",
 ca.uhn.hl7v2.model.v25.datatype;uses:="ca.uhn.hl7v2.model.primitive,ca.uhn.hl7v2.model",
 ca.uhn.hl7v2.parser;
  uses:="ca.uhn.hl7v2,
   ca.uhn.hl7v2.validation,
   ca.uhn.hl7v2.model,
   org.w3c.dom",
 ca.uhn.hl7v2.preparser;uses:="ca.uhn.hl7v2.parser,org.xml.sax.helpers,org.xml.sax",
 ca.uhn.hl7v2.protocol;
  uses:="ca.uhn.hl7v2.parser,
   ca.uhn.hl7v2,
   javax.jms,
   ca.uhn.hl7v2.model",
 ca.uhn.hl7v2.protocol.impl;
  uses:="ca.uhn.hl7v2.parser,
   javax.jms,
   ca.uhn.hl7v2.protocol,
   ca.uhn.hl7v2.app,
   ca.uhn.hl7v2.model",
 ca.uhn.hl7v2.util;uses:="ca.uhn.hl7v2.parser,ca.uhn.hl7v2,ca.uhn.hl7v2.model",
 ca.uhn.hl7v2.validation;uses:="ca.uhn.hl7v2.model",
 ca.uhn.hl7v2.validation.app;uses:="ca.uhn.hl7v2.app,ca.uhn.hl7v2.model",
 ca.uhn.hl7v2.validation.impl;uses:="ca.uhn.hl7v2.validation,ca.uhn.hl7v2.model",
 ca.uhn.hl7v2.view;uses:="ca.uhn.hl7v2.parser,javax.swing,ca.uhn.hl7v2.model",
 ca.uhn.hl7v3.sourcegen,
 ca.uhn.log;uses:="org.apache.commons.logging"
Import-Package: javax.jms;version="1.1.0",
 org.apache.commons.cli,
 org.apache.commons.logging;version="1.1.1",
 org.apache.log4j;version="1.2.15",
 org.apache.xalan;version="2.7.1",
 org.apache.xerces.parsers;version="2.9.0",
 org.apache.xml.serialize;version="2.9.0",
 org.apache.xpath;version="2.7.1",
 org.jdom;version="1.1.1",
 org.jdom.input;version="1.1.1",
 org.jdom.xpath;version="1.1.1",
 org.w3c.dom



The manifest from hapi.v25-12:

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: HapiV25-12
Bundle-SymbolicName: hapi.v25-12
Bundle-Version: 1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Export-Package: ca.uhn.hl7v2.model.v25.datatype;uses:="ca.uhn.hl7v2.model",
 ca.uhn.hl7v2.model.v25.group;uses:="ca.uhn.hl7v2.parser,ca.uhn.hl7v2.model.v25.segment,ca.uhn.hl7v2.model",
 ca.uhn.hl7v2.model.v25.message;
  uses:="ca.uhn.hl7v2.parser,
   ca.uhn.hl7v2.model.v25.segment,
   ca.uhn.hl7v2.model.v25.group,
   ca.uhn.hl7v2.model",
 ca.uhn.hl7v2.model.v25.segment
Import-Package: ca.uhn.hl7v2,
 ca.uhn.hl7v2.model,
 ca.uhn.hl7v2.model.v25.datatype,
 ca.uhn.hl7v2.parser,
 ca.uhn.log,
 org.apache.commons.logging;version="1.1.1"
Require-Bundle: hapi.base



The plan file:

<?xml version="1.0" encoding="UTF-8"?>
<plan atomic="true" name="obh.plan" scoped="true" version="1.0.0" 
	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 name="org.eclipse.gemini.blueprint.io" type="bundle"/>
  <artifact name="org.eclipse.gemini.blueprint.core" type="bundle"/>
  <artifact name="org.eclipse.gemini.blueprint.extender" type="bundle"/>
  <artifact name="hapi.base" type="bundle"/>
  <artifact name="hapi.v25-12" type="bundle"/>
  <artifact name="OBHCommon" type="bundle"/>
  <artifact name="OBHUtility" type="bundle"/>
  <artifact name="OBHHL7Parser" type="bundle"/>
  <artifact name="OBHHL7ParserImpl" type="bundle"/>
  <artifact name="OBHCommand" type="bundle"/>
</plan>

Re: conflicting values of bundle-symbolic-name [message #754761 is a reply to message #754710] Fri, 04 November 2011 08:53 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
Virgo expands import-bundle into corresponding package imports and it adds the bundle symbolic name as a matching attribute on those package imports. It then merges the package imports into the manifest which contains the import-bundle header. During this merge process, Virgo checks for any "conflicts".

In this particular case, two imports are generated for the package ca.uhn.hl7v2.model.v25.datatype since it is exported by hapi.base and by hapi.v25-12. So Virgo spots that it cannot generate a package import for ca.uhn.hl7v2.model.v25.datatype which specifies bundle symbolic name matching attributes for both hapi.base and hapi.v25-12 and therefore fails the import expansion processing.

The fact that you are effectively trying to import a single package from two different bundles is the issue. This is known as a "split package" and is an anti-pattern that is best avoided. Can you combine the pieces of the package into a single bundle?

If you really must keep the split package, you'll need to use require-bundle rather than import-bundle. Require-bundle supports split packages, with lots of issues described in the OSGi core spec.

Import-bundle is Virgo's approximate equivalent of require-bundle but with clean, import-package semantics.

Hope that helps!
Re: conflicting values of bundle-symbolic-name [message #754843 is a reply to message #754761] Fri, 04 November 2011 15:15 Go to previous messageGo to next message
Geoffry Roberts is currently offline Geoffry RobertsFriend
Messages: 29
Registered: March 2011
Junior Member
Thanks Glyn.

Now that I know what's wrong it should be easy to fix. I did, however, find the error message difficult to decipher. Even upon review, having read your good explanation, I find it a bit misleading. It seems to state that the conflict is with the bundle-symbolic-name, which it is not.

Thanks again.
Re: conflicting values of bundle-symbolic-name [message #754923 is a reply to message #754843] Sat, 05 November 2011 03:56 Go to previous message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
Yes, I think the difficulty is one of "levels". In the depths of the import expansion logic, the idea of the BSNs conflicting makes sense (at least to me!), but admittedly it is not particularly helpful to an end user.

I've raised bug 362959 to look at improving the diagnostics.
Previous Topic:I Don't Get This...
Next Topic:snaps v.3.0.1 and resource servlet
Goto Forum:
  


Current Time: Sat Apr 20 15:24:25 GMT 2024

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

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

Back to the top