Java::oracle recipe broken due to oracle now requiring browser cookie


#1

dear fellow chefs,

the java::oracle recipe is now broken as Oracle requires a browser cookie
set upon accepting license terms

I will be working on it

that really chaps my hide


#2

in the meantime, you can work around this by downloading the tarball to a
local server than then overriding the
node[‘java’][jdk’][‘6’][‘x86_64’][‘url’] attribute like this or in a
role

node[‘java’][jdk’][‘6’][‘x86_64’][‘url’] = ‘
http://your_local_server/java_tarball.tar.gz’

On Tue, Mar 27, 2012 at 10:05 AM, Bryan Berry bryan.berry@gmail.com wrote:

dear fellow chefs,

the java::oracle recipe is now broken as Oracle requires a browser cookie
set upon accepting license terms

I will be working on it

that really chaps my hide


#3

besides having your own local copy of java, I have found a way to download
directly from oracle.com but it is quite heavyweight. It requires the
installation of firefox, Xvfb (virtual X11 server), and the watir-webdriver
and headless gems. There is no way around installing firefox as the oracle
site requires javascript to agree to their terms.

I am really wondering if this solution is so invasive that no one will use
it. If someone has a better solution, pls let me know!

$ sudo apt-get install xvfb

$ gem install watir-webdriver headless

downloads jdk 1.7

require 'watir-webdriver’
require 'headless’
headless = Headless.new
headless.start

profile = Selenium::WebDriver::Firefox::Profile.new
profile[‘browser.download.folderList’] = 2
profile[‘browser.download.dir’] = '/tmp’
profile[‘browser.helperApps.neverAsk.saveToDisk’] = "application/x-tar-gz,
application/x-gzip, application/x-compressed"
b = Watir::Browser.new :firefox, :profile => profile
b.goto "
http://www.oracle.com/technetwork/java/javase/downloads/jdk-7u3-download-1501626.html
"
b.radio(:name => “agreementDivjdk-7u3-oth-JPR”).click
b.radio(:name => “agreementjdk-7u3-oth-JPR”).click
b.a(:name => “jdk-7u3-oth-JPRXXXjdk-7u3-linux-x64.tar.gz”).click

somehow need to block until file totally downloaded

headless.destroy

On Tue, Mar 27, 2012 at 10:10 AM, Bryan Berry bryan.berry@gmail.com wrote:

in the meantime, you can work around this by downloading the tarball to a
local server than then overriding the
node[‘java’][jdk’][‘6’][‘x86_64’][‘url’] attribute like this or in a
role

node[‘java’][jdk’][‘6’][‘x86_64’][‘url’] = ‘
http://your_local_server/java_tarball.tar.gz’

On Tue, Mar 27, 2012 at 10:05 AM, Bryan Berry bryan.berry@gmail.comwrote:

dear fellow chefs,

the java::oracle recipe is now broken as Oracle requires a browser cookie
set upon accepting license terms

I will be working on it

that really chaps my hide


#4

Seems like a great reason to move to OpenJDK. My instinct would be that if
they are going to this kind of length to get you to register/use a cookie,
honor their request - by downloading it locally and fetching it repeatably
from a local location. Or by moving to OpenJDK.

Adam

On Tue, Mar 27, 2012 at 4:25 AM, Bryan Berry bryan.berry@gmail.com wrote:

besides having your own local copy of java, I have found a way to download
directly from oracle.com but it is quite heavyweight. It requires the
installation of firefox, Xvfb (virtual X11 server), and the watir-webdriver
and headless gems. There is no way around installing firefox as the oracle
site requires javascript to agree to their terms.

I am really wondering if this solution is so invasive that no one will use
it. If someone has a better solution, pls let me know!

$ sudo apt-get install xvfb

$ gem install watir-webdriver headless

downloads jdk 1.7

require 'watir-webdriver’
require 'headless’
headless = Headless.new
headless.start

profile = Selenium::WebDriver::Firefox::Profile.new
profile[‘browser.download.folderList’] = 2
profile[‘browser.download.dir’] = '/tmp’
profile[‘browser.helperApps.neverAsk.saveToDisk’] = "application/x-tar-gz,
application/x-gzip, application/x-compressed"
b = Watir::Browser.new :firefox, :profile => profile
b.goto "
http://www.oracle.com/technetwork/java/javase/downloads/jdk-7u3-download-1501626.html
"
b.radio(:name => “agreementDivjdk-7u3-oth-JPR”).click
b.radio(:name => “agreementjdk-7u3-oth-JPR”).click
b.a(:name => “jdk-7u3-oth-JPRXXXjdk-7u3-linux-x64.tar.gz”).click

somehow need to block until file totally downloaded

headless.destroy

On Tue, Mar 27, 2012 at 10:10 AM, Bryan Berry bryan.berry@gmail.comwrote:

in the meantime, you can work around this by downloading the tarball to a
local server than then overriding the
node[‘java’][jdk’][‘6’][‘x86_64’][‘url’] attribute like this or in a
role

node[‘java’][jdk’][‘6’][‘x86_64’][‘url’] = ‘
http://your_local_server/java_tarball.tar.gz’

On Tue, Mar 27, 2012 at 10:05 AM, Bryan Berry bryan.berry@gmail.comwrote:

dear fellow chefs,

the java::oracle recipe is now broken as Oracle requires a browser
cookie set upon accepting license terms

I will be working on it

that really chaps my hide


Opscode, Inc.
Adam Jacob, Chief Customer Officer
T: (206) 619-7151 E: adam@opscode.com


#5

agreed ,
and also on the same line, i have faced similar requirements for different
use cases where simple get/post functionality is needed for publishing /
grabbing build artifacts, custom rpms etc, but since chef is not meant to
be a file server, i use a dedicated nginx instance(or apache ) to do this.
It might not make sense for a single use case, but if you have multiple
uses cases then it better to have a dedicated file server (http or nfs or
webdav based) for service files and then leverage them using the
remote_file/http_request resource.

On Wed, Mar 28, 2012 at 12:14 AM, Adam Jacob adam@opscode.com wrote:

Seems like a great reason to move to OpenJDK. My instinct would be that if
they are going to this kind of length to get you to register/use a cookie,
honor their request - by downloading it locally and fetching it repeatably
from a local location. Or by moving to OpenJDK.

Adam

On Tue, Mar 27, 2012 at 4:25 AM, Bryan Berry bryan.berry@gmail.comwrote:

besides having your own local copy of java, I have found a way to
download directly from oracle.com but it is quite heavyweight. It
requires the installation of firefox, Xvfb (virtual X11 server), and the
watir-webdriver and headless gems. There is no way around installing
firefox as the oracle site requires javascript to agree to their terms.

I am really wondering if this solution is so invasive that no one will
use it. If someone has a better solution, pls let me know!

$ sudo apt-get install xvfb

$ gem install watir-webdriver headless

downloads jdk 1.7

require 'watir-webdriver’
require 'headless’
headless = Headless.new
headless.start

profile = Selenium::WebDriver::Firefox::Profile.new
profile[‘browser.download.folderList’] = 2
profile[‘browser.download.dir’] = '/tmp’
profile[‘browser.helperApps.neverAsk.saveToDisk’] =
"application/x-tar-gz, application/x-gzip, application/x-compressed"
b = Watir::Browser.new :firefox, :profile => profile
b.goto "
http://www.oracle.com/technetwork/java/javase/downloads/jdk-7u3-download-1501626.html
"
b.radio(:name => “agreementDivjdk-7u3-oth-JPR”).click
b.radio(:name => “agreementjdk-7u3-oth-JPR”).click
b.a(:name => “jdk-7u3-oth-JPRXXXjdk-7u3-linux-x64.tar.gz”).click

somehow need to block until file totally downloaded

headless.destroy

On Tue, Mar 27, 2012 at 10:10 AM, Bryan Berry bryan.berry@gmail.comwrote:

in the meantime, you can work around this by downloading the tarball to
a local server than then overriding the
node[‘java’][jdk’][‘6’][‘x86_64’][‘url’] attribute like this or in
a role

node[‘java’][jdk’][‘6’][‘x86_64’][‘url’] = ‘
http://your_local_server/java_tarball.tar.gz’

On Tue, Mar 27, 2012 at 10:05 AM, Bryan Berry bryan.berry@gmail.comwrote:

dear fellow chefs,

the java::oracle recipe is now broken as Oracle requires a browser
cookie set upon accepting license terms

I will be working on it

that really chaps my hide


Opscode, Inc.
Adam Jacob, Chief Customer Officer
T: (206) 619-7151 E: adam@opscode.com


#6

On Tue, Mar 27, 2012 at 2:44 PM, Adam Jacob adam@opscode.com wrote:

Seems like a great reason to move to OpenJDK. My instinct would be that if
they are going to this kind of length to get you to register/use a cookie,
honor their request - by downloading it locally and fetching it repeatably
from a local location. Or by moving to OpenJDK.

Adam

Sadly OpenJDK doesn’t play nice still with many applications.

Bryan,

Are you entirely positive about this? I just built two new base images a
few days ago with https://github.com/flexiondotorg/oab-java6 and it worked
fine. It’s just a shell script.

Might be worth looking in there for inspiration.


#7

Bryan,
Thanks for informing us about this. My recipes would have failed next time
they ran (e.g. during a production failure).

As for the approach, I’ve stored the Sun java tarballs on a local
repository (well…S3). The Selenium method seems far too involved.

As for the OpenJDK approach, it doesn’t work with JFreeChart because of
font problems. I haven’t recently gone back to see if those issues got
resolved.

Cheers,
Edward

On Tue, Mar 27, 2012 at 11:44 AM, Adam Jacob adam@opscode.com wrote:

Seems like a great reason to move to OpenJDK. My instinct would be that if
they are going to this kind of length to get you to register/use a cookie,
honor their request - by downloading it locally and fetching it repeatably
from a local location. Or by moving to OpenJDK.

Adam

On Tue, Mar 27, 2012 at 4:25 AM, Bryan Berry bryan.berry@gmail.comwrote:

besides having your own local copy of java, I have found a way to
download directly from oracle.com but it is quite heavyweight. It
requires the installation of firefox, Xvfb (virtual X11 server), and the
watir-webdriver and headless gems. There is no way around installing
firefox as the oracle site requires javascript to agree to their terms.

I am really wondering if this solution is so invasive that no one will
use it. If someone has a better solution, pls let me know!

$ sudo apt-get install xvfb

$ gem install watir-webdriver headless

downloads jdk 1.7

require 'watir-webdriver’
require 'headless’
headless = Headless.new
headless.start

profile = Selenium::WebDriver::Firefox::Profile.new
profile[‘browser.download.folderList’] = 2
profile[‘browser.download.dir’] = '/tmp’
profile[‘browser.helperApps.neverAsk.saveToDisk’] =
"application/x-tar-gz, application/x-gzip, application/x-compressed"
b = Watir::Browser.new :firefox, :profile => profile
b.goto "
http://www.oracle.com/technetwork/java/javase/downloads/jdk-7u3-download-1501626.html
"
b.radio(:name => “agreementDivjdk-7u3-oth-JPR”).click
b.radio(:name => “agreementjdk-7u3-oth-JPR”).click
b.a(:name => “jdk-7u3-oth-JPRXXXjdk-7u3-linux-x64.tar.gz”).click

somehow need to block until file totally downloaded

headless.destroy

On Tue, Mar 27, 2012 at 10:10 AM, Bryan Berry bryan.berry@gmail.comwrote:

in the meantime, you can work around this by downloading the tarball to
a local server than then overriding the
node[‘java’][jdk’][‘6’][‘x86_64’][‘url’] attribute like this or in
a role

node[‘java’][jdk’][‘6’][‘x86_64’][‘url’] = ‘
http://your_local_server/java_tarball.tar.gz’

On Tue, Mar 27, 2012 at 10:05 AM, Bryan Berry bryan.berry@gmail.comwrote:

dear fellow chefs,

the java::oracle recipe is now broken as Oracle requires a browser
cookie set upon accepting license terms

I will be working on it

that really chaps my hide


Opscode, Inc.
Adam Jacob, Chief Customer Officer
T: (206) 619-7151 E: adam@opscode.com


#8

tks for the link lusis,

afaict, oabjava6 just greps the oracle page for the download link and then
downloads it using wget. This step was broken as soon as Oracle added the
legal terms requirement. However, I could be overlooking something.

Clicking the “accept license agreement” triggers a javascript function,
which makes it difficult to automate with curl, lynx, or another headless
browser.

I believe that Oracle may have made the license requirement as recently as
yesterday which would explain why the script worked a few days ago.

On Tue, Mar 27, 2012 at 9:03 PM, John E. Vincent (lusis) <lusis.org+
chef-list@gmail.com> wrote:

On Tue, Mar 27, 2012 at 2:44 PM, Adam Jacob adam@opscode.com wrote:

Seems like a great reason to move to OpenJDK. My instinct would be that
if they are going to this kind of length to get you to register/use a
cookie, honor their request - by downloading it locally and fetching it
repeatably from a local location. Or by moving to OpenJDK.

Adam

Sadly OpenJDK doesn’t play nice still with many applications.

Bryan,

Are you entirely positive about this? I just built two new base images a
few days ago with https://github.com/flexiondotorg/oab-java6 and it
worked fine. It’s just a shell script.

Might be worth looking in there for inspiration.


#9

let’s hope so, sadly many big open-source projects ahem hadoop are
developed on the oracle jdk and only support the Oracle JDK

http://wiki.apache.org/hadoop/HadoopJavaVersions

let’s hope that more progress is made in this area.

On Tue, Mar 27, 2012 at 8:44 PM, Adam Jacob adam@opscode.com wrote:

Seems like a great reason to move to OpenJDK. My instinct would be that if
they are going to this kind of length to get you to register/use a cookie,
honor their request - by downloading it locally and fetching it repeatably
from a local location. Or by moving to OpenJDK.

Adam

On Tue, Mar 27, 2012 at 4:25 AM, Bryan Berry bryan.berry@gmail.comwrote:

besides having your own local copy of java, I have found a way to
download directly from oracle.com but it is quite heavyweight. It
requires the installation of firefox, Xvfb (virtual X11 server), and the
watir-webdriver and headless gems. There is no way around installing
firefox as the oracle site requires javascript to agree to their terms.

I am really wondering if this solution is so invasive that no one will
use it. If someone has a better solution, pls let me know!

$ sudo apt-get install xvfb

$ gem install watir-webdriver headless

downloads jdk 1.7

require 'watir-webdriver’
require 'headless’
headless = Headless.new
headless.start

profile = Selenium::WebDriver::Firefox::Profile.new
profile[‘browser.download.folderList’] = 2
profile[‘browser.download.dir’] = '/tmp’
profile[‘browser.helperApps.neverAsk.saveToDisk’] =
"application/x-tar-gz, application/x-gzip, application/x-compressed"
b = Watir::Browser.new :firefox, :profile => profile
b.goto "
http://www.oracle.com/technetwork/java/javase/downloads/jdk-7u3-download-1501626.html
"
b.radio(:name => “agreementDivjdk-7u3-oth-JPR”).click
b.radio(:name => “agreementjdk-7u3-oth-JPR”).click
b.a(:name => “jdk-7u3-oth-JPRXXXjdk-7u3-linux-x64.tar.gz”).click

somehow need to block until file totally downloaded

headless.destroy

On Tue, Mar 27, 2012 at 10:10 AM, Bryan Berry bryan.berry@gmail.comwrote:

in the meantime, you can work around this by downloading the tarball to
a local server than then overriding the
node[‘java’][jdk’][‘6’][‘x86_64’][‘url’] attribute like this or in
a role

node[‘java’][jdk’][‘6’][‘x86_64’][‘url’] = ‘
http://your_local_server/java_tarball.tar.gz’

On Tue, Mar 27, 2012 at 10:05 AM, Bryan Berry bryan.berry@gmail.comwrote:

dear fellow chefs,

the java::oracle recipe is now broken as Oracle requires a browser
cookie set upon accepting license terms

I will be working on it

that really chaps my hide


Opscode, Inc.
Adam Jacob, Chief Customer Officer
T: (206) 619-7151 E: adam@opscode.com


#10

I actually wrote a hack Java cookbook around that script and we use that now to install Java in to our prebuilt AMI’s. I found the Opscode Java caused problems with Tomcat installed with apt-get as it did not see Sun Java and would force install OpenJDK.

The problem with /oab-java6 it is that it takes a crap long time to package so that is why we use prebuilt AMI’s that install Java another things we use. Personally I am thinking of deploying our own repository and just host Java internally till we cut over to OpenJDK. Most of the Engineering team I work with still does not think OpenJDK is fully baked tho I have tested our code to work on it as a pure DemVal.

I just build a new AMI today and found its still working, and I am using a fork of that project because I wanted to control any updates to it. Maybe its only JDK7 they added this requirement because JDK6 is fine.

Zuhaib
On Mar 27, 2012, at 12:03 PM, John E. Vincent (lusis) lusis.org+chef-list@gmail.com wrote:

On Tue, Mar 27, 2012 at 2:44 PM, Adam Jacob adam@opscode.com wrote:
Seems like a great reason to move to OpenJDK. My instinct would be that if they are going to this kind of length to get you to register/use a cookie, honor their request - by downloading it locally and fetching it repeatably from a local location. Or by moving to OpenJDK.

Adam

Sadly OpenJDK doesn’t play nice still with many applications.

Bryan,

Are you entirely positive about this? I just built two new base images a few days ago with https://github.com/flexiondotorg/oab-java6 and it worked fine. It’s just a shell script.

Might be worth looking in there for inspiration.


#11

as a maintainer of the java cookbook, I won’t put any more work into trying
to download directly from the Oracle site. I sent a pull request yesterday
that throws Chef::Application.fatal! if you don’t override the oracle url

I also got a request from a Vagrant user to allow the java cookbook to
source a locally stored tarball. I will add support for that later today

On Thu, Mar 29, 2012 at 4:53 AM, Zuhaib Siddique <
zuhaib.siddique@leapfile.com> wrote:

I actually wrote a hack Java cookbook around that script and we use that
now to install Java in to our prebuilt AMI’s. I found the Opscode Java
caused problems with Tomcat installed with apt-get as it did not see Sun
Java and would force install OpenJDK.

The problem with /oab-java6 https://github.com/flexiondotorg/oab-java6 it
is that it takes a crap long time to package so that is why we use prebuilt
AMI’s that install Java another things we use. Personally I am thinking of
deploying our own repository and just host Java internally till we cut over
to OpenJDK. Most of the Engineering team I work with still does not think
OpenJDK is fully baked tho I have tested our code to work on it as a pure
DemVal.

I just build a new AMI today and found its still working, and I am using a
fork of that project because I wanted to control any updates to it. Maybe
its only JDK7 they added this requirement because JDK6 is fine.

Zuhaib

On Mar 27, 2012, at 12:03 PM, John E. Vincent (lusis) <
lusis.org+chef-list@gmail.com> wrote:

On Tue, Mar 27, 2012 at 2:44 PM, Adam Jacob adam@opscode.com wrote:

Seems like a great reason to move to OpenJDK. My instinct would be that
if they are going to this kind of length to get you to register/use a
cookie, honor their request - by downloading it locally and fetching it
repeatably from a local location. Or by moving to OpenJDK.

Adam

Sadly OpenJDK doesn’t play nice still with many applications.

Bryan,

Are you entirely positive about this? I just built two new base images a
few days ago with https://github.com/flexiondotorg/oab-java6 and it
worked fine. It’s just a shell script.

Might be worth looking in there for inspiration.