Spring Roo
  1. Spring Roo
  2. ROO-3308

NullPointerException thrown by Roo Shell prevents Roo from adding ITDs to a service

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Works as Designed
    • Affects Version/s: 1.2.2.RELEASE
    • Fix Version/s: None
    • Component/s: @ ROO SHELL
    • Labels:
      None
    • Environment:
      Linux

      Description

      I created a service by adding the @RooService annotation to an interface and providing an implementation (see files attached below) and I now systematically get the following NPE:

      NullPointerException at org.springframework.roo.addon.layers.service.ServiceInterfaceLocatorImpl.getServiceInterfaces(ServiceInterfaceLocatorImpl.java:44)

      1. Message.java
        1.0 kB
        Julien Martin
      2. MessageService.java
        0.3 kB
        Julien Martin
      3. MessageServiceImpl.java
        0.9 kB
        Julien Martin

        Activity

        Hide
        Julien Martin added a comment -

        Hello,
        I would very willingly provide more information about this exception if only I knew how to turn on the debug on the Roo Shell.
        Can someone please advise?
        Regards,
        Julien.

        Show
        Julien Martin added a comment - Hello, I would very willingly provide more information about this exception if only I knew how to turn on the debug on the Roo Shell. Can someone please advise? Regards, Julien.
        Hide
        Alan Stewart added a comment -

        Would you please attach the project? Use the the Roo 'backup' command in the shell.

        Show
        Alan Stewart added a comment - Would you please attach the project? Use the the Roo 'backup' command in the shell.
        Hide
        Julien Martin added a comment -

        Done.

        Show
        Julien Martin added a comment - Done.
        Hide
        Alan Stewart added a comment -

        Added NPE check in Git ID 2335a3c080ee35999bb155b47c91d1835ac40917

        Show
        Alan Stewart added a comment - Added NPE check in Git ID 2335a3c080ee35999bb155b47c91d1835ac40917
        Hide
        Julien Martin added a comment -

        What was actually the problem?
        Is there a way of circumventing it using Spring Roo 1.2.2?

        Show
        Julien Martin added a comment - What was actually the problem? Is there a way of circumventing it using Spring Roo 1.2.2?
        Hide
        Julien Martin added a comment - - edited

        Alan,
        See my three questions here: http://forum.springsource.org/showthread.php?132508-NullPointerException-thrown-by-Roo-Shell-prevents-Roo-from-adding-ITDs-to-a-service&p=431448#post431448

        I have just dropped the following jar: org.springframework.roo.addon.layers.service-1.2.3.BUILD-SNAPSHOT.jar and deleted the corresponding 1.2.2 jar from the bundle directory of Spring roo 1.2.2.

        I've also deleted the cache directories.

        I don't get a NPE but no ITD are generated for the MessageService Roo service...

        Julien.

        Show
        Julien Martin added a comment - - edited Alan, See my three questions here: http://forum.springsource.org/showthread.php?132508-NullPointerException-thrown-by-Roo-Shell-prevents-Roo-from-adding-ITDs-to-a-service&p=431448#post431448 I have just dropped the following jar: org.springframework.roo.addon.layers.service-1.2.3.BUILD-SNAPSHOT.jar and deleted the corresponding 1.2.2 jar from the bundle directory of Spring roo 1.2.2. I've also deleted the cache directories. I don't get a NPE but no ITD are generated for the MessageService Roo service... Julien.
        Hide
        Julien Martin added a comment -

        I think I have found part of the root of the problem: Roo 1.2.2 does not seem to like when one specifies a single domain type as follows:

        @RooService(domainTypes = Message.class)

        Rather one has to specify an array of elements as follows:

        @RooService(domainTypes =

        {Message.class}

        )

        even if there is a single element.

        Maybe it would be nice if Roo was more verbose when it find something it does not like such as the first code snippet above...

        Regards,

        Julien.

        Show
        Julien Martin added a comment - I think I have found part of the root of the problem: Roo 1.2.2 does not seem to like when one specifies a single domain type as follows: @RooService(domainTypes = Message.class) Rather one has to specify an array of elements as follows: @RooService(domainTypes = {Message.class} ) even if there is a single element. Maybe it would be nice if Roo was more verbose when it find something it does not like such as the first code snippet above... Regards, Julien.
        Hide
        Alan Stewart added a comment -

        Spot on - the domainTypes is an array regardless of whether you have one or more types.

        I should have been more clear earlier: I added a new validate statement with words to this effect

        Show
        Alan Stewart added a comment - Spot on - the domainTypes is an array regardless of whether you have one or more types. I should have been more clear earlier: I added a new validate statement with words to this effect

          People

          • Assignee:
            Alan Stewart
            Reporter:
            Julien Martin
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: