0

I have several OSGi-bundles that I want to build using Maven Tycho. While the dependencies of the first 4 bundles can be resolved without problem, Tycho quits with the following cryptic exception at the 5th:

[INFO] Resolving dependencies of MavenProject: my.parent:my.module:0.0.1-SNAPSHOT @ D:\Path\To\Project\pom.xml
[WARNING] The following locally built units have been used to resolve project dependencies:
[WARNING]   my-other-module/0.0.1.201407011334
[INFO] Resolving class path of MavenProject: my.parent:my.module:0.0.1-SNAPSHOT @ D:\Path\To\Project\pom.xml
[ERROR] Internal error: java.lang.NullPointerException -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: java.lang.NullPointerException
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:167)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: java.lang.NullPointerException
    at org.eclipse.tycho.core.osgitools.OsgiBundleProject.resolveClassPath(OsgiBundleProject.java:187)
    at org.eclipse.tycho.core.resolver.DefaultTychoDependencyResolver.resolveProject(DefaultTychoDependencyResolver.java:122)
    at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead(TychoMavenLifecycleParticipant.java:75)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
    ... 11 more

Following is the MANIFEST.MF of that bundle (Import-Package section):

Import-Package: my.other.module.package;version="[0.0,1)",
 org.apache.commons.lang3.builder;version="[3.3,4)",
 org.dozer;version="[5.5,6)",
 org.osgi.service.blueprint;version="[1.0.0,2.0.0)"

Resolving the dependencies from the repository shouldn't be a problem, as launching the bundles from within eclipse works fine.

Interesting aspect: I'm working on Windows 7x64. On my coworker's pc with Linux it runs fine.

I'm not really sure where to start finding the error - the exception doesn't really give a hint, so I'd appreciate every tip. If you need further information, I'd be happy to clarify.

sina
  • 1,817
  • 1
  • 18
  • 42
  • I checked the code, and the code seems to be very sure that the variable it is accessing is never null. But it is in your case, so there seems to be a bug. Try if it has been resolved in the current development version ([0.21.0-SNAPSHOT](https://wiki.eclipse.org/Tycho/Release_Notes/0.21)), and if it hasn't you probably need to [open a bug report](https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Tycho) and attach a stripped-down version of your project there. – oberlies Jul 10 '14 at 13:18
  • Thanks, but using the snapshot hasn't fixed it. Stripping down the project will be tough but I'll do my best and report. Until then, is there probably any workaround I could try or any other possible reason (maybe filesystem-dependent as it works on Linux) to narrow it further down? – sina Jul 10 '14 at 14:30

0 Answers0