Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 351080 - java.io.FileNotFoundException when reading repository data
Summary: java.io.FileNotFoundException when reading repository data
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Tycho (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P2 minor (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 353496 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-07-04 08:45 EDT by Markus Kuppe CLA
Modified: 2021-04-28 16:55 EDT (History)
2 users (show)

See Also:


Attachments
Patch proposal (44.82 KB, patch)
2011-08-19 03:40 EDT, Eckart Langhuth CLA
t-oberlies: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Kuppe CLA 2011-07-04 08:45:14 EDT
java.io.FileNotFoundException: /home/markus/.m2/repository/tlatoolbox/tlatools/1.0.0-SNAPSHOT/tlatools-1.0.0-SNAPSHOT-p2artifacts.xml (No such file or directory)
	at java.io.FileInputStream.open(Native Method)
	at java.io.FileInputStream.<init>(FileInputStream.java:106)
	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)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
	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)
java.io.FileNotFoundException: /home/markus/.m2/repository/tlatoolbox/tlatools/1.0.0-SNAPSHOT/tlatools-1.0.0-SNAPSHOT-p2metadata.xml (No such file or directory)
	at java.io.FileInputStream.open(Native Method)
	at java.io.FileInputStream.<init>(FileInputStream.java:106)
	at org.eclipse.tycho.p2.repository.AbstractRepositoryReader.getContents(AbstractRepositoryReader.java:21)
	at org.eclipse.tycho.p2.maven.repository.AbstractMavenMetadataRepository.load(AbstractMavenMetadataRepository.java:74)
	at org.eclipse.tycho.p2.maven.repository.AbstractMavenMetadataRepository.<init>(AbstractMavenMetadataRepository.java:65)
	at org.eclipse.tycho.p2.maven.repository.AbstractMavenMetadataRepository.<init>(AbstractMavenMetadataRepository.java:51)
	at org.eclipse.tycho.p2.maven.repository.LocalMetadataRepository.<init>(LocalMetadataRepository.java:49)
	at org.eclipse.tycho.p2.impl.resolver.ResolutionContextImpl.<init>(ResolutionContextImpl.java:129)
	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)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
	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)
[
Comment 1 Jan Sievers CLA 2011-07-04 08:56:08 EDT
this may happen if you manually remove tycho artifacts from the local maven repo but files in ~/.m2/repository/.meta/ still contain references to the deleted artifacts.

Can you reproduce the problem after deleting ~/.m2/repository/.meta/ ?
Comment 2 Markus Kuppe CLA 2011-07-14 03:46:10 EDT
Removing the .meta/ folder works for me. Maybe the exception about the missing file could be turned into a message that indicates the inconsistency instead?
Comment 3 Jan Sievers CLA 2011-07-14 03:49:58 EDT
(In reply to comment #2)
> Removing the .meta/ folder works for me. Maybe the exception about the missing
> file could be turned into a message that indicates the inconsistency instead?

we should handle this more gracefully, e.g. remove the missing artifact from the index file if not found.
Comment 4 Tobias Oberlies CLA 2011-08-01 10:24:02 EDT
*** Bug 353496 has been marked as a duplicate of this bug. ***
Comment 5 Eckart Langhuth CLA 2011-08-19 03:40:17 EDT
Created attachment 201767 [details]
Patch proposal

Attached patch proposal
Comment 6 Tobias Oberlies CLA 2011-08-19 07:50:25 EDT
Thank you for the patch! Fixed with 0fb26fd.