4 Replies Latest reply on Jul 11, 2014 12:36 AM by gerry.matte

    Forge 2 jpa generate entities failure


      After creating a project and setting up the addons, I decided to create a connection profile in the hopes that forge 2 would use those parameters for database connectivity.

      I was interested to note that I was never prompted to enter a password for my jdbc connection.


      As with Datasources in Forge 1, it seems that Forge 2 ignores connection profiles.  The generated persistence.xml references the generic org.hibernate.dialect.HSQLDialect dialect rather than my preferred MySQL dialect.


      When I used the forge command jpa-generate-entities-from-tables I was prompted to enter again all the information that I previously entered when creating the connection profile.

      And again, there was no prompt to enter a password for the jdbc connection.


      Not surprisingly, when forge attempted to connect to the mysql  database, an "Access Denied" exception was thrown.  After a couple warnings about log4j appenders missing, forge declared ***Success*** although 0 entities were generated.


      So, my questions:

      1.  Rather than entering a Forge 2 command and then waiting to answer the prompts, is there a way I can find out the keywords that would be accepted by the command ?  I would prefer to specify the parameters to the command on the same line as the command itself.  I tried entering the command with ? but that was not effective....

      2.  When I gave forge the config-list command, I saw a datasource from an obsolete project that I have now retired.  How do I obliterate it ?

      3.  It appears that Forge 2 documentation does not exist.  When I do a command-list, the identified commands look fairly different from Forge 1.  Although I often enjoy experimenting with new technology, I need to know if Forge 2 is still experimental or is it ready to be used instead of Forge 1 ?  (I don't mind if it is experimental still .... I will adjust my expectations as needed)

      4. For the Forge 2 command jpa-generate-entities-from-tables is there a way to provide forge with the password ?

      5. Looking forward to the next steps in my project generation, is there a richfaces addon yet ?




        • 1. Re: Forge 2 jpa generate entities failure

          I resolved that inconvenience writing the command like this:


          jpa-generate-entities-from-tables --jdbcUrl <your jdbc url here> --userName <your username here> --userPassword <your password here > --driverLocation <the path of the driver here > --hibernateDialect <This is optional, i prefer omit it and the command list all options and just choose the appropiate for you>

          Hope this helps.

          • 2. Re: Forge 2 jpa generate entities failure

            Seems like it's sensitive to order of input. I kept getting "No suitable driver found for..." errors until I followed your example

            • 3. Re: Forge 2 jpa generate entities failure

              First, apologies for missing this thread until now. It seems like our email notifications weren't coming through for a while on the mailing list.


              Order of arguments definitely matters in Forge 2, specifically for wizard-based commands (designed to guide inputs via <TAB> completion). However, the errors you're describing are worrisome. Could you please post and explain in detail the steps that you used when you encountered the issue? I want to make sure we get it fixed!


              Also, we just (last week) launched the Forge 2 website, with the first set of documentation and examples, but we do need to put up a good database-reverse engineering tutorial. Feedback and help writing very much appreciated!


              Also, Forge 2 is fairly stable, but it was a complete rewrite, there are issues, and we are always improving Your feedback definitely helps. Thank you!



              • 4. Re: Forge 2 jpa generate entities failure

                Thanks for your response Lincoln.  When there was no response I stopped trying to make forge 2 work and I took a different approach ....


                I'm looking forward to getting back to forge 2 especially the latest version.


                I would be willing to participate in a database reverse engineering tutorial ....


                Currently I am in the middle of a project that I can't set aside and I don't expect to be available for new fun until late next week....