This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 40812 - MakeNBM ant task give misleading error message
Summary: MakeNBM ant task give misleading error message
Status: RESOLVED DUPLICATE of bug 36759
Alias: None
Product: www
Classification: Unclassified
Component: Builds & Repositories (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P2 blocker (vote)
Assignee: Michal Zlamal
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-03-05 21:48 UTC by Nam Nguyen
Modified: 2004-03-08 10:46 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nam Nguyen 2004-03-05 21:48:49 UTC
When wrong location is specified for a jar to be
used in a MakeNBM task, users error very
misleading error about the manifest.mf file:
"Can't get manifest attributes".

Example:
<target name="nbm" depends="netbeans">
   <makenbm file="j2eeserver-deprecated.nbm"
     topdir="."
     module="non-existent.jar"
   </makenbm>
 </target>

While its true that failure to find the jar file
(IOException) would prevent access to manifest
attributes, its likely to puzzle developers into
debugging the manifest.mf file, wasting a lot of time.

It will be more useful to print error text from
the IOException instead.
Comment 1 Jesse Glick 2004-03-06 01:46:44 UTC
Actually the bug appears to be in MakeListOfNBM.java:

try {
    Method m = nbms[i].getClass().getDeclaredMethod("getAttributes",null);
    m.setAccessible(true);
    attr = (Attributes)m.invoke(nbms[i],null);
} catch (Exception ex) {
    throw new BuildException( "Can't get manifest attributes", ex,
location );
}

I hope this horrible code is going to be deleted soon with the
layers_36759 merge, but in the meantime probably the penultimate line
should read

throw new BuildException("Can't get manifest attributes: " + ex, ex,
location);

I assume the actual problem is shown if you run Ant with -verbose but
not otherwise.
Comment 2 Michal Zlamal 2004-03-08 10:46:59 UTC
As I'm planning to commit layers_36759 at Tuesday March 9 morning GMT 
so I think I can close this as duplicate to #36759.

*** This issue has been marked as a duplicate of 36759 ***