Uploaded image for project: 'PUBLIC - Liferay BLADE'
  1. PUBLIC - Liferay BLADE
  2. BLADE-593

create throws NPE from within a dxpcloud provisioned Liferay workspace

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 4.0.3
    • Fix Version/s: 4.0.4
    • Component/s: blade-cli
    • Labels:
    • Liferay Contributor's Agreement:
      Accept

      Description

      Steps to reproduce:

      $ # change dir into a dxp cloud provisioned workspace
      $ # ours was recently upgraded to v4 with this script
      $ # https://github.com/LiferayCloud/stack-upgrade/upgrade-workspace.sh
      $ cd ~/Projects/github.com/vsingleton/lfrapacgs/liferay
      $
      $ # check you blade version
      $ blade version
      blade version 4.0.3.SNAPSHOT202008260422
      $
      $ # if it is 4.0.1 or below run blade update
      $ # or just run it to check the latest snapshot
      $ blade update
      Updating from: https://repository-cdn.liferay.com/nexus/content/repositories/liferay-public-snapshots/com/liferay/blade/com.liferay.blade.cli//4.0.3-SNAPSHOT/com.liferay.blade.cli-4.0.3-20200828.163408-4.jar
      Update completed successfully.
      $
      $ # try to create a portlet
      $ blade create -t mvc-portlet -v 7.2 foo-mvc-portlet
      null
      java.lang.NullPointerException
      	at com.liferay.blade.cli.command.CreateCommand._getLiferayVersion(CreateCommand.java:525)
      ... snipped for brevity ...
      $
      $ # at this point you have reproduced the issue
      $ # but you might want to continue with the following steps to see more ...
      $
      $ # check your ~/jpm or you ~/.jpm folder for your previous versions of blade ...
      $ # not sure why we have both a ~/jpm and a ~/.jpm folder, but either one will have copies of blade in it as follows:
      $ ls -tlra ~/jpm/repo/ | grep -v -e .json
      total 51180
      drwxr-xr-x 6 vds vds     4096 Jan  8  2020 ..
      -rw-r--r-- 1 vds vds      808 Jan  8  2020 service.jar
      -rw-r--r-- 1 vds vds  2052531 Jan  8  2020 E327AC81A6D0CB9F426C9F655968C054C8B7F3B2
      -rw-r--r-- 1 vds vds  7310944 Jan  8  2020 C5B70A39F0738A16D25EC9A758EBF85D3F7CAE89
      -rw-r--r-- 1 vds vds  7311659 Jan 17  2020 746D226D121EA27728CD1D3D6F8F0612FBFC6898
      -rw-r--r-- 1 vds vds 11279577 Aug 20 10:32 407A54AEFA6420F34701C4606917E5A4ED119728
      -rw-r--r-- 1 vds vds 11173010 Aug 24 10:58 5F4EA3C6E2633092BC687F8D33048C9814E6774C
      -rw-r--r-- 1 vds vds  2053883 Aug 26 10:00 92F0BBF78533E1B948C480FE9C9ABB3043A7ED5D
      -rw-r--r-- 1 vds vds 11173112 Aug 26 11:22 B3F771E136703D55E7C1E016DAFF318367B86A09
      drwxr-xr-x 2 vds vds     4096 Aug 26 11:22 .
      $
      $ java -jar ~/jpm/repo/B3F771E136703D55E7C1E016DAFF318367B86A09 version
      blade version 4.0.3.SNAPSHOT202008260422
      $
      $ java -jar ~/jpm/repo/B3F771E136703D55E7C1E016DAFF318367B86A09 create -t mvc-portlet -v 7.2 foo-mvc-portlet
      null
      java.lang.NullPointerException
      	at com.liferay.blade.cli.command.CreateCommand._getLiferayVersion(CreateCommand.java:525)
      ... snipped for brevity ...
      $
      $ java -jar ~/jpm/repo/5F4EA3C6E2633092BC687F8D33048C9814E6774C version
      blade version 4.0.2.202008212203
      $ java -jar ~/jpm/repo/5F4EA3C6E2633092BC687F8D33048C9814E6774C create -t mvc-portlet -v 7.2 foo-mvc-portlet
      null
      java.lang.NullPointerException
      	at com.liferay.blade.cli.command.CreateCommand._getLiferayVersion(CreateCommand.java:525)
      ... snipped for brevity ...
      $
      $ java -jar ~/jpm/repo/407A54AEFA6420F34701C4606917E5A4ED119728 version
      blade version 4.0.1.202007292353
      $
      $ java -jar ~/jpm/repo/407A54AEFA6420F34701C4606917E5A4ED119728 create -t mvc-portlet -v 7.2 foo-mvc-portlet
      Successfully created project foo-mvc-portlet in 
      /home/vds/Projects/github.com/vsingleton/lfrapacgs/liferay
      $
      
      

       

      Expected results:
      All versions of blade here should "Successfully created project foo-mvc-portlet"
      Actual results:
      Latest two version result in NPE

       null
      java.lang.NullPointerException
      	at com.liferay.blade.cli.command.CreateCommand._getLiferayVersion(CreateCommand.java:525)
      	at com.liferay.blade.cli.command.CreateCommand.getProjectTemplateArgs(CreateCommand.java:335)
      	at com.liferay.blade.cli.command.CreateCommand.execute(CreateCommand.java:165)
      	at com.liferay.blade.cli.BladeCLI._runCommand(BladeCLI.java:1309)
      	at com.liferay.blade.cli.BladeCLI.runCommand(BladeCLI.java:658)
      	at com.liferay.blade.cli.BladeCLI.run(BladeCLI.java:498)
      	at com.liferay.blade.cli.BladeCLI.main(BladeCLI.java:133)

       

      NOTE: this issue is not reproduced from within a plain workspace provisioned with "blade init".

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              vernon_singleton Vernon Singleton
              Participants of an Issue:
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Packages

                  Version Package
                  4.0.4