Uploaded image for project: 'Forge'
  1. Forge
  2. FORGE-1627 Executing Forge scripts
  3. FORGE-1802

Console hangs when running an invalid script

    XMLWordPrintable

Details

    • Sub-task
    • Resolution: Done
    • Blocker
    • 2.7.1.Final
    • 2.5.0.Final
    • UI - Shell
    • None

    Description

      I am executing a script (with the run command) and the console hanged and stopped working completely (I had to kill the process). I realized that there is an error in the script (missing ; at the end of line --named ISBN).

      Take the following script, and save it on a hangs.fsh file

      #  #####################  #
      #  Creates a new project  #
      #  #####################  #
      project-new --named cdbookstore --topLevelPackage org.agoncal.training.javaee6adv --type war --finalName cdbookstore ;
      
      
      # Setup the persistence unit in persistence.xml
      # ############
      jpa-setup --persistenceUnitName cdbookstorePU ;
      
      
      #  ########################  #
      #  Creates the domain model  #
      #  ########################  #
      
      # ISBN constraint
      # ############
      constraint-new-annotation --named ISBN
      
      
      # Genre entity
      # ############
      jpa-new-entity --named Genre ;
      jpa-new-field --named name --length 100 ;
      

      Now, execute the script, and see the error message :

      [temp]$ run hangs.fsh
      project-new --named cdbookstore --topLevelPackage org.agoncal.training.javaee6adv --type war --finalName cdbookstore ;
      ***SUCCESS*** Project named 'cdbookstore' has been created.
      [cdbookstore]$ jpa-setup --persistenceUnitName cdbookstorePU ;
      ***SUCCESS*** Persistence (JPA) is installed.
      [cdbookstore]$ constraint-new-annotation --named ISBN
      ***SUCCESS*** Bean Validation Constraint Annotations org.agoncal.training.javaee6adv.constraints.ISBN was created
      [ISBN.java]$ jpa-new-entity --named Genre ;
      Exception when parsing/running: jpa-new-entity --named Genre , org.jboss.forge.roaster.model.impl.JavaAnnotationImpl cannot be cast to org.jboss.forge.roaster.model.MemberHolder
      [ISBN.java]$
      

      At this point, I can't interact with the console and need to kill the process.

      Attachments

        Activity

          People

            rhn-support-ggastald George Gastaldi
            agoncal Antonio Goncalves (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: