[izpack-users] Using ProcessPanel and Log4J

Marius Hugo marius.hugo at traderoot.com
Tue Apr 24 11:35:41 CEST 2007

Thanks, I tried all of that now, but I still get an exception and I
cannot get the ProcessPanel logging to work...
My code that im passing looks like this

public class LicenseInstall {
	public void run(AbstractUIProcessHandler handler, String[]
		String install_path = args[0];
			LicenseInstall l = new LicenseInstall(args);
		} catch (Exception x){
			Util.log(Util.ERROR,"Uh-oh! ", classname,x);

I expected to have a log file created containing the text "WORKING" on
the C drive as is configured in my log4j, that didn't work inside the
ProcessPanel (if I just run it in my environment it works)
I have tried to just make a BufferedWriter and create a text file just
to see if my class at least
runs, but that also does nothing...so I don't think the log4j is the

I get the following window that pops up when I run the process panel:
Title -> Post Processing Error
-> Exception when running class:

Could anyone point out anything that I'm missing? I'm gonna attach my
install.xml file, etc...


-----Original Message-----
From: izpack-users-bounces at lists.berlios.de
[mailto:izpack-users-bounces at lists.berlios.de] On Behalf Of Mandeep
Sent: 20 April 2007 11:20
To: izpack-users at lists.berlios.de
Subject: Re: [izpack-users] Using ProcessPanel and Log4J

Hi Marius,

see the related comments below:
Marius Hugo wrote:
> Hi, I'm new to IzPack and I'm having a bit of trouble with the
> I have to merge files based on versioning and a license that I must 
> parse.  I have written my own code to handle this and included it in a

> ProcessPanel.  I loaded the jars necessary using the <jar> tag (these 
> tags are in my install.xml).

Make sure you also include the jars on which your class has dependency,
unless its already in izpack. For example, if my classes have dependency
on 'commons-codec-1.3.jar' and my processing classes are in another jar
file (say processingClasses.jar) then in my install.xml I will write:

<jar src="target/processPanelJar/processingClasses.jar" /> <jar
src="target/jars/commons-codec-1.3.jar" />

> When I  get to running the panel, it simply tells me that there has 
> been an exception using my class and there is no actual indication 
> that the correct action was taken or that my class was even run (I 
> also have no clue what the exception is, it doesn't specify)
> My class uses log4j and that has to read a file for its config.  
> Normally I would just say the following:
> java  -Dlog4j.configuration=log4j.properties com.bla bla bla.MyClass

If your class file needs some config file like 'log4j.properties' then
the jar file which contains your class should also contain the
properties file. make the code to find it from there.
> How would I get this right in the process panel?  Cause I need to see 
> the logs so that I can know what's going on.
> Also, I attempted to enable the ProcessPanel logging, but the file 
> never gets created in $INSTALL_PATH.

I have also tried to enable ProcessPanel logging but I could not do so. 
As far as I remember this feature is not completely implemented yet but
I cant remember the actual cause.
> My ProcessPanel config looks a little something like this:
> <processing>
>  <job name="InstallArtifacts">
>  <logfiledir>$INSTALL_PATH</logfiledir>
>  <executeclass
>   <args>
>               <arg value="$trtLicense"/>
>               <arg value="$INSTALL_PATH/TradeRoot/Installations/"/>
>               <arg value="$INSTALL_PATH/TradeRoot/Repositories"/>
>               <arg value="Stack"/>
>              </args>
>  </executeclass>
>  </job>
> </processing>
> $trtLicense -> location of license that i captured in a UserInput
> I understand that all these values are passed in the specified order 
> to the main method of the class that I specified.

When you write any class for process panel, you don't need to write main
method instead you write the run( AbstractUIProcessHandler handler,
String[] args) method. For example:

import com.izforge.izpack.util.AbstractUIProcessHandler;

public class MyClass {
public void run( AbstractUIProcessHandler handler, String[] args){
	String install_path = args[0];

public void myMethod(){

Hope this works for you.


> thanks guys
> c
> t
> f
> 	+27 72 237 4083
> +27 21 551 5444
> +27 21 551 5449
> 	*TRADEROOT **TECHNOLOGIES (Pty)Ltd. Reg. No. 2000/005984/07.
> www.traderoot.com Directors* E von Engelhardt, J Ludik, B Dungan, W
> ----------------------------------------------------------------------
> --
> _______________________________________________
> izpack-users mailing list
> izpack-users at lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/izpack-users

izpack-users mailing list
izpack-users at lists.berlios.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: install.xml
Type: text/xml
Size: 4189 bytes
Desc: install.xml
Url : https://lists.berlios.de/pipermail/izpack-users/attachments/20070424/834fcc02/attachment.xml 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ProcessPanel.Spec.xml
Type: text/xml
Size: 659 bytes
Desc: ProcessPanel.Spec.xml
Url : https://lists.berlios.de/pipermail/izpack-users/attachments/20070424/834fcc02/attachment-0001.xml 

More information about the izpack-users mailing list