[izpack-users] Custom Actions, NPE when running installer, ca.listenerName == null
Bartz, Klaus
Klaus.Bartz at coi.de
Wed Mar 7 18:24:06 CET 2007
Hi Scott,
sorry, the docu is at some points really out of date.
I do not know why the described problem should be manner.
I have many custom actions. I have made on the fly a dummy
and it works also. Never see CustomData := null. Can only
be if something will be wrong at compile time. Jarfile
without same named class?
Look again into build.xml. May be copy the entry for
SummaryLoggerInstallerListener and addapt it to your listener.
Try first with one in com.izforge.izpack.event. Later you
can move other where. Do not forget to include all used classes
(except which are in izevent.jar).
For implementing custom actions it will be a good idea to
take it in a eclipse or idea project.
hope it helps a little bit
Cheers
Klaus
> -----Original Message-----
> From: izpack-users-bounces at lists.berlios.de
> [mailto:izpack-users-bounces at lists.berlios.de] On Behalf Of
> Scott Plante
> Sent: Wednesday, March 07, 2007 4:26 PM
> To: izpack-users at lists.berlios.de
> Subject: [izpack-users] Custom Actions, NPE when running
> installer,ca.listenerName == null
>
>
> 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#SECTION0093100
> 0000000000000
> 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(Inst
> allerBase.java:356)
> at
> com.izforge.izpack.installer.InstallerBase.loadInstallData(Ins
> tallerBase.java:218)
> at
> com.izforge.izpack.installer.GUIInstaller.<init>(GUIInstaller.
> java:110)
> at
> sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
> at
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeCo
> nstructorAccessorImpl.java:39)
> at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Dele
gatingConstructorAccessorImpl.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
>
> _______________________________________________
> izpack-users mailing list
> izpack-users at lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/izpack-users
>
More information about the izpack-users
mailing list