Spring Tool Suite
  1. Spring Tool Suite
  2. STS-2294

"entity jpa" command fails in STS Roo Shell but works from OS shell

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Complete
    • Affects Version/s: 2.8.1.RELEASE
    • Fix Version/s: 2.8.1.RELEASE
    • Component/s: ROO
    • Labels:
    • Environment:

      Mac OS X

      Description

      The entity jpa command fails in the STS Roo shell but works from the OS command line shell

      see http://forum.springsource.org/showthread.php?118834-entity-jpa-command-fails-in-STS-Roo-shell&p=390579#post390579

        Activity

        Hide
        Mark added a comment -

        I also reproduced this bug in STS Version: 2.8.1.RELEASE, Build Id: 201111221000

        Show
        Mark added a comment - I also reproduced this bug in STS Version: 2.8.1.RELEASE, Build Id: 201111221000
        Hide
        Denys Slipetskyy added a comment -

        Confirm the same bug in STS Version: 2.8.1.RELEASE on OpenSUSE Linux 11.4 64bit
        This bug is present for many commands (field set, entity etc.)

        M2 buid of Roo was ok.

        Show
        Denys Slipetskyy added a comment - Confirm the same bug in STS Version: 2.8.1.RELEASE on OpenSUSE Linux 11.4 64bit This bug is present for many commands (field set, entity etc.) M2 buid of Roo was ok.
        Hide
        Chance Gold added a comment -

        The repository jpa command also fails in STS 2.8.1.

        Show
        Chance Gold added a comment - The repository jpa command also fails in STS 2.8.1.
        Hide
        Alan Stewart added a comment - - edited

        STS error log shows this after entity jpa command is run:

        java.lang.AbstractMethodError: org.springframework.roo.shell.eclipse.EclipseShell.setPromptPath(Ljava/lang/String;Z)V
                at org.springframework.roo.classpath.converters.LastUsedImpl.setPromptPath(LastUsedImpl.java:86)
                at org.springframework.roo.classpath.converters.LastUsedImpl.setType(LastUsedImpl.java:67)
                at org.springframework.roo.classpath.converters.JavaTypeConverter.convertFromText(JavaTypeConverter.java:131)
                at org.springframework.roo.classpath.converters.JavaTypeConverter.convertFromText(JavaTypeConverter.java:43)
                at org.springframework.roo.shell.SimpleParser.parse(SimpleParser.java:194)
                at org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:198)
                at org.springframework.roo.shell.eclipse.EclipseShell.executeCommand(EclipseShell.java:102)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:597)
                at org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:191)
                at org.springframework.ide.eclipse.core.java.ClassUtils.invokeMethod(ClassUtils.java:136)
                at org.springframework.ide.eclipse.core.java.ClassUtils.invokeMethod(ClassUtils.java:96)
                at org.springframework.roo.shell.eclipse.Bootstrap.execute(Bootstrap.java:83)
                at com.springsource.sts.roo.ui.internal.RooShellTab$CommandJob.run(RooShellTab.java:560)
                at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
        

        It would seem org.springframework.roo.shell.eclipse.EclipseShell does not have the new overloaded method, setPromptPath(String path, boolean overrideStyle)

        Show
        Alan Stewart added a comment - - edited STS error log shows this after entity jpa command is run: java.lang.AbstractMethodError: org.springframework.roo.shell.eclipse.EclipseShell.setPromptPath(Ljava/lang/ String ;Z)V at org.springframework.roo.classpath.converters.LastUsedImpl.setPromptPath(LastUsedImpl.java:86) at org.springframework.roo.classpath.converters.LastUsedImpl.setType(LastUsedImpl.java:67) at org.springframework.roo.classpath.converters.JavaTypeConverter.convertFromText(JavaTypeConverter.java:131) at org.springframework.roo.classpath.converters.JavaTypeConverter.convertFromText(JavaTypeConverter.java:43) at org.springframework.roo.shell.SimpleParser.parse(SimpleParser.java:194) at org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:198) at org.springframework.roo.shell.eclipse.EclipseShell.executeCommand(EclipseShell.java:102) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:191) at org.springframework.ide.eclipse.core.java.ClassUtils.invokeMethod(ClassUtils.java:136) at org.springframework.ide.eclipse.core.java.ClassUtils.invokeMethod(ClassUtils.java:96) at org.springframework.roo.shell.eclipse.Bootstrap.execute(Bootstrap.java:83) at com.springsource.sts.roo.ui.internal.RooShellTab$CommandJob.run(RooShellTab.java:560) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) It would seem org.springframework.roo.shell.eclipse.EclipseShell does not have the new overloaded method, setPromptPath(String path, boolean overrideStyle)
        Hide
        Leo Dos Santos (c) added a comment -

        That is correct. EclipseShell has been inheriting #setPromptPath(String path) from org.springframework.roo.shell.AbstractShell, but there is no #setPromptPath(String, boolean) in either class. Should the new method also be added to AbstractShell, or is it preferable to implement it in EclipseShell? And if we need to implement it in STS, what should be the expected behaviour from EcipseShell?

        Show
        Leo Dos Santos (c) added a comment - That is correct. EclipseShell has been inheriting #setPromptPath(String path) from org.springframework.roo.shell.AbstractShell, but there is no #setPromptPath(String, boolean) in either class. Should the new method also be added to AbstractShell, or is it preferable to implement it in EclipseShell? And if we need to implement it in STS, what should be the expected behaviour from EcipseShell?
        Hide
        Alan Stewart added a comment - - edited

        Shell#setPromptPath(String path, boolean overrideStyle) is specific to our JLineShell, so you will need to implement this in your shell and pass "false" as the boolean parameter.

        Show
        Alan Stewart added a comment - - edited Shell#setPromptPath(String path, boolean overrideStyle) is specific to our JLineShell, so you will need to implement this in your shell and pass "false" as the boolean parameter.
        Hide
        Leo Dos Santos (c) added a comment -

        Hi Alan. Had a quick discussion with the STS team, and we felt that it might be easier if the default implementation were put into AbstractShell. We could avoid doing an STS build, and we'd maintain compatibility between the various Roo 1.15, Roo 1.2 & STS combinations. Your thoughts?

        Show
        Leo Dos Santos (c) added a comment - Hi Alan. Had a quick discussion with the STS team, and we felt that it might be easier if the default implementation were put into AbstractShell. We could avoid doing an STS build, and we'd maintain compatibility between the various Roo 1.15, Roo 1.2 & STS combinations. Your thoughts?
        Hide
        Alan Stewart added a comment -

        Re-opened https://jira.springsource.org/browse/ROO-2948 and resolved by adding default implementation of Shell#setPromptPath(String path, boolean overrideStyle) in AbstractShell. Tested in STS 2.8.1 using Roo rev 0fb73a9.

        Please test and confirm, and if OK close this ticket.

        Alan

        Show
        Alan Stewart added a comment - Re-opened https://jira.springsource.org/browse/ROO-2948 and resolved by adding default implementation of Shell#setPromptPath(String path, boolean overrideStyle) in AbstractShell. Tested in STS 2.8.1 using Roo rev 0fb73a9. Please test and confirm, and if OK close this ticket. Alan
        Hide
        Leo Dos Santos (c) added a comment -

        I've tested against build ecfc2f2 and can confirm that the entity jpa command works as expected now. Thanks for your help with this one Alan.

        Show
        Leo Dos Santos (c) added a comment - I've tested against build ecfc2f2 and can confirm that the entity jpa command works as expected now. Thanks for your help with this one Alan.

          People

          • Assignee:
            Leo Dos Santos (c)
            Reporter:
            Mark
          • Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              First Response Date: