This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 145446 - JDK 5 JNLP cannot process master.jnlp due to file extension
Summary: JDK 5 JNLP cannot process master.jnlp due to file extension
Status: CLOSED FIXED
Alias: None
Product: apisupport
Classification: Unclassified
Component: Harness (show other bugs)
Version: 6.x
Hardware: All Windows XP
: P3 blocker (vote)
Assignee: rmichalsky
URL:
Keywords: JDK_SPECIFIC
Depends on: 148923
Blocks:
  Show dependency tree
 
Reported: 2008-08-28 15:27 UTC by cappicard
Modified: 2011-06-09 09:57 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Patch to jnlp.xml to properly copy image file w/ correct file extension for JNLP desktop icon (1.93 KB, text/plain)
2008-08-28 20:50 UTC, cappicard
Details

Note You need to log in before you can comment on or make changes to this bug.
Description cappicard 2008-08-28 15:27:25 UTC
The user is allowed currently to select .jpg, .gif, and .png for the app icon. I have tested this defect with module suites.

jnlp.xml is merely copying the image file and renaming it as master.png, with no regards to file format.

JNLP 1.5 is incapable of reading PNG files. As soon as it encounters a non-supported file extension in master.jnlp (as
well as branding.jnlp), it will not attempt to load the file. JNLP 1.6 is still able to load the file. 

It's recommended that jnlp.xml extract the file extension of the image file, and use that to modify
master.jnlp/branding.jnlp accordingly (along with copying the image while maintaining the file extension).
Comment 1 cappicard 2008-08-28 17:42:37 UTC
My current workaround in my build.xml:

    <target name="build-jnlp" depends="-pre-build-jnlp,suite.build-jnlp">
        <property name="jnlp.dest.dir" value="build/jnlp" />

        <pathconvert property="image.ext">
            <path path="${app.icon}"/>
            <mapper type="regexp" from="^(.*)\.(.*)$$" to="\2"/>
        </pathconvert>
        
        <delete file="${jnlp.dest.dir}/master.png" failonerror="false" />
        
        <copy file="${app.icon}" tofile="${jnlp.dest.dir}/master.${image.ext}" failonerror="false"/>
        <copy file="${jnlp.dest.dir}/master.jnlp" tofile="${jnlp.dest.dir}/master.jnlp.bak">
            <filterchain>
                <replacestring from="master.png" to="master.${image.ext}"/>
            </filterchain>
        </copy>
        <move file="${jnlp.dest.dir}/master.jnlp.bak" tofile="${jnlp.dest.dir}/master.jnlp" overwrite="true" />        
        
        <!-- The following line will not fail if the branding.jnlp
             is not present, e.g. when the main file was generated using
             harness from 5.x days. -->
        <copy file="branding.jnlp" tofile="${jnlp.dest.dir}/branding.jnlp.bak" failonerror="false">
            <filterchain>
                <replacestring from="master.png" to="master.${image.ext}"/>
            </filterchain>
        </copy>
        <move file="${jnlp.dest.dir}/branding.jnlp.bak" tofile="${jnlp.dest.dir}/branding.jnlp" overwrite="true" />        
        
        <!-- Build the WAR again with the corrected icon and jnlp files -->
        <war basedir="${jnlp.dest.dir}" destfile="dist/${app.name}.war" webxml="build/tmp/web.xml">
            <zipfileset dir="${jnlp.servlet.jar}/.." file="${jnlp.servlet.jar}" prefix="WEB-INF/lib"/>
        </war>
    </target>
Comment 2 cappicard 2008-08-28 20:50:24 UTC
Created attachment 68577 [details]
Patch to jnlp.xml to properly copy image file w/ correct file extension for JNLP desktop icon
Comment 3 Peter Pis 2008-09-01 11:54:13 UTC
Reassigning to "javawebstart".
Comment 4 Milan Kubec 2008-09-01 12:10:40 UTC
I think that this is part of platform javawebstart support.
Comment 5 Jesse Glick 2008-09-05 14:38:14 UTC
Patch looks reasonable to me.
Comment 6 Lukas Hasik 2008-09-09 10:44:13 UTC
if the patch is reasonable then we should use it for 6.5
However there might be legal issues. cappicard, you have to sign Contributor Agreement before we can apply the patch.

http://wiki.netbeans.org/NetBeansUserFAQ#section-NetBeansUserFAQ-ContributorAgreement
http://www.netbeans.org/about/legal/ca.html

Comment 7 Jesse Glick 2008-09-10 03:31:38 UTC
Patches this minor do not require a CA.
Comment 8 cappicard 2008-09-18 16:56:39 UTC
CA approved by my employer's legal department. I will be submitting it today.
Comment 9 rmichalsky 2008-09-19 10:21:08 UTC
patch committed into core-main #64938ceb1400, thanks for it.
Comment 10 Quality Engineering 2008-09-20 05:45:04 UTC
Integrated into 'main-golden', will be available in build *200809200201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/64938ceb1400
User: Richard Michalsky <rmichalsky@netbeans.org>
Log: #145446: patch allowing to use different file formats for jnlp app icon
Comment 11 Marian Mirilovic 2011-06-09 09:57:06 UTC
v/c