Announcement Announcement Module
Collapse
No announcement yet.
Gradle Integration Plugin NullPointerException Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Gradle Integration Plugin NullPointerException

    I just installed a fresh copy of Eclipse 4.2 and then installed the Gradle intergration plugin from http://dist.springsource.com/release/TOOLS/gradle. The details show:

    Extensions / Gradle Integration 1.0.0.7N77-cNiYH67UEMUMEEkEocs_j7z06er5

    The very next step was to import a gradle project, one that I've been developing in for a while now using gradle 1.2 on the command line. After selecting the project directory I click on "Build Model" and I get this exception:

    java.lang.reflect.InvocationTargetException
    at org.springsource.ide.eclipse.gradle.core.util.Grad leRunnable.run(GradleRunnable.java:93)
    at org.eclipse.jface.operation.ModalContext$ModalCont extThread.run(ModalContext.java:121)
    Caused by: java.lang.NullPointerException
    at org.springsource.ide.eclipse.gradle.core.GradlePro ject.getProject(GradleProject.java:717)
    at org.springsource.ide.eclipse.gradle.core.GradlePro ject.getName(GradleProject.java:500)
    at org.springsource.ide.eclipse.gradle.core.GradlePro ject.getDisplayName(GradleProject.java:886)
    at org.springsource.ide.eclipse.gradle.core.GradlePro ject.getGradleModel(GradleProject.java:597)
    at org.springsource.ide.eclipse.gradle.core.GradlePro ject.getSkeletalGradleModel(GradleProject.java:625 )
    at org.springsource.ide.eclipse.gradle.ui.wizards.Gra dleImportWizardPageOne$11.doit(GradleImportWizardP ageOne.java:514)
    at org.springsource.ide.eclipse.gradle.core.util.Grad leRunnable.run(GradleRunnable.java:85)
    ... 1 more

    With this session data:
    eclipse.buildId=M20120914-1800
    java.version=1.6.0_35
    java.vendor=Apple Inc.
    BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US
    Framework arguments: -product org.eclipse.epp.package.java.product -keyring /Users/emoseman/.eclipse_keyring -showlocation
    Command-line arguments: -os macosx -ws cocoa -arch x86_64 -product org.eclipse.epp.package.java.product -keyring /Users/emoseman/.eclipse_keyring -showlocation


    Any ideas, or is this not ready for prime-time?

    Thanks!

    --
    Evan

  • #2
    > is this not ready for prime-time?

    Of course I wouldn't say that :-)

    There are some serious users within the SpringSource organization, for example projects like spring framework and spring security work well with the gradle tools.

    But it does look like you have hit a bug there. Certainly the tools are not bug free.
    I'll take your stacktrace and see if there's a guess I can make based on that.

    Post back later.

    Cheers,

    Kris

    Comment


    • #3
      It looks like we the method that is trying to look for projects in the workspace matching something your are importing is having some trouble with some of the projectc already in your workspace.

      It seems like some of the projects in your workspace don't have a 'location' (location is null).

      This is not common, but it may happen for a number of reasons (If you are interested in Eclipse API... see
      http://help.eclipse.org/indigo/index...FIProject.html)

      Anyway, this is a bug, I should add some code to avoid crashing on projects with null locations.
      Issue ticket created: https://issuetracker.springsource.com/browse/STS-2994

      According to the API docs some causes of 'null' location are:
      - project in the workspace that don't actually exist
      - project in the workspace that has a location defined in terms of an undefined path variable.

      Maybe if you can figure out the problem projects triggering the bug you can delete them from your workspace (or fix the path variable).

      Alternatively, try out the tools on fresh and empty workspace (if you don't want to mess with your current workspace).

      As I cannot reproduce the problem here, I'm not 100% sure of my analysis. In any case adding a null check seems like a good idea. Thanks for bringing it to my attention.

      Kris

      Comment


      • #4
        Kris,

        Thank you for the quick response, and I apologize for the "ready for prime-time" comment, looking back it feels a little crass.

        Anyhow, my workspace did in fact have a bunch a projects that had been renamed or moved since I used Eclipse last. Hopefully this will help with the analysis: when I tried to open the missing project I would get this exception message:

        The project description file (.project) for 'opensso' is missing. This file contains important information about the project. The project will not function properly until this file is restored.

        So in my case the directories configured in the workspace didn't exist at all. Hope that helps.. Since I deleted all of these projects from the workspace I have been able to import a gradle project.

        Thanks for your help, and for working on this plugin, it is a huge help!

        --
        Evan

        Comment


        • #5
          Thanks Evan,

          I took no offense to your comment. Of course I prefer not to see it put precisely that way.
          But it is understandable if one runs into a bug, one is annoyed and questions the quality of the product :-).

          No matter how you put it, I'm still glad you decided to say/post something giving me a chance to fix the problem.
          This is much better than simply tossing the tools in the bin and walking away without saying anything.

          Let me know if you run into more problems.

          Kris

          Comment

          Working...
          X