You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by Clement Escoffier <cl...@gmail.com> on 2007/10/07 12:21:39 UTC

Issue when building Felix main project

Hello,

 

It seems that there is a strange behavior when building the Felix main
project. 

When compiling with the reactor, the Felix main project seems to contains
bad packages. For example, when starting Felix just after this build, the
Bundle.getBundleContext cannot be found.  

(java.lang.NoSuchMethodError:
org.osgi.framework.Bundle.getBundleContext()Lorg/osgi/framework/BundleContex
t;). It seems that Felix contains and exports OSGi R4 packages (instead of
R4.1).

 

However when recompiling the project independently (directly from the main
project), Felix seems to contain 'right' packages.

 

When analyzing build logs, I realized that Felix have several split-packages
warning when building from the reactor, which do not happens when compiling
independently. The problem comes from a conflict between
Jar:org.apache.felix.framework and  Jar:osgi_R4_core. I do not understand is
why it happens only when building with the reactor.

 

Clement

 

>From the reactor :

.

[INFO]
----------------------------------------------------------------------------

[INFO] Building Apache Felix Main

[INFO]    task-segment: [clean, install]

[INFO]
----------------------------------------------------------------------------

[INFO] [clean:clean]

[INFO] Deleting directory D:\clement\workspaces\felix-trunk\main\target

[INFO] Deleting directory
D:\clement\workspaces\felix-trunk\main\target\classes

[INFO] Deleting directory
D:\clement\workspaces\felix-trunk\main\target\test-classes

[INFO] Deleting directory D:\clement\workspaces\felix-trunk\main\target\site

[INFO] [dependency:unpack {execution: unpack}]

[INFO] Configured Artifact:
org.apache.felix:org.apache.felix.framework:1.1.0-SNAPSHOT:jar

[INFO] Expanding:
D:\Dev\maven-repo\org\apache\felix\org.apache.felix.framework\1.1.0-SNAPSHOT
\org.apache.felix.framework-1.1.0-SNAPSHOT.jar into
D:\clement\workspaces\felix-trunk\main\target\classes

[INFO] [resources:resources]

[INFO] Using default encoding to copy filtered resources.

[INFO] [compiler:compile]

[INFO] Compiling 1 source file to
D:\clement\workspaces\felix-trunk\main\target\classes

[INFO] [resources:testResources]

[INFO] Using default encoding to copy filtered resources.

[INFO] [compiler:testCompile]

[INFO] No sources to compile

[INFO] [surefire:test]

[INFO] No tests to run.

[INFO] [bundle:bundle]

[WARNING] Include-Resource: overriding {src/main/resources} with
{src/main/resources/} (add {maven-resources} if you want to include the
maven resources)

[WARNING] Warning building bundle
org.apache.felix:org.apache.felix.main:bundle:1.1.0-SNAPSHOT : There are
split packages, use directive -split-package:=(merge-first|merge-last) on
instruction to get rid of this warning: org.apache.felix.framework,
classpath: [Jar:., Jar:org.apache.felix.bundlerepository,
Jar:org.apache.felix.shell, Jar:org.apache.felix.framework,
Jar:org.apache.felix.shell.tui, Jar:osgi_R4_core, Jar:org.osgi.service.obr]
from:
D:\Dev\maven-repo\org\apache\felix\org.apache.felix.framework\1.1.0-SNAPSHOT
\org.apache.felix.framework-1.1.0-SNAPSHOT.jar

[WARNING] Warning building bundle
org.apache.felix:org.apache.felix.main:bundle:1.1.0-SNAPSHOT : There are
split packages, use directive -split-package:=(merge-first|merge-last) on
instruction to get rid of this warning: org.apache.felix.framework.cache,
classpath: [Jar:., Jar:org.apache.felix.bundlerepository,
Jar:org.apache.felix.shell, Jar:org.apache.felix.framework,
Jar:org.apache.felix.shell.tui, Jar:osgi_R4_core, Jar:org.osgi.service.obr]
from:
D:\Dev\maven-repo\org\apache\felix\org.apache.felix.framework\1.1.0-SNAPSHOT
\org.apache.felix.framework-1.1.0-SNAPSHOT.jar

[WARNING] Warning building bundle
org.apache.felix:org.apache.felix.main:bundle:1.1.0-SNAPSHOT : There are
split packages, use directive -split-package:=(merge-first|merge-last) on
instruction to get rid of this warning: org.apache.felix.framework.ext,
classpath: [Jar:., Jar:org.apache.felix.bundlerepository,
Jar:org.apache.felix.shell, Jar:org.apache.felix.framework,
Jar:org.apache.felix.shell.tui, Jar:osgi_R4_core, Jar:org.osgi.service.obr]
from:
D:\Dev\maven-repo\org\apache\felix\org.apache.felix.framework\1.1.0-SNAPSHOT
\org.apache.felix.framework-1.1.0-SNAPSHOT.jar

[WARNING] Warning building bundle
org.apache.felix:org.apache.felix.main:bundle:1.1.0-SNAPSHOT : There are
split packages, use directive -split-package:=(merge-first|merge-last) on
instruction to get rid of this warning:
org.apache.felix.framework.searchpolicy, classpath: [Jar:.,
Jar:org.apache.felix.bundlerepository, Jar:org.apache.felix.shell,
Jar:org.apache.felix.framework, Jar:org.apache.felix.shell.tui,
Jar:osgi_R4_core, Jar:org.osgi.service.obr] from:
D:\Dev\maven-repo\org\apache\felix\org.apache.felix.framework\1.1.0-SNAPSHOT
\org.apache.felix.framework-1.1.0-SNAPSHOT.jar

[WARNING] Warning building bundle
org.apache.felix:org.apache.felix.main:bundle:1.1.0-SNAPSHOT : There are
split packages, use directive -split-package:=(merge-first|merge-last) on
instruction to get rid of this warning: org.apache.felix.framework.util,
classpath: [Jar:., Jar:org.apache.felix.bundlerepository,
Jar:org.apache.felix.shell, Jar:org.apache.felix.framework,
Jar:org.apache.felix.shell.tui, Jar:osgi_R4_core, Jar:org.osgi.service.obr]
from:
D:\Dev\maven-repo\org\apache\felix\org.apache.felix.framework\1.1.0-SNAPSHOT
\org.apache.felix.framework-1.1.0-SNAPSHOT.jar

[WARNING] Warning building bundle
org.apache.felix:org.apache.felix.main:bundle:1.1.0-SNAPSHOT : There are
split packages, use directive -split-package:=(merge-first|merge-last) on
instruction to get rid of this warning:
org.apache.felix.framework.util.ldap, classpath: [Jar:.,
Jar:org.apache.felix.bundlerepository, Jar:org.apache.felix.shell,
Jar:org.apache.felix.framework, Jar:org.apache.felix.shell.tui,
Jar:osgi_R4_core, Jar:org.osgi.service.obr] from:
D:\Dev\maven-repo\org\apache\felix\org.apache.felix.framework\1.1.0-SNAPSHOT
\org.apache.felix.framework-1.1.0-SNAPSHOT.jar

[WARNING] Warning building bundle
org.apache.felix:org.apache.felix.main:bundle:1.1.0-SNAPSHOT : There are
split packages, use directive -split-package:=(merge-first|merge-last) on
instruction to get rid of this warning:
org.apache.felix.framework.util.manifestparser, classpath: [Jar:.,
Jar:org.apache.felix.bundlerepository, Jar:org.apache.felix.shell,
Jar:org.apache.felix.framework, Jar:org.apache.felix.shell.tui,
Jar:osgi_R4_core, Jar:org.osgi.service.obr] from:
D:\Dev\maven-repo\org\apache\felix\org.apache.felix.framework\1.1.0-SNAPSHOT
\org.apache.felix.framework-1.1.0-SNAPSHOT.jar

[WARNING] Warning building bundle
org.apache.felix:org.apache.felix.main:bundle:1.1.0-SNAPSHOT : There are
split packages, use directive -split-package:=(merge-first|merge-last) on
instruction to get rid of this warning: org.apache.felix.moduleloader,
classpath: [Jar:., Jar:org.apache.felix.bundlerepository,
Jar:org.apache.felix.shell, Jar:org.apache.felix.framework,
Jar:org.apache.felix.shell.tui, Jar:osgi_R4_core, Jar:org.osgi.service.obr]
from:
D:\Dev\maven-repo\org\apache\felix\org.apache.felix.framework\1.1.0-SNAPSHOT
\org.apache.felix.framework-1.1.0-SNAPSHOT.jar

[WARNING] Warning building bundle
org.apache.felix:org.apache.felix.main:bundle:1.1.0-SNAPSHOT : There are
split packages, use directive -split-package:=(merge-first|merge-last) on
instruction to get rid of this warning: org.osgi.framework, classpath:
[Jar:., Jar:org.apache.felix.bundlerepository, Jar:org.apache.felix.shell,
Jar:org.apache.felix.framework, Jar:org.apache.felix.shell.tui,
Jar:osgi_R4_core, Jar:org.osgi.service.obr] from:
D:\Dev\maven-repo\org\apache\felix\org.apache.felix.framework\1.1.0-SNAPSHOT
\org.apache.felix.framework-1.1.0-SNAPSHOT.jar

[WARNING] Warning building bundle
org.apache.felix:org.apache.felix.main:bundle:1.1.0-SNAPSHOT : There are
split packages, use directive -split-package:=(merge-first|merge-last) on
instruction to get rid of this warning: org.osgi.service.packageadmin,
classpath: [Jar:., Jar:org.apache.felix.bundlerepository,
Jar:org.apache.felix.shell, Jar:org.apache.felix.framework,
Jar:org.apache.felix.shell.tui, Jar:osgi_R4_core, Jar:org.osgi.service.obr]
from:
D:\Dev\maven-repo\org\apache\felix\org.apache.felix.framework\1.1.0-SNAPSHOT
\org.apache.felix.framework-1.1.0-SNAPSHOT.jar

[WARNING] Warning building bundle
org.apache.felix:org.apache.felix.main:bundle:1.1.0-SNAPSHOT : There are
split packages, use directive -split-package:=(merge-first|merge-last) on
instruction to get rid of this warning: org.osgi.service.startlevel,
classpath: [Jar:., Jar:org.apache.felix.bundlerepository,
Jar:org.apache.felix.shell, Jar:org.apache.felix.framework,
Jar:org.apache.felix.shell.tui, Jar:osgi_R4_core, Jar:org.osgi.service.obr]
from:
D:\Dev\maven-repo\org\apache\felix\org.apache.felix.framework\1.1.0-SNAPSHOT
\org.apache.felix.framework-1.1.0-SNAPSHOT.jar

[WARNING] Warning building bundle
org.apache.felix:org.apache.felix.main:bundle:1.1.0-SNAPSHOT : There are
split packages, use directive -split-package:=(merge-first|merge-last) on
instruction to get rid of this warning: org.osgi.service.url, classpath:
[Jar:., Jar:org.apache.felix.bundlerepository, Jar:org.apache.felix.shell,
Jar:org.apache.felix.framework, Jar:org.apache.felix.shell.tui,
Jar:osgi_R4_core, Jar:org.osgi.service.obr] from:
D:\Dev\maven-repo\org\apache\felix\org.apache.felix.framework\1.1.0-SNAPSHOT
\org.apache.felix.framework-1.1.0-SNAPSHOT.jar

[WARNING] Warning building bundle
org.apache.felix:org.apache.felix.main:bundle:1.1.0-SNAPSHOT : There are
split packages, use directive -split-package:=(merge-first|merge-last) on
instruction to get rid of this warning: org.osgi.util.tracker, classpath:
[Jar:., Jar:org.apache.felix.bundlerepository, Jar:org.apache.felix.shell,
Jar:org.apache.felix.framework, Jar:org.apache.felix.shell.tui,
Jar:osgi_R4_core, Jar:org.osgi.service.obr] from:
D:\Dev\maven-repo\org\apache\felix\org.apache.felix.framework\1.1.0-SNAPSHOT
\org.apache.felix.framework-1.1.0-SNAPSHOT.jar

[WARNING] Warning building bundle
org.apache.felix:org.apache.felix.main:bundle:1.1.0-SNAPSHOT : There are
split packages, use directive -split-package:=(merge-first|merge-last) on
instruction to get rid of this warning: org.osgi.framework, classpath:
[Jar:., Jar:org.apache.felix.bundlerepository, Jar:org.apache.felix.shell,
Jar:org.apache.felix.framework, Jar:org.apache.felix.shell.tui,
Jar:osgi_R4_core, Jar:org.osgi.service.obr] from:
D:\Dev\maven-repo\org\osgi\osgi_R4_core\1.0\osgi_R4_core-1.0.jar

[WARNING] Warning building bundle
org.apache.felix:org.apache.felix.main:bundle:1.1.0-SNAPSHOT : There are
split packages, use directive -split-package:=(merge-first|merge-last) on
instruction to get rid of this warning: org.osgi.service.packageadmin,
classpath: [Jar:., Jar:org.apache.felix.bundlerepository,
Jar:org.apache.felix.shell, Jar:org.apache.felix.framework,
Jar:org.apache.felix.shell.tui, Jar:osgi_R4_core, Jar:org.osgi.service.obr]
from: D:\Dev\maven-repo\org\osgi\osgi_R4_core\1.0\osgi_R4_core-1.0.jar

[WARNING] Warning building bundle
org.apache.felix:org.apache.felix.main:bundle:1.1.0-SNAPSHOT : There are
split packages, use directive -split-package:=(merge-first|merge-last) on
instruction to get rid of this warning: org.osgi.service.startlevel,
classpath: [Jar:., Jar:org.apache.felix.bundlerepository,
Jar:org.apache.felix.shell, Jar:org.apache.felix.framework,
Jar:org.apache.felix.shell.tui, Jar:osgi_R4_core, Jar:org.osgi.service.obr]
from: D:\Dev\maven-repo\org\osgi\osgi_R4_core\1.0\osgi_R4_core-1.0.jar

[WARNING] Warning building bundle
org.apache.felix:org.apache.felix.main:bundle:1.1.0-SNAPSHOT : There are
split packages, use directive -split-package:=(merge-first|merge-last) on
instruction to get rid of this warning: org.osgi.service.url, classpath:
[Jar:., Jar:org.apache.felix.bundlerepository, Jar:org.apache.felix.shell,
Jar:org.apache.felix.framework, Jar:org.apache.felix.shell.tui,
Jar:osgi_R4_core, Jar:org.osgi.service.obr] from:
D:\Dev\maven-repo\org\osgi\osgi_R4_core\1.0\osgi_R4_core-1.0.jar

[WARNING] Warning building bundle
org.apache.felix:org.apache.felix.main:bundle:1.1.0-SNAPSHOT : No
translation found for macro: jre-1.4

[INFO] [install:install]

[INFO] Installing
D:\clement\workspaces\felix-trunk\main\target\org.apache.felix.main-1.1.0-SN
APSHOT.jar to
D:\Dev\maven-repo\org\apache\felix\org.apache.felix.main\1.1.0-SNAPSHOT\org.
apache.felix.main-1.1.0-SNAPSHOT.jar

[INFO] [bundle:install]

[INFO] Parsing D:\Dev\maven-repo\repository.xml

[INFO] Writing OBR metadata

[INFO] [dependency:copy {execution: copy}]

[INFO] Configured Artifact:
org.apache.felix:org.apache.felix.shell:1.1.0-SNAPSHOT:jar

[INFO] Configured Artifact:
org.apache.felix:org.apache.felix.shell.tui:1.1.0-SNAPSHOT:jar

[INFO] Configured Artifact:
org.apache.felix:org.apache.felix.bundlerepository:1.1.0-SNAPSHOT:jar

[INFO] Copying org.apache.felix.shell-1.1.0-SNAPSHOT.jar to
D:\clement\workspaces\felix-trunk\main\target\bundle\org.apache.felix.shell-
1.1.0-SNAPSHOT.jar

[INFO] Copying org.apache.felix.shell.tui-1.1.0-SNAPSHOT.jar to
D:\clement\workspaces\felix-trunk\main\target\bundle\org.apache.felix.shell.
tui-1.1.0-SNAPSHOT.jar

[INFO] Copying org.apache.felix.bundlerepository-1.1.0-SNAPSHOT.jar to
D:\clement\workspaces\felix-trunk\main\target\bundle\org.apache.felix.bundle
repository-1.1.0-SNAPSHOT.jar

[INFO] [antrun:run {execution: default}]

[INFO] Executing tasks

   [delete] Deleting directory D:\clement\workspaces\felix-trunk\main\bin

    [mkdir] Created dir: D:\clement\workspaces\felix-trunk\main\bin

   [delete] Deleting directory D:\clement\workspaces\felix-trunk\main\conf

    [mkdir] Created dir: D:\clement\workspaces\felix-trunk\main\conf

   [delete] Deleting directory D:\clement\workspaces\felix-trunk\main\bundle

     [copy] Copying 1 file to D:\clement\workspaces\felix-trunk\main\bin

     [copy] Copying 1 file to D:\clement\workspaces\felix-trunk\main\conf

[INFO] Executed tasks

.

 

>From the main folder :

[INFO] Scanning for projects...

[INFO]
----------------------------------------------------------------------------

[INFO] Building Apache Felix Main

[INFO]    task-segment: [clean, install]

[INFO]
----------------------------------------------------------------------------

[INFO] [clean:clean]

[INFO] Deleting directory d:\clement\workspaces\felix-trunk\main\target

[INFO] Deleting directory
d:\clement\workspaces\felix-trunk\main\target\classes

[INFO] Deleting directory
d:\clement\workspaces\felix-trunk\main\target\test-classes

[INFO] Deleting directory d:\clement\workspaces\felix-trunk\main\target\site

[INFO] [dependency:unpack {execution: unpack}]

[INFO] Configured Artifact:
org.apache.felix:org.apache.felix.framework:1.1.0-SNAPSHOT:jar

[INFO] Expanding:
D:\Dev\maven-repo\org\apache\felix\org.apache.felix.framework\1.1.0-SNAPSHOT
\org.apache.felix.framework-1.1.0-SNAPSHOT.jar into
d:\clement\workspaces\felix-trunk\main\target\classes

[INFO] [resources:resources]

[INFO] Using default encoding to copy filtered resources.

[INFO] [compiler:compile]

[INFO] Compiling 1 source file to
d:\clement\workspaces\felix-trunk\main\target\classes

[INFO] [resources:testResources]

[INFO] Using default encoding to copy filtered resources.

[INFO] [compiler:testCompile]

[INFO] No sources to compile

[INFO] [surefire:test]

[INFO] No tests to run.

[INFO] [bundle:bundle]

[WARNING] Include-Resource: overriding {src\main\resources} with
{src/main/resources/}

[WARNING] Warning building bundle
org.apache.felix:org.apache.felix.main:bundle:1.1.0-SNAPSHOT : No
translation found for macro: jre-1.4

[INFO] [install:install]

[INFO] Installing
d:\clement\workspaces\felix-trunk\main\target\org.apache.felix.main-1.1.0-SN
APSHOT.jar to
D:\Dev\maven-repo\org\apache\felix\org.apache.felix.main\1.1.0-SNAPSHOT\org.
apache.felix.main-1.1.0-SNAPSHOT.jar

[INFO] [dependency:copy {execution: copy}]

[INFO] Configured Artifact:
org.apache.felix:org.apache.felix.shell:1.1.0-SNAPSHOT:jar

[INFO] Configured Artifact:
org.apache.felix:org.apache.felix.shell.tui:1.1.0-SNAPSHOT:jar

[INFO] Configured Artifact:
org.apache.felix:org.apache.felix.bundlerepository:1.1.0-SNAPSHOT:jar

[INFO] Copying org.apache.felix.shell-1.1.0-SNAPSHOT.jar to
d:\clement\workspaces\felix-trunk\main\target\bundle\org.apache.felix.shell-
1.1.0-SNAPSHOT.jar

[INFO] Copying org.apache.felix.shell.tui-1.1.0-SNAPSHOT.jar to
d:\clement\workspaces\felix-trunk\main\target\bundle\org.apache.felix.shell.
tui-1.1.0-SNAPSHOT.jar

[INFO] Copying org.apache.felix.bundlerepository-1.1.0-SNAPSHOT.jar to
d:\clement\workspaces\felix-trunk\main\target\bundle\org.apache.felix.bundle
repository-1.1.0-SNAPSHOT.jar

[INFO] [antrun:run {execution: default}]

[INFO] Executing tasks

   [delete] Deleting directory D:\clement\workspaces\felix-trunk\main\bin

    [mkdir] Created dir: D:\clement\workspaces\felix-trunk\main\bin

   [delete] Deleting directory D:\clement\workspaces\felix-trunk\main\conf

    [mkdir] Created dir: D:\clement\workspaces\felix-trunk\main\conf

   [delete] Deleting directory D:\clement\workspaces\felix-trunk\main\bundle

     [copy] Copying 1 file to D:\clement\workspaces\felix-trunk\main\bin

     [copy] Copying 1 file to D:\clement\workspaces\felix-trunk\main\conf

[INFO] Executed tasks

[INFO]
------------------------------------------------------------------------

[INFO] BUILD SUCCESSFUL

[INFO]
------------------------------------------------------------------------

[INFO] Total time: 7 seconds

[INFO] Finished at: Sun Oct 07 09:47:05 GMT 2007

[INFO] Final Memory: 10M/19M

[INFO]
------------------------------------------------------------------------

 

--

Clement Escoffier

Grenoble University

+33 (0) 4 76 51 40 24

http://clement.plop-plop.net