Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 363143 - Avoid NPE in RepositoryLayoutHelper.getRelativePath
Summary: Avoid NPE in RepositoryLayoutHelper.getRelativePath
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Tycho (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Tobias Oberlies CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-08 04:55 EST by Tobias Oberlies CLA
Modified: 2021-04-28 16:54 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Oberlies CLA 2011-11-08 04:55:36 EST
This is a stack trace which I got from a colleague a while ago. I looked at the code, and as far as I can see, the problem can still occur.

[INFO] Resolving target platform for project MavenProject: xxxxxxx @ xxxxxxx
[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:168)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:534)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: java.lang.NullPointerException
        at org.eclipse.tycho.p2.repository.RepositoryLayoutHelper.getRelativePath(RepositoryLayoutHelper.java:67)
        at org.eclipse.tycho.p2.repository.LocalRepositoryReader.getLocalArtifactLocation(LocalRepositoryReader.java:25)
        at org.eclipse.tycho.p2.repository.AbstractRepositoryReader.getContents(AbstractRepositoryReader.java:21)
        at org.eclipse.tycho.p2.maven.repository.AbstractMavenArtifactRepository.loadMaven(AbstractMavenArtifactRepository.java:87)
        at org.eclipse.tycho.p2.maven.repository.AbstractMavenArtifactRepository.<init>(AbstractMavenArtifactRepository.java:73)
        at org.eclipse.tycho.p2.maven.repository.LocalArtifactRepository.<init>(LocalArtifactRepository.java:49)
        at org.eclipse.tycho.p2.impl.resolver.ResolutionContextImpl.<init>(ResolutionContextImpl.java:128)
        at org.eclipse.tycho.p2.impl.resolver.P2ResolverFactoryImpl.createResolutionContext(P2ResolverFactoryImpl.java:32)
        at org.eclipse.tycho.p2.impl.resolver.P2ResolverFactoryImpl.createResolutionContext(P2ResolverFactoryImpl.java:1)
        at org.eclipse.tycho.p2.resolver.P2TargetPlatformResolver.resolvePlatform(P2TargetPlatformResolver.java:151)
        at org.eclipse.tycho.core.resolver.DefaultTychoDependencyResolver.resolveProject(DefaultTychoDependencyResolver.java:85)
        at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead(TychoMavenLifecycleParticipant.java:91)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:273)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
        ... 11 more
Comment 1 Tobias Oberlies CLA 2011-11-08 08:20:44 EST
Fixed with commit 3dd2fc3