On Jun 10, 2010, at 7:59 AM, Richard S. Hall wrote: > On 6/9/10 17:53, petergent wrote: >> Hi, >> >> When I try to start just one bundle, the 'log4j-1.2.16.jar' bundle, I get >> this error: >> >> Auto-deploy install: org.osgi.framework.BundleException: Duplicate import - >> com.sun.jdmk.comm >> >> Google doesn't help me here. >> Could you help me? >> The maven directory: http://repo1.maven.org/maven2/log4j/log4j/1.2.16/ > > Looking at its manifest, I see: > > Import-Package: com.ibm.uvm.tools;resolution:=optional,com.sun.jdmk.co > mm;resolution:=optional,com.sun.jdmk.comm;resolution:=optional,javax. > > The package is imported twice, not sure why, but that is an error. Try a > different version. >
I inadvertently specified that class twice in the Import-Package element in the log4j's POM. I just noticed the typo when writing that last sentence. I was ready to report it as a bug in maven-bundle-plugin since I thought that it had duplicated the entry. However, it would have been nice for the bundle plugin to warn about it. Before seeing the typo, I had committed a modified pom.xml and have checked that it successfully starts in Equinox. In http://issues.apache.org/bugzilla/show_bug.cgi?id=43282#c4, Craig Muchinsky raises an issue that the exported packages do not contain an explicit version number. I do not have sufficient experience with OSGi to know if that is a valid complaint. Basically was depending on the bundle plugin to do the right thing and it would seem to have enough info to do that if it should be done. I could appreciate any suggestions. Hopefully, we can release a log4j 1.2.17 to fix it shortly. The current pom.xml is http://svn.apache.org/repos/asf/logging/log4j/trunk/pom.xml. Some discussion of the changes appear in bug 43282. The resulting MANIFEST.MF looks like: Manifest-Version: 1.0 Export-Package: org.apache.log4j.net;uses:="org.apache.log4j,org.apach e.log4j.spi,javax.naming,org.apache.log4j.helpers,javax.jms,org.apach e.log4j.xml,javax.mail,javax.mail.internet,org.w3c.dom,javax.jmdns",o rg.apache.log4j.jmx;uses:="org.apache.log4j,javax.management,org.apac he.log4j.helpers,org.apache.log4j.spi",org.apache.log4j.jdbc;uses:="o rg.apache.log4j,org.apache.log4j.spi",org.apache.log4j.config;uses:=" org.apache.log4j.helpers,org.apache.log4j,org.apache.log4j.spi",org.a pache.log4j.helpers;uses:="org.apache.log4j,org.apache.log4j.spi,org. apache.log4j.pattern",org.apache.log4j;uses:="org.apache.log4j.spi,or g.apache.log4j.helpers,org.apache.log4j.pattern,org.apache.log4j.or,o rg.apache.log4j.config",org.apache.log4j.or.jms;uses:="org.apache.log 4j.helpers,javax.jms,org.apache.log4j.or",org.apache.log4j.nt;uses:=" org.apache.log4j.helpers,org.apache.log4j,org.apache.log4j.spi",org.a pache.log4j.or.sax;uses:="org.apache.log4j.or,org.xml.sax",org.apache .log4j.pattern;uses:="org.apache.log4j.helpers,org.apache.log4j.spi,o rg.apache.log4j,org.apache.log4j.or",org.apache.log4j.spi;uses:="org. apache.log4j,org.apache.log4j.helpers,org.apache.log4j.or",org.apache .log4j.or;uses:="org.apache.log4j.helpers,org.apache.log4j.spi,org.ap ache.log4j",org.apache.log4j.xml;uses:="javax.xml.parsers,org.w3c.dom ,org.xml.sax,org.apache.log4j.config,org.apache.log4j.helpers,org.apa che.log4j,org.apache.log4j.spi,org.apache.log4j.or",org.apache.log4j. varia;uses:="org.apache.log4j.spi,org.apache.log4j,org.apache.log4j.h elpers" Ignore-Package: com.sun.jdmk.comm,javax.swing.text,javax.swing.border, javax.swing.tree,javax.swing,com.ibm.uvm.tools,javax.swing.table,java x.swing.event Built-By: curta Tool: Bnd-0.0.357 Bundle-Name: Apache Log4j Created-By: Apache Maven Bundle Plugin Bundle-Vendor: Apache Software Foundation Build-Jdk: 1.6.0_20 Bundle-Version: 1.2.17.SNAPSHOT Bnd-LastModified: 1276321992231 Bundle-ManifestVersion: 2 Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt Bundle-Description: Apache Log4j 1.2 Bundle-DocURL: http://logging.apache.org/log4j/1.2 Bundle-SymbolicName: log4j Import-Package: javax.jmdns;resolution:=optional,javax.jms;resolution: =optional,javax.mail;resolution:=optional,javax.mail.internet;resolut ion:=optional,javax.management,javax.naming,javax.xml.parsers,org.apa che.log4j,org.apache.log4j.config,org.apache.log4j.helpers,org.apache .log4j.jdbc,org.apache.log4j.jmx,org.apache.log4j.net,org.apache.log4 j.nt,org.apache.log4j.or,org.apache.log4j.or.jms,org.apache.log4j.or. sax,org.apache.log4j.pattern,org.apache.log4j.spi,org.apache.log4j.va ria,org.apache.log4j.xml,org.w3c.dom,org.xml.sax,org.xml.sax.helpers Name: org.apache.log4j DynamicImport-Package: * Implementation-Vendor: "Apache Software Foundation" Implementation-Title: log4j Implementation-Version: 1.2.17-SNAPSHOT --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]

