Izpack抛出NullPointerException来处理bat文件,如何解决?

时间:2012-01-04 20:36:37

标签: nullpointerexception izpack

我使用PackJacket应用程序创建了一个安装程序,并使用IzPack版本4.3.5(最新稳定版)编译了xml规范。当我尝试运行安装时,进程停止了java NullPointerException:

Current focus owner: null
Condition is fulfilled or not existent.
checking if os constraints [Os  family windows name null version null arch null
jre null ] match current OS
matched current OS.
Condition is fulfilled or not existent.
checking if os constraints [Os  family windows name null version null arch null
jre null ] match current OS
matched current OS.
Exception in thread "processing thread" java.lang.NullPointerException
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:441)
        at com.izforge.izpack.installer.ProcessPanelWorker$ExecutableFile.run(Un
known Source)
        at com.izforge.izpack.installer.ProcessPanelWorker$ProcessingJob.run(Unk
nown Source)
        at com.izforge.izpack.installer.ProcessPanelWorker.run(Unknown Source)
        at java.lang.Thread.run(Thread.java:619)

这是相关的xml部分:

资源:

<res id="ProcessPanel.Spec.xml" src="Install_processPanelSpec.xml"/>

Install_processPanelSpec.xml:

<processing>
    <job name="Instalar DLL's">
        <os family="Windows"/>
        <executefile name="$INSTALL_PATH/dlls/install.bat">
            <arg/>
        </executefile>
    </job>
    <job name="Configurar Acesso ao Banco">
        <os family="Windows"/>
        <executefile name="$INSTALL_PATH/config.bat">
            <arg/>
        </executefile>
    </job>
</processing>

1 个答案:

答案 0 :(得分:0)

更改为使用<executable>代替<pack>中的<processing>

<pack name="DLL Inner" preselected="yes" required="yes">
  <executable failure="abort" keep="false" stage="postinstall" targetfile="$INSTALL_PATH/install.bat"/>
</pack>