History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IZPACK-51
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Dennis Reil
Reporter: Sean Diamond
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
IzPack

NullPointerException occurring in MultiVolumePackager

Created: 07/Apr/08 03:30 PM   Updated: 23/Apr/08 02:02 PM
Component/s: Compiler
Affects Version/s: 3.11.0
Fix Version/s: 4.0.0

Time Tracking:
Not Specified


 Description  « Hide
I'm seeing a NullPointerException when attempting to package my application across multiple volumes. I added the following snippet of xml to my installation xml file:

<packaging>
<packager class="com.izforge.izpack.compiler.MultiVolumePackager">
<options volumesize="734003200" firstvolumefreespace="104857600"/>
</packager>
<unpacker class="com.izforge.izpack.installer.MultiVolumeUnpacker" />
</packaging>

When I try to compile it, I get the following output:

Copying the skeleton installer
Copying 7 files into installer
Merging 8 jars into installer
Writing 2 Packs into installer
Writing Pack 0: My Program
-> Fatal error :
null
java.lang.NullPointerException
at com.izforge.izpack.compiler.MultiVolumePackager.writePacks(MultiVolumePackager.java:367)
at com.izforge.izpack.compiler.MultiVolumePackager.createInstaller(MultiVolumePackager.java:138)
at com.izforge.izpack.compiler.Compiler.createInstaller(Compiler.java:281)
at com.izforge.izpack.compiler.CompilerConfig.executeCompiler(CompilerConfig.java:340)
at com.izforge.izpack.compiler.CompilerConfig.main(CompilerConfig.java:2229)
at com.izforge.izpack.compiler.Compiler.main(Compiler.java:709)

I looked at the code and it appears that this exception is due to the fact that the MultiVolumePackager is wrapping the PackFile returned from the Iterator in an XPackFile which causes the map lookup in PackInfo to fail when it doesn't receive one of the keys it returned from its Iterator. When I changed the code to pass the PackFile returned from the Iterator into the PackInfo's getFile() method, everything apeared to work correctly:

Iterator iter = packInfo.getPackFiles().iterator();
while (iter.hasNext())
{
boolean addFile = !pack.loose;
PackFile packFile = (PackFile)iter.next(); // Store off the original PackFile
XPackFile pf = new XPackFile( packFile );
File file = packInfo.getFile( packFile ); // Use the PackFile returned from the iterator instead of the wrapper XPackFile



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Julien Ponge - 23/Apr/08 02:02 PM
The issue is confirmed to be closed.