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
The issue is confirmed to be closed.