Results 1 to 7 of 7

Thread: Gradle Plugin Error

  1. #1
    Join Date
    May 2011
    Posts
    21

    Default Gradle Plugin Error

    Hi Guys,

    I've installed the latest gradle plugin via the extensions options from the dashboard. However whenever i try to apply a gradle nature to a project an error alert box pops up with the following;

    Code:
    error in opening zip file
    Could not install Gradle distribution from 'http://repo.gradle.org/gradle/distributions/gradle-1.0-milestone-7-bin.zip'.
    I've tried re-installing a fresh copy of sts, re-installing the plugin, new workspace, clean checkout of project and i still get that error. Its driving me mad and I don't how to solve it. Does anyone have any ideas?

    I'm running the following;

    sts version 2.9.1.RELEASE
    gradle tooling 2.9.0
    operating system: mac osx 10.7.3

    Any help would be greatly appreciated.

    cheers

  2. #2
    Join Date
    May 2010
    Posts
    398

    Default

    I tried downloading that link and the link appears to be correct (i.e. there is actually a gradle distribution zip at that location, and I could download it).

    Is there a more detailed error message in your error log ("Windows >> Show View >> Error Log"). The message may give more information why the problem happened (stacktrace, related errors etc.). The popup is only showing a one liner.

    If I had to guess, it sounds like maybe there is problem downloading the distribution on your end. Maybe a firewall/proxy issue.
    But it is just a guess.

    If so, you could try using the Gradle preferences page in STS to point to a locally installed Gradle instead to avoid the download.
    (But I suspect you may have more problems using Gradle, since it also tries to fetch dependencies etc via the internet.

    Kris
    Kris De Volder -- SpringSource

  3. #3
    Join Date
    May 2011
    Posts
    21

    Default

    I had a look at the error log and it contained the following errors;



    eclipse.buildId=2.9.1.201203221000-RELEASE
    java.version=1.6.0_31
    java.vendor=Apple Inc.
    BootLoader constants: OS=macosx, ARCH=x86, WS=cocoa, NL=en_US
    Framework arguments: -product com.springsource.sts.ide -keyring /Users/jazchana/.eclipse_keyring -showlocation
    Command-line arguments: -os macosx -ws cocoa -arch x86 -product com.springsource.sts.ide -keyring /Users/jazchana/.eclipse_keyring -showlocation

    Error
    Mon May 07 19:45:19 BST 2012
    error in opening zip file

    org.gradle.tooling.GradleConnectionException: Could not install Gradle distribution from 'http://repo.gradle.org/gradle/distributions/gradle-1.0-milestone-7-bin.zip'.
    at org.gradle.tooling.internal.consumer.DistributionF actory$ZippedDistribution.getToolingImplementation Classpath(DistributionFactory.java:115)
    at org.gradle.tooling.internal.consumer.loader.Cachin gToolingImplementationLoader.create(CachingTooling ImplementationLoader.java:37)
    at org.gradle.tooling.internal.consumer.loader.Synchr onizedToolingImplementationLoader.create(Synchroni zedToolingImplementationLoader.java:42)
    at org.gradle.tooling.internal.consumer.LazyConnectio n.onStartAction(LazyConnection.java:117)
    at org.gradle.tooling.internal.consumer.LazyConnectio n.withConnection(LazyConnection.java:100)
    at org.gradle.tooling.internal.consumer.LazyConnectio n.getModel(LazyConnection.java:91)
    at org.gradle.tooling.internal.consumer.ProgressLoggi ngConnection$2.run(ProgressLoggingConnection.java: 58)
    at org.gradle.tooling.internal.consumer.ProgressLoggi ngConnection$2.run(ProgressLoggingConnection.java: 56)
    at org.gradle.tooling.internal.consumer.ProgressLoggi ngConnection.run(ProgressLoggingConnection.java:72 )
    at org.gradle.tooling.internal.consumer.ProgressLoggi ngConnection.getModel(ProgressLoggingConnection.ja va:56)
    at org.gradle.tooling.internal.consumer.LoggingInitia lizerConnection.getModel(LoggingInitializerConnect ion.java:46)
    at org.gradle.tooling.internal.consumer.DefaultAsyncC onnection$2.run(DefaultAsyncConnection.java:53)
    at org.gradle.tooling.internal.consumer.DefaultAsyncC onnection$2.run(DefaultAsyncConnection.java:51)
    at org.gradle.tooling.internal.consumer.DefaultAsyncC onnection$3.run(DefaultAsyncConnection.java:71)
    at org.gradle.messaging.concurrent.DefaultExecutorFac tory$StoppableExecutorImpl$1.run(DefaultExecutorFa ctory.java:64)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run Task(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:680)
    Caused by: java.util.zip.ZipException: error in opening zip file
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(ZipFile.java:127)
    at java.util.zip.ZipFile.<init>(ZipFile.java:143)
    at org.gradle.wrapper.Install.unzip(Install.java:135)
    at org.gradle.wrapper.Install.createDist(Install.java :67)
    at org.gradle.wrapper.Install.createDist(Install.java :45)
    at org.gradle.tooling.internal.consumer.DistributionF actory$ZippedDistribution.getToolingImplementation Classpath(DistributionFactory.java:111)
    ... 17 more



    eclipse.buildId=2.9.1.201203221000-RELEASE
    java.version=1.6.0_31
    java.vendor=Apple Inc.
    BootLoader constants: OS=macosx, ARCH=x86, WS=cocoa, NL=en_US
    Framework arguments: -product com.springsource.sts.ide -keyring /Users/jazchana/.eclipse_keyring -showlocation
    Command-line arguments: -os macosx -ws cocoa -arch x86 -product com.springsource.sts.ide -keyring /Users/jazchana/.eclipse_keyring -showlocation

    Error
    Mon May 07 19:45:19 BST 2012
    GradleProject 'shazam' neither has model provider nor a persisted root project location

    com.springsource.sts.gradle.core.classpathcontaine r.FastOperationFailedException: GradleProject 'shazam' neither has model provider nor a persisted root project location
    at com.springsource.sts.gradle.core.GradleProject.get RootProject(GradleProject.java:986)
    at com.springsource.sts.gradle.core.preferences.Abstr actGradleProjectPreferences.getRootProjectPreferen ces(AbstractGradleProjectPreferences.java:212)
    at com.springsource.sts.gradle.core.preferences.Gradl eProjectPreferences.getEnableClasspatEntrySorting( GradleProjectPreferences.java:75)
    at com.springsource.sts.gradle.core.ClassPath.<init>( ClassPath.java:102)
    at com.springsource.sts.gradle.core.ClassPath.<init>( ClassPath.java:89)
    at com.springsource.sts.gradle.core.GradleProject.con vertToGradleProject(GradleProject.java:650)
    at com.springsource.sts.gradle.ui.actions.ConvertToGr adleProjectActionDelegate$1.doit(ConvertToGradlePr ojectActionDelegate.java:47)
    at com.springsource.sts.gradle.core.util.GradleRunnab le$1.run(GradleRunnable.java:43)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.j ava:54)


    I'm on a residential network so there are no proxies or firewalls in the way. Also I as able to download the distribution too, but putting the link in my browser. Could it be related to a permission issue?

  4. #4
    Join Date
    May 2010
    Posts
    398

    Default

    Thanks, that gives a little bit more information.

    The second error is likely a result of the first, it happened because STS was unable to obtain a project model, which in turn is because Gradle was unable to fetch / unpack the gradle distribution.

    The first error happens when Gradle is trying to open the zip. So it looks like the zip was already downloaded, but for some reason it could not be opened. It could be the downloaded zip was somehow corrupt. I don't know exactly where gradle caches this downloaded zip, but you could poke around a little inside the .gradle folder in either your user home directory or your project. Try deleting some stuff there.

    Or... if it seems hard to figure out where the zip is or what you'd need to delete exactly... a bit more drastic, try deleting the .gradle folder(s) alltogether. This will clear out a lot of caches gradle keeps, so expect the next build / operation to take a long time 'downloading the internet'.

    Kris
    Kris De Volder -- SpringSource

  5. #5
    Join Date
    May 2010
    Posts
    398

    Default

    > Could it be related to a permission issue?

    I guess it could be. Though I would think it a bit odd. If Gradle was the one that downloaded the zip, I would surprised if it has saved it in some way that it can't itself then open it.

    Maybe if you can locate the cached zip in the Gradle folder you could find out if its permissions look odd, or if its contents is corrupted.
    Kris De Volder -- SpringSource

  6. #6
    Join Date
    May 2010
    Posts
    398

    Default

    BTW: I found that on my machine gradle seems to store the zips it downloads in here:
    ${user.home}/.gradle/wrapper/dists/

    Kris
    Kris De Volder -- SpringSource

  7. #7
    Join Date
    May 2011
    Posts
    21

    Default

    Yep. Found it last night too. It was exactly as you said, a corrupt download. I checked the download size on the new zip and it was different to what I deleted. Everything works fine now. Thanks Kris.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •