Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 96630 - JNLP codebase problem during WAR deployment
JNLP codebase problem during WAR deployment
Status: VERIFIED FIXED
Product: apisupport
Classification: Unclassified
Component: Harness
6.x
All All
: P3 (vote)
: 6.x
Assigned To: Jesse Glick
issues@apisupport
: REGRESSION
: 118132 (view as bug list)
Depends on:
Blocks: 90498
  Show dependency treegraph
 
Reported: 2007-02-26 22:18 UTC by Jesse Glick
Modified: 2007-10-11 07:33 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2007-02-26 22:18:49 UTC
The introduction of subfolders in the JNLP generation from <makejnlp> as part of
issue #90498 causes a problem for modules with signed extensions, such as
JavaHelp. Currently you will have generated something like this in the run-jnlp
target:

--%<-- dist/jnlp/local/netbeans/org-netbeans-modules-javahelp/ext-jh-2.0_04.jnlp
<?xml version='1.0' encoding='UTF-8'?>
<jnlp spec='1.0+' codebase='file:..../dist/jnlp/local/netbeans/' >
  <information>
    <title>jh-2.0_04</title>
    <vendor>NetBeans</vendor>
  </information>
<security><all-permissions/></security>
  <resources>
    <jar href='org-netbeans-modules-javahelp/ext-jh-2.0_04.jar'/>
  </resources>
  <component-desc/>
</jnlp>
--%<--

Note the codebase and the JAR href.

In the WAR, you get

--%<-- netbeans/org-netbeans-modules-javahelp/ext-jh-2.0_04.jnlp
<?xml version='1.0' encoding='UTF-8'?>
<jnlp spec='1.0+' codebase='$$codebase' >
  <information>
    <title>jh-2.0_04</title>
    <vendor>NetBeans</vendor>
  </information>
<security><all-permissions/></security>
  <resources>
    <jar href='org-netbeans-modules-javahelp/ext-jh-2.0_04.jar'/>
  </resources>
  <component-desc/>
</jnlp>
--%<--

This does not work, since the JnlpDownloadServlet replaces $$codebase with a
value dependent on the location of the .jnlp file, so javaws tries to download

http://host/app/netbeans/org-netbeans-modules-javahelp/org-netbeans-modules-javahelp/ext-jh-2.0_04.jar

which of course fails due to the duplicated path component.

Possible solutions:

1. Revert the use of subfolders, keeping all JARs and JNLPs in one main folder.
Possible, though some more creative file naming may be necessary to avoid
possible filename conflicts.

2. Change the relative path to

<jar href='ext-jh-2.0_04.jar'/>

in the .jnlp, so it will work during WAR deployment, and then change
harness/jnlp.xml to perform different (more complicated) substitution of
codebases during copying to dist/jnlp/local.

In either event, we probably need a new Ant task to verify a JNLP file and its
transitive dependencies - checking that all hrefs are valid, all JARs are signed
(with a single signature used within a given fragment), all the XML is valid
according to the JNLP DTD, etc.
Comment 1 Jesse Glick 2007-10-05 23:15:46 UTC
Have written a task to validate JNLP files. Have already caught a variety of bugs in JNLP generation as a result:
missing DOCTYPE, nonsense created in branding.jnlp (<security><security/></security>), codebase missing final '/' for
master.jnlp, nonexistent icon referred to (which I am ignoring for now), unescaped entity in <title>Look & Feel
Customization Library</title>.

It seems that there is not an immediate problem for the average NB platform user, because we are no longer distributing
jh.jar signed anyway - so the problematic ext-jh-2.0_04.jnlp is never created. Only if someone included some other
module with a signed extension would there be a problem for WAR deployment. I don't know of any in NB at the moment. So
probably not a P2, but should still be fixed.
Comment 2 Jesse Glick 2007-10-06 19:12:48 UTC
Fixed to generate the *-ext-*.jnlp in the same dir and to use the same codebase as the rest of the *.jnlp.

Besides the previously mentioned bugs, also found and fixed several problems in the usage of jnlp.sign.jars: it was
defaulting to false contrary to documentation; and ant/nblib/*.jar and jnlp.indirect.jars were always signed even if it
was false, causing module JNLP descriptors using either of these features to be potentially unusable (since they would
mix signed and unsigned JARs).

New task checks: (1) *.jnlp valid acc. to the DTD; (2) all href="..." targets exist (though only a warning for <icon>);
(3) if any JARs in a given *.jnlp are signed, they all are, and all with the same certificates.

Also fixing issue #90484, unsafe file: URL construction.

Checking in apisupport/harness/nbproject/project.properties;
/shared/data/ccvs/repository/apisupport/harness/nbproject/project.properties,v  <--  project.properties
new revision: 1.26; previous revision: 1.25
done
Checking in apisupport/harness/release/jnlp.xml;
/shared/data/ccvs/repository/apisupport/harness/release/jnlp.xml,v  <--  jnlp.xml
new revision: 1.47; previous revision: 1.46
done
Checking in nbbuild/build.xml;
/shared/data/ccvs/repository/nbbuild/build.xml,v  <--  build.xml
new revision: 1.847; previous revision: 1.846
done
RCS file: /shared/data/ccvs/repository/nbbuild/antsrc/org/netbeans/nbbuild/JNLP-1.5.dtd,v
done
Checking in nbbuild/antsrc/org/netbeans/nbbuild/JNLP-1.5.dtd;
/shared/data/ccvs/repository/nbbuild/antsrc/org/netbeans/nbbuild/JNLP-1.5.dtd,v  <--  JNLP-1.5.dtd
initial revision: 1.1
done
Checking in nbbuild/antsrc/org/netbeans/nbbuild/MakeJNLP.java;
/shared/data/ccvs/repository/nbbuild/antsrc/org/netbeans/nbbuild/MakeJNLP.java,v  <--  MakeJNLP.java
new revision: 1.27; previous revision: 1.26
done
RCS file: /shared/data/ccvs/repository/nbbuild/antsrc/org/netbeans/nbbuild/VerifyJNLP.java,v
done
Checking in nbbuild/antsrc/org/netbeans/nbbuild/VerifyJNLP.java;
/shared/data/ccvs/repository/nbbuild/antsrc/org/netbeans/nbbuild/VerifyJNLP.java,v  <--  VerifyJNLP.java
initial revision: 1.1
done
Checking in nbbuild/antsrc/org/netbeans/nbbuild/XMLUtil.java;
/shared/data/ccvs/repository/nbbuild/antsrc/org/netbeans/nbbuild/XMLUtil.java,v  <--  XMLUtil.java
new revision: 1.26; previous revision: 1.25
done
Checking in nbbuild/templates/common.xml;
/shared/data/ccvs/repository/nbbuild/templates/common.xml,v  <--  common.xml
new revision: 1.74; previous revision: 1.73
done
Checking in nbbuild/test/unit/src/org/netbeans/nbbuild/MakeJNLPTest.java;
/shared/data/ccvs/repository/nbbuild/test/unit/src/org/netbeans/nbbuild/MakeJNLPTest.java,v  <--  MakeJNLPTest.java
new revision: 1.21; previous revision: 1.20
done
Checking in ant/build.xml;
/shared/data/ccvs/repository/ant/build.xml,v  <--  build.xml
new revision: 1.128; previous revision: 1.127
done
Checking in extbrowser/build.xml;
/shared/data/ccvs/repository/extbrowser/build.xml,v  <--  build.xml
new revision: 1.45; previous revision: 1.44
done
Comment 3 Jesse Glick 2007-10-10 01:58:19 UTC
*** Issue 118132 has been marked as a duplicate of this issue. ***
Comment 4 pzajac 2007-10-11 07:33:58 UTC
verified


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo