Split package warning, but both the two bundles reported are the same bundle

1,339 views
Skip to first unread message

Dan Gravell

unread,
Aug 20, 2014, 12:02:34 PM8/20/14
to bndtool...@googlegroups.com
I'm getting the following warning on a bnd file:

Split package, multiple jars provide the same package:com/elsten/osgi
...
Package found in [Jar:com.elsten.bliss.bundle, Jar:com.elsten.bliss.bundle]
...

Had to type that in so might be a small inaccuracy, but the repeated bundle name is not a typo. What does this indicate? I would expect to see two or more different bundles in that line, those being the source of the different versions of the package.

Thanks,
Dan

BJ Hargrave

unread,
Aug 20, 2014, 12:10:31 PM8/20/14
to bndtool...@googlegroups.com
It indicates that bnd finds the named package in two jars on your -buildpath. So bnd is warning you. You can address this with the bnd ‘’-split-packages” directive on your Private-Package or Export-Package statement.

--
You received this message because you are subscribed to the Google Groups "bndtools-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
-- 
BJ

Dan Gravell

unread,
Aug 20, 2014, 12:18:10 PM8/20/14
to bndtool...@googlegroups.com
Right, so the "Package found in" line should just be ignored, and I'll have to hunt the other one down myself?

Dan

BJ Hargrave

unread,
Aug 20, 2014, 12:29:36 PM8/20/14
to bndtool...@googlegroups.com
Both lines are from the same diagnostic message [1]. Is it possible the named jar is in your -buildpath twice? The displayed jar name does not include the full path.

What is the full text of the displayed message?

Dan Gravell

unread,
Aug 20, 2014, 12:33:58 PM8/20/14
to bndtool...@googlegroups.com

Too much to type!


You can see the bundle is in the class path twice there... is that the problem and if so, how to remove?

Dan

BJ Hargrave

unread,
Aug 20, 2014, 12:37:42 PM8/20/14
to bndtool...@googlegroups.com
It is only a problem for Private-Package and Export-Package if you don’t specify the -split-package directive to tell bnd how to handle finding 2 copies of the package.

You could also edit your bnd file to not put the bundle twice in the -buildpath. :-)

Dan Gravell

unread,
Aug 20, 2014, 12:42:48 PM8/20/14
to bndtool...@googlegroups.com
It's not in the -buildpath twice. In fact, it isn't even in there once... this is on the bnd file for com.elsten.bliss.bundle.

BJ Hargrave

unread,
Aug 20, 2014, 12:46:23 PM8/20/14
to bndtool...@googlegroups.com
So are you saying that the project to build the com.elsten.bliss.bundle bundle has the jar for that project on its class path? Twice? Seems quite odd to me. What does your bnd file look like?

Dan Gravell

unread,
Aug 20, 2014, 12:51:05 PM8/20/14
to bndtool...@googlegroups.com
-buildpath: org.apache.commons.lang,\
osgi.core;version=4.3.0,\
com.elsten.bliss.platform;version=latest,\
com.elsten.bliss.model;version=latest,\
com.elsten.bliss.api;version=latest
Private-Package: com.elsten.osgi
Bundle-Version: 0.0.32.${tstamp}
#Bundle-Version: 0.0.0.201211121101
Bundle-Activator: com.elsten.osgi.Activator
-sources: false
Import-Package: org.apache.felix.scr;version=1.6.0,\
*

BJ Hargrave

unread,
Aug 20, 2014, 12:57:11 PM8/20/14
to bndtool...@googlegroups.com
ok. What does “java -jar bnd.jar debug” say for the project? Have the project as the current directory and use the bnd.jar you are using to build the project.

Dan Gravell

unread,
Aug 20, 2014, 1:01:42 PM8/20/14
to bndtool...@googlegroups.com
$ java -jar /home/gravelld/eclipse-workspaces/bliss/cnf/plugins/biz.aQute.bnd/biz.aQute.bnd-2.1.0.jar debug
Plugins                                  [com.elsten.bliss.bundle, java.util.concurrent.ThreadPoolExecutor@5cf8fdd3[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0], java.util.Random@5ee05754, , aQute.bnd.maven.support.Maven@2ed4e99c, bnd-cache, Release, Local, Bndtools Hub, /home/gravelld/eclipse-workspaces/bliss/cnf/buildrepo r/w=true]

Repos                                    [bnd-cache, Release, Local, Bndtools Hub, /home/gravelld/eclipse-workspaces/bliss/cnf/buildrepo r/w=true]

Workspace                                []

-failok                                  [false]

BJ Hargrave

unread,
Aug 20, 2014, 1:07:08 PM8/20/14
to bndtool...@googlegroups.com
Quite an old version of bnd. Not much debug info. :-(

What is you try the latest bnd jar from https://bndtools.ci.cloudbees.com/job/bnd.master/lastSuccessfulBuild/artifact/dist/bundles/biz.aQute.bnd/biz.aQute.bnd-latest.jar to run the debug command. It will (hopefully) provide much more useful info. 

Dan Gravell

unread,
Aug 20, 2014, 1:20:10 PM8/20/14
to bndtool...@googlegroups.com
Yeah, a lot more!

-------------------------------------------------------------------------------------------------------------------------------------------
Workspace Workspace [bliss]
-------------------------------------------------------------------------------------------------------------------------------------------
Included Files                              -   /home/gravelld/eclipse-workspaces/bliss/cnf/ext/defaults.bnd
                                                /home/gravelld/eclipse-workspaces/bliss/cnf/ext/repositories.bnd
Base                                        -   /home/gravelld/eclipse-workspaces/bliss
Properties                                  -   -sources=true
                                                javac=javac
                                                project.bootclasspath= {p-bootclasspath;:}
                                                project= {basedir}
                                                project.testpath= {p-testpath;:}
                                                -sourcepath= {project}/src
                                                javac.target=1.5
                                                javac.debug=on
                                                src=src
                                                project.allsourcepath= {p-allsourcepath;:}
                                                project.buildpath= {p-buildpath;:}
                                                java=java
                                                -verbose=true
                                                -pluginpath= {plugindir}/biz.aQute.repository/biz.aQute.repository-2.0.2.jar
                                                bin=bin
                                                build= {workspace}/cnf
                                                p= {basename; {project}}
                                                project.name= {p}
                                                plugindir= {workspace}/cnf/plugins
                                                project.output= {p-output}
                                                target-dir=generated
                                                project.dependson= {p-dependson;:}
                                                -plugin=aQute.bnd.deployer.repository.LocalIndexedRepo; name=Release;
                                                local= {workspace}/cnf/releaserepo;pretty=true,aQute.bnd.deployer.repository.LocalIndexedRep
                                                o; name=Local;
                                                local= {workspace}/cnf/localrepo;pretty=true,aQute.bnd.deployer.repository.FixedIndexedRepo;
                                                name=Bndtools Hub;
                                                locations=https://github.com/bndtools/bundle-hub/raw/master/index.xml.gz,aQute.lib.deployer.
                                                FileRepo; name=Build; location= {workspace}/cnf/buildrepo
                                                project.sourcepath= {p-sourcepath;:}
                                                -releaserepo=Release
                                                target= {project}/ {target-dir}
                                                javac.source=1.5
Workspace                                   -   Workspace [bliss]
Plugins                                     -   Workspace [bliss]
                                                java.util.concurrent.ThreadPoolExecutor@2de0a562[Running, pool size = 0, active threads = 0,
                                                queued tasks = 0, completed tasks = 0]
                                                java.util.Random@7789dc75
                                                Maven [m2=/home/gravelld/.m2]
                                                Settings[/home/gravelld/.bnd/settings.json]
                                                bnd-cache
                                                ResourceRepositoryImpl [cache=/home/gravelld/.bnd/caches/shas,
                                                indexFile=/home/gravelld/eclipse-workspaces/bliss/cnf/repo.json, ]
                                                
                                                /home/gravelld/eclipse-workspaces/bliss/cnf/buildrepo r/w=true
                                                Release
                                                Local
                                                Bndtools Hub
Repos                                       -   bnd-cache
                                                /home/gravelld/eclipse-workspaces/bliss/cnf/buildrepo r/w=true
                                                Release
                                                Local
                                                Bndtools Hub
Projects in build order                     -   com.elsten.util
                                                com.elsten.bliss.model.api
                                                com.elsten.bliss.music.info.api
                                                com.elsten.bliss.model
                                                com.elsten.bliss.policy.coverart.lookup.api
                                                com.elsten.bliss.music.info.dto
                                                com.elsten.musicbrainz
                                                com.elsten.bliss.music.info.common
                                                com.elsten.bliss.policy.coverart.lookup.common
                                                com.elsten.util.test
                                                com.elsten.bliss.model.test
                                                com.elsten.musicbrainz.test
                                                com.elsten.bliss.policy.tag.auto
                                                com.elsten.bliss.policy.parsed
                                                com.elsten.bliss.policy.tag.tagtype
                                                com.elsten.bliss.music.info.tagsource.api
                                                com.elsten.bliss.music.info.tagsource.impl
                                                com.elsten.bliss.analytics
                                                com.elsten.bliss.licence
                                                com.elsten.bliss.platform
                                                com.elsten.bliss.platform.test
                                                com.elsten.bliss.osgi.system.osx
                                                com.elsten.bliss.music.info.api.test
                                                com.elsten.bliss.music.info.freedb
                                                com.elsten.bliss.music.info.cache
                                                com.elsten.bliss.music.info.cache.test
                                                com.elsten.bliss.charge.api
                                                com.elsten.bliss.ui
                                                com.onemusicapi.common
                                                com.onemusicapi.client
                                                com.elsten.bliss.policy.tag.auto.win.x86
                                                com.elsten.adb
                                                com.elsten.bliss.music.info.wikipedia
                                                com.elsten.bliss.comparisontest
                                                com.elsten.bliss.music.info.aggregateddb
                                                com.elsten.jetty.osgi.boot
                                                com.elsten.bliss.bootstrapbundle
                                                com.elsten.bliss.policy.coverart.lookup.googleimages
                                                com.elsten.bliss.updater
                                                com.elsten.bliss.tools
                                                net.contentobjects.jnotify.linux.x86
                                                com.elsten.bliss.music.info.musicbrainz
                                                com.elsten.bliss.music.info.acoustid
                                                com.elsten.bliss.policy.tag.auto.linux.amd64
                                                com.elsten.bliss.stresstest
                                                com.elsten.bliss.music.info.test
                                                com.elsten.bliss.api
                                                com.elsten.bliss.bundle
                                                com.elsten.bliss.policy.parsed.test
                                                com.elsten.bliss.logging
                                                com.elsten.bliss.policy.tag.auto.test
                                                com.stripe
                                                net.contentobjects.jnotify.osx
                                                com.elsten.bliss.osgi.system
                                                jaudiotagger-trunk
                                                com.elsten.bliss.policy.coverart.lookup.test
                                                aws-java-sdk-1.4.7
                                                com.elsten.bliss.untagged.acoustid
                                                net.contentobjects.jnotify.win.x86
                                                net.contentobjects.jnotify.win.amd64
                                                net.contentobjects.jnotify
                                                com.elsten.bliss.policy.tag.tagtype.test
                                                com.elsten.bliss.policy.tag.auto.osx
                                                com.elsten.bliss.untagged.onemusicapi
                                                net.contentobjects.jnotify.linux.amd64
                                                com.elsten.bliss.web.debug
                                                com.elsten.bliss.ui.systemtray
                                                com.elsten.bliss.configuration.file
                                                com.elsten.bliss.music.info.onemusicapi
                                                com.elsten.bliss.policy.tag.auto.linux.x86


-------------------------------------------------------------------------------------------------------------------------------------------
Project com.elsten.bliss.bundle
-------------------------------------------------------------------------------------------------------------------------------------------
Included Files                              -   null
Base                                        -   /home/gravelld/eclipse-workspaces/bliss/com.elsten.bliss.bundle
Properties                                  -   Bundle-Activator=com.elsten.osgi.Activator
                                                Bundle-Version=0.0.32. {tstamp}
                                                Private-Package=com.elsten.osgi
                                                Import-Package=org.apache.felix.scr;version=1.6.0,*
                                                -sources=false
                                                basedir=/home/gravelld/eclipse-workspaces/bliss/com.elsten.bliss.bundle
                                                -failok=false
                                                -buildpath=org.apache.commons.lang,osgi.core;version=4.3.0,com.elsten.bliss.platform;version
                                                =latest,com.elsten.bliss.model;version=latest,com.elsten.bliss.api;version=latest
Target                                      -   /home/gravelld/eclipse-workspaces/bliss/com.elsten.bliss.bundle/generated
Source                                      -   /home/gravelld/eclipse-workspaces/bliss/com.elsten.bliss.bundle/src
Output                                      -   /home/gravelld/eclipse-workspaces/bliss/com.elsten.bliss.bundle/bin
BuildFiles                                  -   /home/gravelld/eclipse-workspaces/bliss/com.elsten.bliss.bundle/generated/com.elsten.bliss.b
                                                undle.jar
Classpath                                   -   
Actions                                     -   {build=ReflectAction:[build], test=ReflectAction:[test], run=ReflectAction:[run],
                                                clean=ReflectAction:[clean], release=ReflectAction:[release],
                                                refresh=ReflectAction:[refreshAll], deploy=ReflectAction:[deploy]}
AllSourcePath                               -   /home/gravelld/eclipse-workspaces/bliss/com.elsten.bliss.bundle/src
                                                /home/gravelld/eclipse-workspaces/bliss/com.elsten.util/src
                                                /home/gravelld/eclipse-workspaces/bliss/com.elsten.bliss.model.api/src
                                                /home/gravelld/eclipse-workspaces/bliss/com.elsten.bliss.music.info.api/src
                                                /home/gravelld/eclipse-workspaces/bliss/com.elsten.bliss.model/src
                                                /home/gravelld/eclipse-workspaces/bliss/com.elsten.musicbrainz/src
                                                /home/gravelld/eclipse-workspaces/bliss/com.elsten.musicbrainz.test/src
                                                /home/gravelld/eclipse-workspaces/bliss/com.elsten.bliss.policy.coverart.lookup.api/src
                                                /home/gravelld/eclipse-workspaces/bliss/com.elsten.bliss.music.info.dto/src
                                                /home/gravelld/eclipse-workspaces/bliss/com.elsten.bliss.music.info.common/src
                                                /home/gravelld/eclipse-workspaces/bliss/com.elsten.bliss.policy.coverart.lookup.common/src
                                                /home/gravelld/eclipse-workspaces/bliss/com.elsten.bliss.policy.tag.auto/src
                                                /home/gravelld/eclipse-workspaces/bliss/com.elsten.bliss.policy.parsed/src
                                                /home/gravelld/eclipse-workspaces/bliss/com.elsten.bliss.policy.tag.tagtype/src
                                                /home/gravelld/eclipse-workspaces/bliss/com.elsten.bliss.music.info.tagsource.api/src
                                                /home/gravelld/eclipse-workspaces/bliss/com.elsten.bliss.music.info.tagsource.impl/src
                                                /home/gravelld/eclipse-workspaces/bliss/com.elsten.bliss.analytics/src
                                                /home/gravelld/eclipse-workspaces/bliss/com.elsten.bliss.licence/src
                                                /home/gravelld/eclipse-workspaces/bliss/com.elsten.bliss.platform/src
                                                /home/gravelld/eclipse-workspaces/bliss/com.elsten.bliss.api/src
BootClassPath                               -   
BuildPath                                   -   /home/gravelld/eclipse-workspaces/bliss/com.elsten.bliss.bundle/bin
                                                /home/gravelld/eclipse-workspaces/bliss/cnf/localrepo/org.apache.commons.lang/org.apache.com
                                                mons.lang-2.6.0.jar
                                                /home/gravelld/eclipse-workspaces/bliss/cnf/buildrepo/osgi.core/osgi.core-4.3.0.jar
                                                /home/gravelld/eclipse-workspaces/bliss/com.elsten.bliss.platform/generated/com.elsten.bliss
                                                .platform.jar
                                                /home/gravelld/eclipse-workspaces/bliss/com.elsten.bliss.model/generated/com.elsten.bliss.mo
                                                del.jar
                                                /home/gravelld/eclipse-workspaces/bliss/com.elsten.bliss.api/generated/com.elsten.bliss.api.
                                                jar
Deliverables                                -   /home/gravelld/eclipse-workspaces/bliss/com.elsten.bliss.bundle/generated/com.elsten.bliss.b
                                                undle.jar
DependsOn                                   -   com.elsten.util
                                                com.elsten.bliss.model.api
                                                com.elsten.bliss.music.info.api
                                                com.elsten.bliss.model
                                                com.elsten.musicbrainz
                                                com.elsten.musicbrainz.test
                                                com.elsten.bliss.policy.coverart.lookup.api
                                                com.elsten.bliss.music.info.dto
                                                com.elsten.bliss.music.info.common
                                                com.elsten.bliss.policy.coverart.lookup.common
                                                com.elsten.bliss.policy.tag.auto
                                                com.elsten.bliss.policy.parsed
                                                com.elsten.bliss.policy.tag.tagtype
                                                com.elsten.bliss.music.info.tagsource.api
                                                com.elsten.bliss.music.info.tagsource.impl
                                                com.elsten.bliss.analytics
                                                com.elsten.bliss.licence
                                                com.elsten.bliss.platform
                                                com.elsten.bliss.api
SourcePath                                  -   /home/gravelld/eclipse-workspaces/bliss/com.elsten.bliss.bundle/src
RunPath                                     -   
TestPath                                    -   
RunProgramArgs                              -   
RunVM                                       -   
Runfw                                       -   
Runbundles                                  -   


-------------------------------------------------------------------------------------------------------------------------------------------
Sub-Builder com.elsten.bliss.bundle
-------------------------------------------------------------------------------------------------------------------------------------------
Included Files                              -   null
Base                                        -   /home/gravelld/eclipse-workspaces/bliss/com.elsten.bliss.bundle
Properties                                  -   Bundle-Version=0.0.32.201408201719
                                                Service-Component=
                                                project.dir=/home/gravelld/eclipse-workspaces/bliss/com.elsten.bliss.bundle
Contained                                   -   com.elsten.osgi=
Imported                                    -   com.elsten.bliss.platform.model=version="[2.0,3)"
                                                org.apache.commons.lang=version="[2.6,3)"
                                                org.osgi.framework=version="[1.6,2)"
                                                org.apache.felix.scr=version="1.6.0"
Exported                                    -   
Referred                                    -   java.lang=
                                                org.osgi.framework=
                                                java.util=
                                                com.elsten.bliss.platform.model=
                                                org.apache.commons.lang=
                                                java.math=
                                                java.net=
                                                java.io=
Bundle Symbolic Name                        -   com.elsten.bliss.bundle
Execution Environments                      -   J2SE6
Do Not Copy                                 -   CVS|\.svn|\.git|\.DS_Store
Git head                                    -   
Baseline repo                               -   Release
Release repo                                -   Release

BJ Hargrave

unread,
Aug 20, 2014, 1:28:34 PM8/20/14
to bndtool...@googlegroups.com
Nothing looks odd there. I am not sure where to go from here. You are using an old (2.1.0) version of bnd, so I am unsure of what might be wrong.  Not sure if you are able to step up to build with the current version to see how that goes.

Dan Gravell

unread,
Aug 21, 2014, 5:50:23 AM8/21/14
to bndtool...@googlegroups.com
What I have found now is that there *is* another package with the same name in my workspace. So I might try fixing that and seeing what happens...

Yeah will move on to new version of bndtools which I assume includes an up to date bnd when 2.4.0 is released.

Dan
Yeah, a lot more!

<font face="
...

Dan Gravell

unread,
Sep 4, 2014, 12:18:26 PM9/4/14
to bndtool...@googlegroups.com
I worked it out: the projects this affected had the class folder ("bin/") in the Java Build Path > Libraries tab. I removed that (obviously the class folder is still contributed by the "Bnd Bundle Path") and now no split package warnings.

Dan
...
Reply all
Reply to author
Forward
0 new messages