You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by petergent <pe...@gmail.com> on 2010/06/09 23:53:18 UTC

Duplicate import

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/

Thank you in advance,
Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Duplicate import

Posted by "Richard S. Hall" <he...@ungoverned.org>.
On 6/12/10 1:57, Curt Arnold wrote:
> 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.
>    

Agreed. I'm surprised that it doesn't.

> 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.
>    

There is no default for package versions, so if you don't specify one 
then it doesn't get one. In your case, it might be simplest just to 
specify the bundle version (i.e., JAR version) as the package version 
for all exported packages otherwise.

> 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:
>    

Unfortunately, older versions of the BND tool make a simplifying 
decision to import all exports, which you most likely don't want to do, 
since you are creating a library bundle. I am hoping that we can update 
maven-bundle-plugin to use the newer versions of BND that have a few 
more heuristics for generating imports for exported package.

I generated a log4j bundle using a newer version of BND and ended up 
with the attached manifest file, where you can see it no longer imports 
the exports. You can achieve this in the current plugin with an export 
like this:

<Export-Package>!org.apache.log4j.lf5.*,!org.apache.log4j.chainsaw.*,org.apache.log4j.*;-noimport:=true</Export-Package>

Once we get a new plugin release, it will hopefully make better default 
choices for this issue.

-> richard


Re: Duplicate import

Posted by Curt Arnold <ca...@apache.org>.
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: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Duplicate import

Posted by Justin Edelson <ju...@gmail.com>.
On 6/10/10 9:15 AM, petergent wrote:
> - Thank you Richard, I deleted the line (and some others) manually.
> It works now.
> 
> - The problem is: It's the latest and only version of log4j that
> supports OSGi (and  that is deployed on  the Maven repo).
FYI - this bug was reopened:
https://issues.apache.org/bugzilla/show_bug.cgi?id=43282

Justin

> 
> Yours,
> Peter
> 
> Richard S. Hall schreef:
>> 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.
>>
>> -> richard
>>
>>>
>>> Thank you in advance,
>>> Peter
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>> For additional commands, e-mail: users-help@felix.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Duplicate import

Posted by petergent <pe...@gmail.com>.
- Thank you Richard, I deleted the line (and some others) manually.
It works now.

- The problem is: It's the latest and only version of log4j that 
supports OSGi (and  that is deployed on  the Maven repo).

Yours,
Peter

Richard S. Hall schreef:
> 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.
>
> -> richard
>
>>
>> Thank you in advance,
>> Peter
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Duplicate import

Posted by "Richard S. Hall" <he...@ungoverned.org>.
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.

-> richard

>
> Thank you in advance,
> Peter
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org