Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 352505 - Feature#readJar fails with ZipException for .DS_Store files
Summary: Feature#readJar fails with ZipException for .DS_Store files
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Tycho (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Tobias Oberlies CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-19 16:14 EDT by Karsten Thoms CLA
Modified: 2021-04-28 16:54 EDT (History)
2 users (show)

See Also:


Attachments
proposed patch (filter files in the featurs directory) (2.48 KB, patch)
2011-09-02 10:15 EDT, Holger Oehm CLA
t-oberlies: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Karsten Thoms CLA 2011-07-19 16:14:26 EDT
On Mac OSX .DS_Store files are created when visiting directories with the Finder. When this happens in the features directory, Tycho tries to open that file as JarFile, which fails with a ZipException.
The error should be ignored when the file does not have the .jar file extension.

[ERROR] Internal error: java.lang.RuntimeException: Could not read feature descriptor at /Users/thoms/Development/Eclipse/eclipse-3.7/features/.DS_Store: error in opening zip file -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: Could not read feature descriptor at /Users/thoms/Development/Eclipse/eclipse-3.7/features/.DS_Store
	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.RuntimeException: Could not read feature descriptor at /Users/thoms/Development/Eclipse/eclipse-3.7/features/.DS_Store
	at org.eclipse.tycho.model.Feature.loadFeature(Feature.java:202)
	at org.eclipse.tycho.core.osgitools.targetplatform.LocalTargetPlatformResolver.resolvePlatform(LocalTargetPlatformResolver.java:110)
	at org.eclipse.tycho.core.resolver.DefaultTychoDependencyResolver.resolveProject(DefaultTychoDependencyResolver.java:90)
	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
Caused by: java.util.zip.ZipException: error in opening zip file
	at java.util.zip.ZipFile.open(Native Method)
	at java.util.zip.ZipFile.<init>(ZipFile.java:127)
	at java.util.jar.JarFile.<init>(JarFile.java:135)
	at java.util.jar.JarFile.<init>(JarFile.java:99)
	at org.eclipse.tycho.model.Feature.readJar(Feature.java:172)
	at org.eclipse.tycho.model.Feature.loadFeature(Feature.java:198)
	... 16 more
Comment 1 Tobias Oberlies CLA 2011-07-20 03:45:22 EDT
Does this issue still occur with 0.13.0-SNAPSHOT?
Comment 2 Jan Sievers CLA 2011-07-20 04:06:45 EDT
originally reported as https://issues.sonatype.org/browse/TYCHO-387
Comment 3 Karsten Thoms CLA 2011-07-20 16:22:22 EDT
Still occurs in 0.13.0-SNAPSHOT. I built from the sources.

Thread [main] (Suspended (exception ZipException))	
	ZipFile.open(String, int, long, boolean) line: not available [native method]	
	JarFile(ZipFile).<init>(File, int) line: 127	
	JarFile.<init>(File, boolean, int) line: 135	
	JarFile.<init>(File) line: 99	
	Feature.readJar(File) line: 172	
	Feature.loadFeature(File) line: 198	
	LocalTargetPlatformResolver.resolvePlatform(MavenSession, MavenProject, List<ReactorProject>, List<Dependency>) line: 110	
	DefaultTychoDependencyResolver.resolveProject(MavenSession, MavenProject, List<ReactorProject>) line: 90	
	TychoMavenLifecycleParticipant.afterProjectsRead(MavenSession) line: 91	
	DefaultMaven.doExecute(MavenExecutionRequest) line: 273	
	DefaultMaven.execute(MavenExecutionRequest) line: 156	
	MavenCli.execute(MavenCli$CliRequest) line: 534	
	MavenCli.doMain(MavenCli$CliRequest) line: 196	
	MavenCli.main(String[], ClassWorld) line: 141	
	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39	
	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25	
	Method.invoke(Object, Object...) line: 597	
	Launcher.launchEnhanced(String[]) line: 290	
	Launcher.launch(String[]) line: 230	
	Launcher.mainWithExitCode(String[]) line: 409	
	Launcher.main(String[]) line: 352
Comment 4 Tobias Oberlies CLA 2011-07-21 08:15:30 EDT
(In reply to comment #3)
> Still occurs in 0.13.0-SNAPSHOT. I built from the sources.
So it was only discussed, but unfortunately not yet solved. Thanks for verifying this.

Btw. you can also get 0.13.0-SNAPSHOT from Tycho's CI build (see http://www.eclipse.org/tycho/download.php )
Comment 5 Holger Oehm CLA 2011-09-02 10:15:13 EDT
Created attachment 202674 [details]
proposed patch (filter files in the featurs directory)

Uses a FileFilter which filters out dot files and accepts only jar files and directories in the feature folder as candidates for features.
Comment 6 Tobias Oberlies CLA 2011-09-06 11:38:00 EDT
Applied patch in master (b363c9e). Thank you Holger!