[izpack-users] Using ProcessPanel and Log4J

Mandeep Saini Mandeep.Saini at dante.org.uk
Fri Apr 20 11:19:42 CEST 2007


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 following:
>  
> 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 name="com.traderoot.tools.artifact.installer.LicenseInstall">
>   <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 panel....
> 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];
	myMethod(install_path);
}

public void myMethod(){
}
}

Hope this works for you.

Regards
Mandeep

>  
> thanks guys
>  
>  
>  
> 	
> 
> MARIUS HUGO
> 
> 
> SOFTWARE ENGINEER
> 
> 	
> 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 Reece.
> 
>  
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> 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