Announcement Announcement Module
No announcement yet.
Gradle Integration Plugin NullPointerException Page Title Module
Move Remove Collapse
Conversation Detail Module
  • 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 The details show:

    Extensions / Gradle Integration

    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:

    at org.springsource.ide.eclipse.gradle.core.util.Grad
    at org.eclipse.jface.operation.ModalContext$ModalCont
    Caused by: java.lang.NullPointerException
    at org.springsource.ide.eclipse.gradle.core.GradlePro ject.getProject(
    at org.springsource.ide.eclipse.gradle.core.GradlePro ject.getName(
    at org.springsource.ide.eclipse.gradle.core.GradlePro ject.getDisplayName(
    at org.springsource.ide.eclipse.gradle.core.GradlePro ject.getGradleModel(
    at org.springsource.ide.eclipse.gradle.core.GradlePro ject.getSkeletalGradleModel( )
    at org.springsource.ide.eclipse.gradle.ui.wizards.Gra dleImportWizardPageOne$11.doit(GradleImportWizardP
    at org.springsource.ide.eclipse.gradle.core.util.Grad
    ... 1 more

    With this session data:
    java.vendor=Apple Inc.
    BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US
    Framework arguments: -product -keyring /Users/emoseman/.eclipse_keyring -showlocation
    Command-line arguments: -os macosx -ws cocoa -arch x86_64 -product -keyring /Users/emoseman/.eclipse_keyring -showlocation

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



  • #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.




    • #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

      Anyway, this is a bug, I should add some code to avoid crashing on projects with null locations.
      Issue ticket created:

      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.



      • #4

        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!



        • #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.