[izpack-devel] Strange NullPointerException
Chris McGonagle
Chris at fbbt.co.uk
Thu Mar 30 13:23:05 CEST 2006
Hi all,
Hope someone can help with this problem I've been having - the Ant
script itself runs fine as a standalone script, but somehow when I try
to run it as part of the IzPack install process, it falls over with a
NullPointerException.
Here is the stack trace from the installer:
LOG enabled.
creating Logfile: 'IzPack_Logfile_at_1143717579047.txt' in:
'C:\DOCUME~1\Chris\L
OCALS~1\Temp\'
TRACE enabled.
STACKTRACE enabled.
No custom langpack available.
checking if os constraints [Os family unix name null version null arch
null ] m
atch current OS
no match with current OS!
checking if os constraints [Os family windows name null version null
arch null
] match current OS
matched current OS.
checking if os constraints [Os family unix name null version null arch
null ] m
atch current OS
no match with current OS!
checking if os constraints [Os family windows name null version null
arch null
] match current OS
matched current OS.
******* Executing all afterpacks actions of runinstallers ...
Calling ANT with buildfile: C:/Temp/build_runinstallers.xml
com.izforge.izpack.installer.InstallerException:
java.lang.NullPointerException
at
com.izforge.izpack.event.AntActionInstallerListener.performAllActions
(AntActionInstallerListener.java:260)
at
com.izforge.izpack.event.AntActionInstallerListener.afterPacks(AntAct
ionInstallerListener.java:189)
at
com.izforge.izpack.installer.Unpacker.informListeners(Unpacker.java:1
036)
at com.izforge.izpack.installer.Unpacker.run(Unpacker.java:563)
Caused by: java.lang.NullPointerException
at java.util.Hashtable.put(Hashtable.java:389)
at
org.apache.tools.ant.PropertyHelper.setProperty(PropertyHelper.java:3
35)
at
org.apache.tools.ant.Project.setPropertyInternal(Project.java:460)
at
org.apache.tools.ant.Project.setSystemProperties(Project.java:800)
at
com.izforge.izpack.event.AntAction.performAction(AntAction.java:140)
at
com.izforge.izpack.event.AntAction.performInstallAction(AntAction.jav
a:100)
at
com.izforge.izpack.event.AntActionInstallerListener.performAllActions
(AntActionInstallerListener.java:256)
... 3 more
My AntActionsSpec.xml looks like this:
<antactions>
<pack name="runinstallers">
<antcall buildfile="C:/Temp/build_runinstallers.xml"
order="afterpacks" verbose="yes" logfile="C:/Temp/mainantinstall.log">
<target name="do_all"/>
</antcall>
</pack>
</antactions>
Ant build script:
<project name="build_runinstallers" default="do_all" basedir=".">
<!-- set global properties for this build
<property environment="env"/>
<property name="build.compiler" value="${JAVAC}"/>
<property name="classpath.thisbuild" value="${env.CLASSPATH}"/>
-->
<target name="do_all"
depends="which_installers,execute_comms_installer,execute_database_insta
ller,execute_access_installer"/>
<target name="which_installers" description="">
<condition property="comms.layer">
<equals arg1="${COMMS_LAYER}" arg2="on"/>
</condition>
<condition property="database.layer">
<equals arg1="${DATABASE_LAYER}" arg2="on"/>
</condition>
<condition property="access.layer">
<equals arg1="${ACCESS_LAYER}" arg2="on"/>
</condition>
</target>
<target name="execute_comms_installer" if="comms.layer"
description="Should run any of the comms installers">
<java jar="${INSTALL_TYPE}_comms.jar" fork="true"/>
</target>
<target name="execute_database_installer" if="database.layer"
description="Should run any of the database installers">
<java jar="${INSTALL_TYPE}_database.jar" fork="true"/>
</target>
<target name="execute_access_installer" if="access.layer"
description="Should run any of the access installers">
<java jar="${INSTALL_TYPE}_access.jar" fork="true"/>
</target>
</project>
And the Install.xml looks like this:
<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
<!--
Matador Server IzPack creation file.
This file is used during IzPack compilation process
to create the Matador Database installer.
-->
<installation version="1.0">
<!--
The info section.
The meaning of the tags should be natural ...
-->
<info>
<appname>Matador</appname>
<appversion>1.1</appversion>
<authors>
<author name="FBBT" email="info at fbbt.co.uk"/>
</authors>
<url>http://www.fbbt.co.uk/</url>
<uninstaller write="no"/>
</info>
<!--
The gui preferences indication.
Sets the installer window to 800x800. It will not be able to
change the size.
-->
<guiprefs width="600" height="400" resizable="no">
<laf name="looks">
<os family="unix"/>
</laf>
<laf name="looks">
<os family="windows"/>
</laf>
</guiprefs>
<!--
Different locales not required yet...
-->
<locale>
<langpack iso3="eng"/>
</locale>
<!--
The resources section.
The ids must be these ones if you want to use the LicencePanel
and/or the InfoPanel.
-->
<resources>
<res id="HTMLLicencePanel.licence" src="licence.html"/>
<res id="HTMLInfoPanel.info" src="readme.html"/>
<res id="userInputSpec.xml" src="userInputSpec.xml"/>
<res id="AntActionsSpec.xml" src="AntActionsSpec.xml"/>
</resources>
<listeners>
<listener installer="AntActionInstallerListener"
uninstaller="AntActionUninstallerListener"/>
</listeners>
<jar src="jars/ant.jar" stage="both"/>
<jar src="jars/commons-net-1.4.1.jar" stage="both"/>
<jar src="jars/jakarta-oro-2.0.8.jar" stage="both"/>
<jar src="jars/jsch.jar" stage="both"/>
<jar src="jars/xercesImpl.jar" stage="both"/>
<jar src="jars/xml-apis.jar" stage="both"/>
<!--
The panels section.
We indicate here which panels we want to use. The order will be
respected.
-->
<panels>
<panel classname="HelloPanel"/>
<panel classname="HTMLInfoPanel"/>
<panel classname="UserInputPanel"/>
<panel classname="InstallPanel"/>
<panel classname="SimpleFinishPanel"/>
</panels>
<!--
The packs section.
We specify here our packs.
-->
<packs>
<pack name="Base" required="yes">
<description>Ant Build scripts for servers</description>
<file src="build_runinstallers.xml" targetdir="/tmp">
<os family="unix"/>
</file>
<file src="build_runinstallers.xml" targetdir="C:/Temp">
<os family="windows"/>
</file>
<parsable targetfile="/tmp/build_runinstallers.xml">
<os family="unix"/>
</parsable>
<parsable targetfile="C:/Temp/build_runinstallers.xml">
<os family="windows"/>
</parsable>
</pack>
<pack name="runinstallers" required="yes">
<!-- Dummy pack here so that the other pack gets completed
before ANT is tried to be run on it -->
<description>Dummy Pack needed for
installation</description>
</pack>
</packs>
</installation>
Any ideas would be welcome!!
--
Chris McGonagle
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.berlios.de/pipermail/izpack-devel/attachments/20060330/9db6fbb8/attachment.html
More information about the izpack-devel
mailing list