peedeeboy opened a new pull request #1119: [NETBEANS-997] Fix for unable to 
download and create GlassFish server / support for installing GF 4.1.2 & GF 5.0
URL: https://github.com/apache/incubator-netbeans/pull/1119
 
 
   Root cause of issue
   ---------------------
   1) NB first looks for a .txt file for the relevant Glassfish version on 
serverplugins.netbeans.org (it will follow redirects to try and find it).
   2) If NB finds the txt file, it reads the first line, which contains the 
directory path for that version of glassfish (see 
http://serverplugins.netbeans.org/glassfishv3/post71v3-1-2.txt which is still 
up!)
      2a) The directory path is appended to the hardcoded base URL, 
http://download.java.net
      2b) NB will then try and download the glassfish .zip from this URL (but 
won't follow redirects!)
   3) If NB fails to find/parse the .txt file, it will try and download the 
.zip from the direct download.java.net link (the one with the 
?nbretriever=fallback querystring), but won't follow redirects
    
   Because serverplugins.netbeans.org no longer exists & there are now 301 
redirects on the download.java.net URLs from http to https, even the fallback 
was failing.
   
   What this patch does in a nutshell
   --------------------------------------
   No longer parses a .txt file for the location of Glassfish.  The enum 
representing Glassfish versions still has two URLs.  NB will now expect a .zip 
file containing GF at either.  NB will follow redirects on the indirect URL, if 
that fails, NB will still fallback to the direct URL, which NB expects to be 
valid (currently points to download.oracle.com)
   
   Code for downloading/installing GF 5.0 de-commented.  Code for 
downloading/installing GF 4.1.2 added.
   
   Outstanding questions
   -------------------------
   Currently, both direct and indirect URLs point to same location.  Geertjan 
suggested on the mailing list that the GF binaries could be hosted at 
http://netbeans.osuosl.org/binaries
   
   Do we want to do this? NB could first try and download Glassfish from 
netbeans.osuosl.org/binaries and fallback to downloading from 
download.oracle.com, or vice versa.  Let me know! :)
   
   To test
   --------
   1) Servers tab -> Right-click Servers -> Add Server
   2) Select "Glassfish Server" -> Next
   3) Browse to "Install Location" -> check "I have read and accept the licence 
agreement" -> Download now...
   * Before PR : dialog will be displayed with choice of GF 3.1.2.2, 4.0, 4.1, 
4.1.1
   * After PR: choice will be GF 3.1.2.2, 4.0, 4.1, 4.1.1, 4.1.2, 5.0
   4) Choose a glassfish version
   * Before PR: After a few seconds, "Does not exist" error message will be 
displayed
   * After PR: GF will download and install normally
   
   Files changed
   -------------
   
enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/Bundle.properties
   * Added new string for Glassfish 4.1.2
   
   
enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/ServerDetails.java
   * Changed download location to remove references to 
serverplugins.netbeans.org and download.java.net and to reference valid 
download.oracle.comm https locations
   * Added entry to enum for Glassfish 4.1.2
   * Updated iterator of supported Glassfish versions to include 4.1.2 and 5.0
   
   
enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/wizards/AddServerLocationVisualPanel.java
   * Updated download prefix to https://download.oracle.com
   * Updated URL to licence to valid location: 
https://javaee.github.io/glassfish/LICENSE
   
   
enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/wizards/Retriever.java
   * getDowloadLocation() now uses HEAD rather than GET requests, as it is now 
just checking headers and not downloading any content
   * no longer tries to parse a text file to get Glassfish download location, 
instead on HTTP 200, it just checks that content-length > 0 bytes
   
   
enterprise/glassfish.common/test/unit/src/org/netbeans/modules/glassfish/common/wizards/RetrieverTest.java
   * Unit Test updated to handle redirect, and check both indirect and direct 
download locations work correctly
   
   
enterprise/glassfish.common/test/unit/src/org/netbeans/modules/glassfish/common/wizards/TestServer.java
   * Test server updated to simulate redirects
   * Test server only serves up the .zip file on GET requests, not HEAD requests
   
   
enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/data/GlassFishVersion.java
   * Updated so that Netbeans will now recoginse a Glassfish 4.1.2 installation 
as such, rather than falling back to recogising it as Glassfish 4.1
   
   enterprise/glassfish.common/test/unit/data/nottaDir-4_1_2.jar
   enterprise/glassfish.common/test/unit/data/subdir/
   
   * UtilsTest unit test was failing (nothing to do with this PR) as it was 
expecting these files, so added them...

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org
For additional commands, e-mail: notifications-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to