[izpack-users] Custom Actions, NPE when running installer, ca.listenerName == null

Scott Plante splante at insightsys.com
Wed Mar 7 16:26:21 CET 2007


Hi,
  I tried to create my first custom action. I think I followed the 
instructions in the build:
file://$IZPACK_HOME/doc/izpack/xhtml/node9.html#SECTION00931000000000000000
although I wasn't clear about the instruction to create an antcall 
target="compile.listener.simple" since there is no such target in the 
build.xml file. Also, it's not clear where in the build.xml to add said 
antcall. I figured this might be outdated doc, since below in the 
example, it shows to change the lines around the "CUSTOM ACTION test 
START" comment, which I did.

  I'm successfully creating my bin/customAction/ZyInstallListener.jar 
file and the installer gets created without any obvious errors, however 
when I run the installer I get an immediate stack trace.

java.lang.NullPointerException
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:164)
        at 
com.izforge.izpack.installer.InstallerBase.loadCustomData(InstallerBase.java:356)
        at 
com.izforge.izpack.installer.InstallerBase.loadInstallData(InstallerBase.java:218)
        at 
com.izforge.izpack.installer.GUIInstaller.<init>(GUIInstaller.java:110)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 
Method)
        at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
        at java.lang.Class.newInstance0(Class.java:350)
        at java.lang.Class.newInstance(Class.java:303)
        at com.izforge.izpack.installer.Installer.main(Installer.java:62)

  I've traced this problem down to this code in 
src/lib/com/izforge/izpack/installer/InstallerBase.java:
                case CustomData.INSTALLER_LISTENER:
                   Class clazz = Class.forName(ca.listenerName);
                    if (clazz == null)
                        throw new InstallerException("Custom action "
                            + ca.listenerName + " not bound!");
                    out[ca.type].add(clazz.newInstance());
                    break;
 
The 'ca' comes out the "/customData" serialized object. I added a debug 
line and ca.listenerName is null.

Does anyone have any advice?

Thanks,

-- 
Scott Plante, CTO
Insight Systems, Inc.
(+1) 404 873 0058 x104
splante at insightsys.com
http://zyross.com




More information about the izpack-users mailing list