Maven 2.x Dependency Plugin

incomplete literal/length tree when analyzing

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Blocker Blocker
  • Resolution: Fixed
  • Affects Version/s: 2.0
  • Fix Version/s: 2.2
  • Component/s: analyze
  • Labels:
    None
  • Number of attachments :
    2

Description

Starting analyze from a project directory, it crashes with this message : "incomplete literal/length tree".
It seems like some zip is corrupted, I guess this is a jar that may have this problem, but I can't figure which one it is.

I guess maven-dependency-plugin should at least try to catch this exception to log which jar it was trying to analyze. This would help identify the corrupted jar in the local maven repository and try to correct/update it.

Thanks a lot.

  1. analyze-crash.txt
    07/Feb/08 3:58 AM
    5 kB
    Baptiste MATHUS
  2. MDEP-143.diff
    04/Jan/10 2:05 AM
    2 kB
    Dan Tran

Activity

Hide
Dan Tran added a comment -

To fix this we need to wrap the original IOException with another IOException with additional info about the bad jar, however java 4 IOException does not have constructor IOException ( String cause, Throwable e ) ( and java 5 does )

so this is a tough fix, unless we are willing to throw another Exception type instead of IOException and still make Java 4 compatible at

public interface ClassAnalyzer
{
// fields -----------------------------------------------------------------

String ROLE = ClassAnalyzer.class.getName();

// public methods ---------------------------------------------------------

Set analyze( URL url )
throws IOException;
}

Show
Dan Tran added a comment - To fix this we need to wrap the original IOException with another IOException with additional info about the bad jar, however java 4 IOException does not have constructor IOException ( String cause, Throwable e ) ( and java 5 does ) so this is a tough fix, unless we are willing to throw another Exception type instead of IOException and still make Java 4 compatible at public interface ClassAnalyzer { // fields ----------------------------------------------------------------- String ROLE = ClassAnalyzer.class.getName(); // public methods --------------------------------------------------------- Set analyze( URL url ) throws IOException; }
Hide
Dan Tran added a comment -

add a test to produce this issue at

Revision: 894551
Author: dantran
Date: 11:35:31 PM, Tuesday, December 29, 2009
Message:
Add test for MDEP-143


Modified : /maven/shared/trunk/maven-dependency-analyzer/src/test/java/org/apache/maven/shared/dependency/analyze/DefaultClassAnalyzerTest.java

Show
Dan Tran added a comment - add a test to produce this issue at Revision: 894551 Author: dantran Date: 11:35:31 PM, Tuesday, December 29, 2009 Message: Add test for MDEP-143
Modified : /maven/shared/trunk/maven-dependency-analyzer/src/test/java/org/apache/maven/shared/dependency/analyze/DefaultClassAnalyzerTest.java
Hide
Dan Tran added a comment -

I think it is worth to rethrow another ZipException for the shake of better error visibility. I attached the patch for review purpose since it is not a clean fix, until we start using java 5 where we would not lose the original stack trace

Show
Dan Tran added a comment - I think it is worth to rethrow another ZipException for the shake of better error visibility. I attached the patch for review purpose since it is not a clean fix, until we start using java 5 where we would not lose the original stack trace
Hide
Herve Boutemy added a comment -

patch applied in r922584
added a call to initCause() API (JDK 1.4) to avoid loosing original stack trace

Show
Herve Boutemy added a comment - patch applied in r922584 added a call to initCause() API (JDK 1.4) to avoid loosing original stack trace

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: