New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JRE downloader in build process crashes with NullPointerException #4496

Closed
jdf opened this Issue May 21, 2016 · 9 comments

Comments

Projects
None yet
4 participants
@jdf
Contributor

jdf commented May 21, 2016

Clean build on travis:

https://travis-ci.org/jdf/processing.py/builds/131919028

jre-download:
BUILD FAILED
/home/travis/build/jdf/processing.py/processing/build/build.xml:296: The following error occurred while executing this line:
/home/travis/build/jdf/processing.py/processing/build/build.xml:242: java.lang.NullPointerException
    at Downloader.download(Downloader.java:161)
    at Downloader.execute(Downloader.java:96)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
    at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)

etc.

@jdf

This comment has been minimized.

Show comment
Hide comment
@jdf

jdf May 21, 2016

Contributor
      List<String> cookies = headers.get("Set-Cookie");
      conn = (HttpURLConnection) new URL(url).openConnection();
      for (String cookie : cookies) {  // the crashing line

Apparently headers.get can return null.

Contributor

jdf commented May 21, 2016

      List<String> cookies = headers.get("Set-Cookie");
      conn = (HttpURLConnection) new URL(url).openConnection();
      for (String cookie : cookies) {  // the crashing line

Apparently headers.get can return null.

@gohai

This comment has been minimized.

Show comment
Hide comment
@gohai

gohai May 21, 2016

Contributor

I saw this also when building for the ARM. I believe we didn't get headers because Oracle was redirecting us to a Login page instead..

Contributor

gohai commented May 21, 2016

I saw this also when building for the ARM. I believe we didn't get headers because Oracle was redirecting us to a Login page instead..

@gohai

This comment has been minimized.

Show comment
Hide comment
@gohai

gohai May 21, 2016

Contributor

Btw: Some time ago I came across a simple command to download from Oracle:

wget --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u91-b14/jdk-8u91-linux-arm32-vfp-hflt.tar.gz

Seems to work (well, at this point in time anyway). Perhaps this could simplify the downloader somewhat?

Contributor

gohai commented May 21, 2016

Btw: Some time ago I came across a simple command to download from Oracle:

wget --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u91-b14/jdk-8u91-linux-arm32-vfp-hflt.tar.gz

Seems to work (well, at this point in time anyway). Perhaps this could simplify the downloader somewhat?

@jdf

This comment has been minimized.

Show comment
Hide comment
@jdf

jdf May 21, 2016

Contributor

I should say, because it's not obvious, that this is a show-stopper bug for Python Mode, because our continuous-build/test system (Travis) is the only QA I've got. :)

Contributor

jdf commented May 21, 2016

I should say, because it's not obvious, that this is a show-stopper bug for Python Mode, because our continuous-build/test system (Travis) is the only QA I've got. :)

@jdf

This comment has been minimized.

Show comment
Hide comment
@jdf

jdf May 21, 2016

Contributor

Thanks very much @gohai for your wget tip! I've worked around the Downloader bug in my travis configuration by downloading the appropriate JRE into build/linux and uncompressing it there. I have a green build again.

https://travis-ci.org/jdf/processing.py/builds/131989379

Contributor

jdf commented May 21, 2016

Thanks very much @gohai for your wget tip! I've worked around the Downloader bug in my travis configuration by downloading the appropriate JRE into build/linux and uncompressing it there. I have a green build again.

https://travis-ci.org/jdf/processing.py/builds/131989379

@jdf

This comment has been minimized.

Show comment
Hide comment
@jdf

jdf May 21, 2016

Contributor

In case anyone else is curious, here's how I did it:

https://github.com/jdf/processing.py/blob/master/.travis.yml#L11

Contributor

jdf commented May 21, 2016

In case anyone else is curious, here's how I did it:

https://github.com/jdf/processing.py/blob/master/.travis.yml#L11

gohai added a commit to gohai/processing that referenced this issue May 27, 2016

Fix Downloader
Addresses #4496. Enough to get JRE downloads to work again.

@gohai gohai referenced this issue May 27, 2016

Merged

Fix Downloader #4511

@pyy

This comment has been minimized.

Show comment
Hide comment
@pyy

pyy May 31, 2016

Thank you @jdf @gohai . It works for me.

I met the same error under Windows 8.1 x64.

D:\processing\build>ant run
..........
..........
BUILD FAILED
D:\processing\build\build.xml:300: The following error occurred while executing this line:
D:\processing\build\build.xml:242: java.lang.NullPointerException
        at Downloader.download(Downloader.java:161)
        at Downloader.execute(Downloader.java:96)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
        at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:435)
        at org.apache.tools.ant.Target.performTasks(Target.java:456)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1405)
        at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1260)
        at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:441)
        at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
        at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:435)
        at org.apache.tools.ant.Target.performTasks(Target.java:456)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1405)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1376)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1260)
        at org.apache.tools.ant.Main.runBuild(Main.java:854)
        at org.apache.tools.ant.Main.startAnt(Main.java:236)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:285)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:112)

Total time: 2 seconds

There are two ways to fix it:

  1. We can use @gohai 's pull #4511 to modify the Downloader.java file
    code is here: 9ef0d4c
  2. Or we can download the jre file manually as @jdf did.
    Go to Oracle website to download windows-x64.tar.gz file (here is jre-8u92-windows-x64.tar.gz for me), put it into./build/windows folder and rename it tgz file (here is jre-8u92.tgz).

Now, run 'ant' again to build it again.

pyy commented May 31, 2016

Thank you @jdf @gohai . It works for me.

I met the same error under Windows 8.1 x64.

D:\processing\build>ant run
..........
..........
BUILD FAILED
D:\processing\build\build.xml:300: The following error occurred while executing this line:
D:\processing\build\build.xml:242: java.lang.NullPointerException
        at Downloader.download(Downloader.java:161)
        at Downloader.execute(Downloader.java:96)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
        at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:435)
        at org.apache.tools.ant.Target.performTasks(Target.java:456)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1405)
        at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1260)
        at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:441)
        at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
        at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:435)
        at org.apache.tools.ant.Target.performTasks(Target.java:456)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1405)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1376)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1260)
        at org.apache.tools.ant.Main.runBuild(Main.java:854)
        at org.apache.tools.ant.Main.startAnt(Main.java:236)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:285)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:112)

Total time: 2 seconds

There are two ways to fix it:

  1. We can use @gohai 's pull #4511 to modify the Downloader.java file
    code is here: 9ef0d4c
  2. Or we can download the jre file manually as @jdf did.
    Go to Oracle website to download windows-x64.tar.gz file (here is jre-8u92-windows-x64.tar.gz for me), put it into./build/windows folder and rename it tgz file (here is jre-8u92.tgz).

Now, run 'ant' again to build it again.

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry Jun 2, 2016

Member

Has Oracle changed their download so our script no longer works?

Member

benfry commented Jun 2, 2016

Has Oracle changed their download so our script no longer works?

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry Jul 29, 2016

Member

Fixed with #4511

Member

benfry commented Jul 29, 2016

Fixed with #4511

@benfry benfry closed this Jul 29, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment