[izpack-users] Linux Path Problem for JAR Execution

yj yj at m-itc.net
Wed Aug 29 22:08:21 CEST 2007


Thnx for the detailed explanation. I will test these out and let you 
know of the outcome.

Really thnx a lot.


-- 
Jankee Yogesh
Team Leader
M-ITC LTD
http://www.m-itc.net




Loïc wrote:
> Hi again,
>
> Thanks for the files. "Unable to access jar file" seems to mean that 
> either it doesn't exist or you have a file access rights problem.
>
> If the file is really installed on disk in the right folder (first 
> thing to check), try uncommenting the following in your install XML :
>                <executable 
> targetfile="$INSTALL_PATH/utils/DataSourceInstaller.jar" type="jar" 
> failure="ask" stage="postinstall" keep="true"/>
> and add a "class" attribute to it, with the name of the class 
> containing your Main method, like this :
>                <executable 
> targetfile="$INSTALL_PATH/utils/DataSourceInstaller.jar" type="jar" 
> class="my.package.MyMainClass" failure="ask" stage="postinstall" 
> keep="true"/>
> If this works, you could be able to get rid of the processpanel. 
> However from your processpanelspec I understand that your program 
> expects to get the install path as its first argument, but you can't 
> pass it by using this first solution (if this is the only one working 
> you'll have to adapt your main class to get its jar file location from 
> the classloader so that it doesn't need the command line argument).
>
> Else, go on reading after changing the line back to a minimal version :
>                <executable 
> targetfile="$INSTALL_PATH/utils/DataSourceInstaller.jar" 
> failure="warn" stage="never" keep="true"/>
>
> Then, first check you system for misconfiguration :
>
>     * check that the "default" JVM for your system points to something
>       compatible with your jar file (for example if you compiled your
>       JAR with a javac 5.0, if gcj-supplied java binary is active by
>       default, it may fail : check the output of "java -version" as
>       the user you used to install your product, and/or the result of
>       "alternatives --display java"). Be careful with what's set in
>       your PATH and JAVA_HOME.
>     * check your JVM security settings
>
> And finally try alternate file execution methods :
>
>     * merge your DataSourceInstaller.jar into izPack by adding a <jar
>       src="utils/DataSourceInstaller.jar" /> to your installation XML,
>       and then change your processpanelspec's job to something like
>       this (replace the FQN for your Main class as above) :
>
>             <job name="DS Install">
>                 <logfiledir>"$INSTALL_PATH/log"</logfiledir>           
>                 <executeclass name="my.package.MyMainClass">
>                       <arg>$INSTALL_PATH</arg>
>                </executeclass>
>             </job>
>
>     * write a shell script that runs "java -jar
>       $INSTALL_PATH/utils/DataSourceInstaller.jar $INSTALL_PATH" (with
>       maximum logging at first : tee all output to a file, and log the
>       exit code of the java binary along with your environnement
>       variables values - you'll remove those from the script if you
>       finally use it when you deliver your app), add it to your utils
>       pack, and call it in your processpanelspec. Be sure to have the
>       script be properly parsed and with execute permissions - for
>       example :
>
>     <parsable targetfile="$INSTALL_PATH/utils/installDataSource.sh" />
>     <executable targetfile="$INSTALL_PATH/utils/installDataSource.sh"
>     failure="warn" stage="never" />
>
>     This last solution is, to my opinion, the most complicated but by
>     far the most versatile, debbugable and nice-looking way to run a
>     job. I do it that way on all my izPacks projects, it allows me to
>     have a fine control over process execution, I can use the power of
>     the shell for a variety of tasks and I can provide user feedback
>     right into the processpanel if needed (a plain old "echo" is nice
>     even only for tracking execution when you run lots of
>     time-consuming tasks). The only drawback is that you have to write
>     a script specific to each OS you ship to (and use the <os> tag in
>     your jobs so that the right script gets executed on the user
>     platform).
>
> If you have tried all this and it still fails, please let me know. In 
> that case please post the updated XMLs, error messages, scripts and 
> log files (the one from your processpanel specs, and you can get more 
> traces from izPack by running the installer as "java -DTRACE=true -jar 
> yourinstaller.jar 2>&1 | tee izPackTraces.log " ). Include the outputs 
> of "java -version", "alternatives --display java" and " env | grep -E 
> '(JAVA_HOME|PATH)' ".
>
> Good luck,
>
> Loïc
>
> yj a écrit :
>> Hi Loic,
>>     I have tried without the line <osfamily="windows"/>  and it still 
>> fails. The capitalization seems right to me also. I am enclosing my 
>> installSpec.xml file and ProcessPanel xml file and a screenshot of 
>> the error i get on Linux.
>>
>> Thnx for helping me out with this problem. I need to deliver this asap.
>>
>>
>> Regards,
>> -- 
>> Jankee Yogesh
>> Team Leader
>> M-ITC LTD
>> http://www.m-itc.net
>>
>>
>> Loïc wrote:
>>> Hi,
>>>
>>> Starting with some obvious stuff :
>>>
>>>     * Have you tried without the line <osfamily="windows"/> ?
>>>     * Have you checked that the file name capitalization is right
>>>       (Linux is case-sensitive, windows isn't) ?
>>>
>>> If your problem persists please post the full installation XML file.
>>>
>>> Good luck,
>>>
>>> Loïc
>>>
>>> yj a écrit :
>>>> Hi All,
>>>>     I have built an installer using IzPack which executes a JAR file 
>>>> using the ProcessPanel. The JAR file is successfully executed on Windows 
>>>> but cannot be located on Linux. I have tried this of Fedora Core 7 and 
>>>> Ubuntu Fesity Fawn but with no success.
>>>>
>>>>
>>>> My ProcessPanelSpec.xml is as follows:
>>>>
>>>>
>>>> <processing>
>>>>     <job name="DS Install">
>>>>         <logfiledir>"$INSTALL_PATH/log"</logfiledir>
>>>>         <osfamily="windows"/>
>>>>         <executefile name="java">
>>>>             <arg>-jar</arg>
>>>>             <arg>"$INSTALL_PATH/utils/DataSourceInstaller.jar"</arg>
>>>>             <arg>$INSTALL_PATH</arg>
>>>>         </executefile>
>>>>     </job>
>>>> </processing>
>>>>
>>>>
>>>>
>>>> Can anyone help me out with this problem.
>>>>
>>>> Loads of Thanx
>>>>
>>>>
>>>> Regards,
>>>>
>>>>   
>>>
>>> ------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> izpack-users mailing list
>>> izpack-users at lists.berlios.de
>>> https://lists.berlios.de/mailman/listinfo/izpack-users
>>>   
>>> ------------------------------------------------------------------------
>>>
>>> No virus found in this incoming message.
>>> Checked by AVG Free Edition. 
>>> Version: 7.5.484 / Virus Database: 269.12.10/976 - Release Date: 8/27/2007 6:20 PM
>>>   
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> 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
> https://lists.berlios.de/mailman/listinfo/izpack-users
>   
> ------------------------------------------------------------------------
>
> No virus found in this incoming message.
> Checked by AVG Free Edition. 
> Version: 7.5.484 / Virus Database: 269.12.10/977 - Release Date: 8/28/2007 4:29 PM
>   




More information about the izpack-users mailing list