Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Package merge Problem(Cannot install bundles for iText1.3.4 and iText 2.1.7)
Package merge Problem [message #957293] Thu, 25 October 2012 05:52 Go to next message
Thorsten Schlathölter is currently offline Thorsten SchlathölterFriend
Messages: 312
Registered: February 2012
Location: Düsseldorf
Senior Member
Hi,
I have some OSGI bundles that use different type of iText. I am trying to install these bundles via a plan into virgo. Now I get the message, that package imports cannot be merged:

Caused by: org.eclipse.virgo.kernel.osgi.framework.ImportMergeException: cannot merge imports of package 'com.lowagie.text.pdf.hyphenation' from sources 'Import
-Bundle 'com.portigon.server.csar-1-com.portigonsource.iText-1.3.4' version '1.3.4', Import-Bundle 'com.portigon.server.csar-1-com.portigonsource.iText-2.1.7' v
ersion '2.1.7'' because of conflicting values 'com.portigon.server.csar-1-com.portigonsource.iText-2.1.7', 'com.portigon.server.csar-1-com.portigonsource.iText-
1.3.4' of attribute 'bundle-symbolic-name'


I have had the same problem with some of my own bundles. The reason was that two bundles exported the same package name. Solved it by renaming the package in one bundle. I don't want to rename the iText pacakges and I am sure that one of the features of OSGI is that same bundles can be used in different versions. Can someone explain why this does not work with virgo? And why is virgo complaining about the symbolic name (you can see in the attached manifests that it is not the same):


Here is the manifest of the first bundle:

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: iText 1.3.4
Bundle-SymbolicName: com.portigonsource.iText-1.3.4
Bundle-Version: 1.3.4
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ClassPath: .,
 lib/itext-1.3.4.jar
Export-Package: com.lowagie.bc.asn1;version="1.3.4",
 com.lowagie.text;version="1.3.4",
 com.lowagie.text.html;version="1.3.4",
 com.lowagie.text.html.simpleparser;version="1.3.4",
 com.lowagie.text.markup;version="1.3.4",
 com.lowagie.text.pdf;version="1.3.4",
 com.lowagie.text.pdf.codec;version="1.3.4",
 com.lowagie.text.pdf.codec.postscript;version="1.3.4",
 com.lowagie.text.pdf.codec.wmf;version="1.3.4",
 com.lowagie.text.pdf.fonts;version="1.3.4",
 com.lowagie.text.pdf.hyphenation;version="1.3.4",
 com.lowagie.text.rtf;version="1.3.4",
 com.lowagie.text.rtf.document;version="1.3.4",
 com.lowagie.text.rtf.document.output;version="1.3.4",
 com.lowagie.text.rtf.field;version="1.3.4",
 com.lowagie.text.rtf.graphic;version="1.3.4",
 com.lowagie.text.rtf.headerfooter;version="1.3.4",
 com.lowagie.text.rtf.list;version="1.3.4",
 com.lowagie.text.rtf.style;version="1.3.4",
 com.lowagie.text.rtf.table;version="1.3.4",
 com.lowagie.text.rtf.text;version="1.3.4",
 com.lowagie.text.xml;version="1.3.4",
 com.lowagie.text.xml.xmp;version="1.3.4",
 com.lowagie.tools;version="1.3.4",
 com.lowagie.tools.arguments,
 com.lowagie.tools.plugins


And here the other one:

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: iText
Bundle-SymbolicName: com.portigonsource.iText-2.1.7
Bundle-Version: 2.1.7
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ClassPath: lib/iText-2.1.7.jar,
 .
Export-Package: com.lowagie.text;version="2.1.7",
 com.lowagie.text.exceptions;version="2.1.7",
 com.lowagie.text.factories;version="2.1.7",
 com.lowagie.text.html;version="2.1.7",
 com.lowagie.text.html.simpleparser;version="2.1.7",
 com.lowagie.text.pdf;version="2.1.7",
 com.lowagie.text.pdf.codec;version="2.1.7",
 com.lowagie.text.pdf.codec.wmf;version="2.1.7",
 com.lowagie.text.pdf.collection;version="2.1.7",
 com.lowagie.text.pdf.crypto;version="2.1.7",
 com.lowagie.text.pdf.draw;version="2.1.7",
 com.lowagie.text.pdf.events;version="2.1.7",
 com.lowagie.text.pdf.fonts;version="2.1.7",
 com.lowagie.text.pdf.fonts.cmaps;version="2.1.7",
 com.lowagie.text.pdf.hyphenation;version="2.1.7",
 com.lowagie.text.pdf.interfaces;version="2.1.7",
 com.lowagie.text.pdf.internal;version="2.1.7",
 com.lowagie.text.pdf.parser;version="2.1.7",
 com.lowagie.text.xml;version="2.1.7",
 com.lowagie.text.xml.simpleparser;version="2.1.7",
 com.lowagie.text.xml.xmp;version="2.1.7",
 com.lowagie.tools;version="2.1.7"


Any hints on this?
Regards,
Thorsten
Re: Package merge Problem [message #968318 is a reply to message #957293] Fri, 02 November 2012 11:17 Go to previous message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
The import merge exception is a somewhat cryptic symptom of split packages inside a scoped plan. The issue is that each scoped plan has a synthetic context bundle which provides a thread context class loader capable of loading all the classes of all the packages exported by the bundles in the plan and this scheme does not support split packages (because it would need to use Require-Bundle to achieve that and Require-Bundle has too many semantic rough edges for us to promote its use).

Is it possible to factor the iText bundles out of the scoped plan? In general it is good practice not to include infrastructure bundles in a scoped plan when this can be avoided.
Previous Topic:Spring 3.2 and OSGi
Next Topic:Datasource not found in par deployment
Goto Forum:
  


Current Time: Thu Apr 25 06:50:39 GMT 2024

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

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

Back to the top