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 178253 - Build doesn't fail if packaging is failed
Summary: Build doesn't fail if packaging is failed
Status: RESOLVED FIXED
Alias: None
Product: javacard
Classification: Unclassified
Component: Java Card (show other bugs)
Version: 6.x
Hardware: PC Windows Vista
: P3 normal (vote)
Assignee: _ tboudreau
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-07 09:38 UTC by dkuzmin
Modified: 2010-04-01 03:24 UTC (History)
1 user (show)

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 dkuzmin 2009-12-07 09:38:53 UTC
Create new "classic applet" project, open applet.xml and change class name in this line:

  <applet-class>classicapplet1.ClassicApplet1</applet-class>

"Run" project. Output:
-----------------
...
error: Applet classicapplet1/ClassicApplet11 is not found in package classicapplet1.
...
error: Applet classicapplet1/ClassicApplet11 is not found in package classicapplet1.
...
D:\w\nbp\ClassicApplet1\nbproject\build-impl.xml:227: BundleFile 'D:\w\nbp\ClassicApplet1\dist\ClassicApplet1.cap' does not exists
BUILD FAILED (total time: 1 second)
-----------------

So, 1st there is a message that packaging failed. At this point its clear already that application can't be run. And yet procedure continues until installer reports that file doesn't exist.

A user have to search in output window to find a real reason of failure.

Build used is #98.
Comment 1 _ tboudreau 2009-12-07 10:59:40 UTC
Probably on packaging failure, the packager or its task should call System.exit() with a non-zero value or throw an Ant BuildException.  The build script does
            <target name="do-pack">
                <jc-pack failonerror="true"/>
            </target>
so with failonerror="true", the problems is that the packager is never throwing an exception or producing an exit code indicating failure.

If it can't be changed now, we could do something in the build script that checks for the destination file's existence, and fails the build immediately if it is missing, but the best message we could give is "Packaging failed."  The packager could actually tell the user why it failed, which would probably be much more useful to the user.
Comment 2 _ tboudreau 2010-02-16 19:44:47 UTC
It appears that packager *never* fails - same problem if you use ints or doubles in a classic applet project - you still get BUILD SUCCESSFUL.
Comment 3 msmirnov 2010-03-17 11:41:10 UTC
Packager task should throw BuildException when packaging operation was unsuccessful.
Comment 4 msmirnov 2010-03-17 11:42:50 UTC
Issue is fixed in PackTask by throwing BuildException in case when required distributable file wasn't created by Packager tool. Fixed in nbtasks.jar
Comment 5 msmirnov 2010-03-31 15:29:47 UTC
Previous fix was incomplete. JCPackagerTask was checking if destination file exists. However packager task could be invoked when destination file previously existed. So I added deletion of destination file in JCPackagerTask before executing Packager.
Comment 6 _ tboudreau 2010-04-01 03:24:29 UTC
Fixed in ant tasks jar - closing