[izpack-users] ClassCastException with custom listeners

Steve Dodge steve at robododge.com
Thu May 24 04:40:46 CEST 2007


Hello,

I'm thinking that my explanation is too complicated.  Let me  
simplify.  I've created a compiler listener and installer listener.   
I've added those to my install.xml.  Since I'm using the standalone- 
compiler, I set  the "jar" attribute.  The compiler listener runs as  
expected, but when the installer is running, it gets a  
ClassCastException because my compiler listener is incorrectly placed  
in the collection of InstallerListener objects.

Thanks,
Steve



On May 21, 2007, at 10:40 AM, Steve Dodge wrote:

> I've built a compile listener and an installer listener.  Using
> IzPack 3.10.1.   The compile listener added a filename to the of a
> Velocity template to the additionalData map.  The Installer listener
> checks during afterFile() if the name of the file matches a Velocity
> template, and applies the template if so.  I am also using the
> standalone-compiler.jar. My install.xml has the following.
>
>    <listeners>
>     <listener
>        compiler="nm.trw.utils.listener.CompileListener"
>        installer="nm.trw.utils.listener.VelocityListener"
>        jar="lib/tekPackListeners.jar"
>        />
>
>     <listener installer="AntActionInstallerListener"
>                uninstaller="AntActionUninstallerListener"/>
>     </listeners>
>
> Using debug output, I verify the compile listener is being called
> correctly during compile time as it searches for <addititionalData>
> tags within the <fileset> and parses the data correctly.
> During install, when the install panel is showing the progress bar, I
> get the following exception:
>
> java.lang.ClassCastException: nm.trw.utils.listener.CompileListener
>          at com.izforge.izpack.installer.Unpacker.getCustomActions
> (Unpacker.java:1139)
>          at com.izforge.izpack.installer.Unpacker.run(Unpacker.java: 
> 295)
>          at java.lang.Thread.run(Thread.java:613)
>
> Looking at the code for Unpacker, it seems the CompileListener was
> improperly placed in the collection of InstallerListeners, thus
> ClassCastException.
>
> Here are the <jars> that I had to add to make it work.
> <jar src="lib/tekPackListeners.jar"/>
> <jar src="lib/izevent-3.10.1.jar"/>
> <jar src="lib/compiler-3.10.1.jar"/><!-- this one has to be here,
> izevent isn't enough,  otherwise ClassNotFoundException for
> CompilerListener interface
> <jar src="lib/ant-1.6.5.jar"/>
> <jar src="lib/ant-launcher-1.6.5.jar"/>
> <jar src="lib/velocity-1.5.jar"/>
>
> I think I'm missing something in the installation here.
>
> Thanks,
> Steve
>
>
>
>
>
>
> Am I missing something in the setup here?  I cannot figure out how
> CompileListener makes it way into the
>
>
>
> _______________________________________________
> 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