1 2 Previous Next 17 Replies Latest reply: May 29, 2012 1:41 PM by Blue RSS

    Hibernate-Tools-plugin - prompts for Username but not the password

    Blue Newbie

      Hello All,

       

      I'm trying to use the hibernate-tools-plugin in forge to try to connect to a sql sever database. While trying to configure the settings using the: generate-entities configure-settings

       

      It prompts me for the username: ? Username for JDBC connection

       

      but not the password. My database needs a password to connect to it. If I continue I get the following error:

       

      com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user 'my_user'.

                at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(Unknown Source)

                at com.microsoft.sqlserver.jdbc.TDSTokenHandler.onEOF(Unknown Source)

                at com.microsoft.sqlserver.jdbc.TDSParser.parse(Unknown Source)

                at com.microsoft.sqlserver.jdbc.SQLServerConnection.sendLogon(Unknown Source)

                at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(Unknown Source)

                at com.microsoft.sqlserver.jdbc.SQLServerConnection.access$000(Unknown Source)

                at com.microsoft.sqlserver.jdbc.SQLServerConnection$LogonCommand.doExecute(Unknown Source)

                at com.microsoft.sqlserver.jdbc.TDSCommand.execute(Unknown Source)

                at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(Unknown Source)

                at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(Unknown Source)

                at com.microsoft.sqlserver.jdbc.SQLServerConnection.loginWithoutFailover(Unknown Source)

                at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(Unknown Source)

                at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(Unknown Source)

                at org.hibernate.forge.plugin.DelegatingDriver.connect(DelegatingDriver.java:24)

                at java.sql.DriverManager.getConnection(DriverManager.java:582)

                at java.sql.DriverManager.getConnection(DriverManager.java:185)

                at org.hibernate.forge.plugin.GenerateEntitiesPlugin.newEntity(GenerateEntitiesPlugin.java:210)

                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.jboss.forge.shell.command.Execution.perform(Execution.java:150)

                at org.jboss.forge.shell.command.fshparser.FSHRuntime.run(FSHRuntime.java:125)

                at org.jboss.forge.shell.command.fshparser.FSHRuntime.run(FSHRuntime.java:63)

                at org.jboss.forge.shell.ShellImpl$ExecutorThread.run(ShellImpl.java:829)

                at org.jboss.forge.shell.ShellImpl.execute(ShellImpl.java:852)

                at org.jboss.forge.shell.ShellImpl.doShell(ShellImpl.java:642)

                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.jboss.weld.bean.proxy.AbstractBeanInstance.invoke(AbstractBeanInstance.java:48)

                at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:125)

                at org.jboss.forge.shell.ShellImpl$Proxy$_$$_WeldClientProxy.doShell(ShellImpl$Proxy$_$$_WeldClientProxy.java)

                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.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:305)

                at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:54)

                at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:163)

                at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:299)

                at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:188)

                at org.jboss.weld.introspector.ForwardingWeldMethod.invokeOnInstance(ForwardingWeldMethod.java:59)

                at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:198)

                at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:282)

                at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:265)

                at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:234)

                at org.jboss.weld.manager.BeanManagerImpl.notifyObservers(BeanManagerImpl.java:635)

                at org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:622)

                at org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:616)

                at org.jboss.forge.shell.Bootstrap$1.run(Bootstrap.java:151)

                at java.lang.Thread.run(Thread.java:662)

      ***ERROR*** [generate-entities] Login failed for user 'my_user'.

       

      Is there anyway to get the plugin to prompt for the password? Is there a newer version that is already doing this?  I'm using the default version that comes with the forge install-plugin hibernate-tools command (org.jboss.hibernate.forge:hibernate-tools-plugin:jar:1.0.0-SNAPSHOT).

       

      Any help on this is much appreciated.

       

      Thank you,

       

      Blue

        • 1. Re: Hibernate-Tools-plugin - prompts for Username but not the password
          Koen Aers Master

          Hi Blue,

           

          Did you try to specify the password as an option to the 'generate-entities' command?

           

          If not try to issue the following: 'generate-entities --password <your-password>'

           

          Let us know if this helps.

           

          Cheers,

          Koen

          • 2. Re: Hibernate-Tools-plugin - prompts for Username but not the password
            Blue Newbie

            Hi Koen,

             

            When I try to run the this command: generate-entities configure-settings --password

             

            I get this message:

            ***INFO*** The command [configure-settings] takes [0] unnamed argument(s), but found [1].

            ***INFO*** Swallowed unknown token [--password] for command [configure-settings].

             

            When I run: generate-entities configure-settings (and hit tab)

             

            These are the only list of commands that I can run (password is missing):

            --table            --schema           --catalog          --entityPackage    --driver           --pathToDriver     --url              --user             --dialect 

             

             

            Thanks,

             

            Blue

            • 3. Re: Hibernate-Tools-plugin - prompts for Username but not the password
              Koen Aers Master

              Hi Blue,

               

              The password is intentionally not stored during the configuration. But you should be able to specify it as an option while issuing the generate-entities command just like I suggested earlier.

               

              Try to define your settings for the datasource (that is all the settings except the password) and afterwards, in order to actually generate the entities, you issue 'generate-entities --password <yourpassword>'.

               

              Regards,

              Koen

              • 4. Re: Hibernate-Tools-plugin - prompts for Username but not the password
                Blue Newbie

                Koen,

                 

                Ok I ran through all of the configurations settings then ran the generate-entities --password <mypassword> command and got the same error in my first post:

                 

                com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user 'my_user'.

                          at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(Unknown Source)

                          at com.microsoft.sqlserver.jdbc.TDSTokenHandler.onEOF(Unknown Source)

                          at com.microsoft.sqlserver.jdbc.TDSParser.parse(Unknown Source)

                          at com.microsoft.sqlserver.jdbc.SQLServerConnection.sendLogon(Unknown Source)

                          at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(Unknown Source)

                          at com.microsoft.sqlserver.jdbc.SQLServerConnection.access$000(Unknown Source)

                          at com.microsoft.sqlserver.jdbc.SQLServerConnection$LogonCommand.doExecute(Unknown Source)

                          at com.microsoft.sqlserver.jdbc.TDSCommand.execute(Unknown Source)

                          at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(Unknown Source)

                          at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(Unknown Source)

                          at com.microsoft.sqlserver.jdbc.SQLServerConnection.loginWithoutFailover(Unknown Source)

                          at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(Unknown Source)

                          at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(Unknown Source)

                          at org.hibernate.forge.plugin.DelegatingDriver.connect(DelegatingDriver.java:24)

                          at java.sql.DriverManager.getConnection(DriverManager.java:582)

                          at java.sql.DriverManager.getConnection(DriverManager.java:185)

                          at org.hibernate.forge.plugin.GenerateEntitiesPlugin.newEntity(GenerateEntitiesPlugin.java:210)

                          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.jboss.forge.shell.command.Execution.perform(Execution.java:150)

                          at org.jboss.forge.shell.command.fshparser.FSHRuntime.run(FSHRuntime.java:125)

                          at org.jboss.forge.shell.command.fshparser.FSHRuntime.run(FSHRuntime.java:63)

                          at org.jboss.forge.shell.ShellImpl$ExecutorThread.run(ShellImpl.java:829)

                          at org.jboss.forge.shell.ShellImpl.execute(ShellImpl.java:852)

                          at org.jboss.forge.shell.ShellImpl.doShell(ShellImpl.java:642)

                          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.jboss.weld.bean.proxy.AbstractBeanInstance.invoke(AbstractBeanInstance.java:48)

                          at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:125)

                          at org.jboss.forge.shell.ShellImpl$Proxy$_$$_WeldClientProxy.doShell(ShellImpl$Proxy$_$$_WeldClientProxy.java)

                          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.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:305)

                          at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:54)

                          at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:163)

                          at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:299)

                          at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:188)

                          at org.jboss.weld.introspector.ForwardingWeldMethod.invokeOnInstance(ForwardingWeldMethod.java:59)

                          at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:198)

                          at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:282)

                          at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:265)

                          at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:234)

                          at org.jboss.weld.manager.BeanManagerImpl.notifyObservers(BeanManagerImpl.java:635)

                          at org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:622)

                          at org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:616)

                          at org.jboss.forge.shell.Bootstrap$1.run(Bootstrap.java:151)

                          at java.lang.Thread.run(Thread.java:662)

                ***ERROR*** [generate-entities] Login failed for user 'my_user'.

                 

                 

                Also I double checked to make sure that the username/password were correct and not locked out.

                • 5. Re: Hibernate-Tools-plugin - prompts for Username but not the password
                  Koen Aers Master

                  That's not the intended behaviour obviously ;-)

                   

                  I'm looking at it.

                   

                  Cheers,

                  Koen

                  • 6. Re: Hibernate-Tools-plugin - prompts for Username but not the password
                    Koen Aers Master

                    At first sight, I don't see anything wrong in the plugin code...

                     

                    But before I go any further, did you see these posts?

                     

                    I'm not familiar wit SQLServer but it seems there are multiple authentication modes. Can you verify your server is using the SQL server authentication and not the Windows authentication?

                     

                    Cheers,

                    Koen

                    • 7. Re: Hibernate-Tools-plugin - prompts for Username but not the password
                      Blue Newbie

                      Koen,

                       

                      So I did have an older driver that I was using but I replaced it with the newer driver mentioned in the first link you provided. Also my sql server database is in the correct authenication mode which is mixed. I'm now getting a slightly different error but it is still related to the login failing:

                       

                      com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user 'my_user'.

                                at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:197)

                                at com.microsoft.sqlserver.jdbc.TDSTokenHandler.onEOF(tdsparser.java:246)

                                at com.microsoft.sqlserver.jdbc.TDSParser.parse(tdsparser.java:83)

                                at com.microsoft.sqlserver.jdbc.SQLServerConnection.sendLogon(SQLServerConnection.java:2529)

                                at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(SQLServerConnection.java:1905)

                                at com.microsoft.sqlserver.jdbc.SQLServerConnection.access$000(SQLServerConnection.java:41)

                                at com.microsoft.sqlserver.jdbc.SQLServerConnection$LogonCommand.doExecute(SQLServerConnection.java:1893)

                                at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:4575)

                                at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1400)

                                at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1045)

                                at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:817)

                                at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:700)

                                at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:842)

                                at org.hibernate.forge.plugin.DelegatingDriver.connect(DelegatingDriver.java:24)

                                at java.sql.DriverManager.getConnection(DriverManager.java:582)

                                at java.sql.DriverManager.getConnection(DriverManager.java:185)

                                at org.hibernate.forge.plugin.GenerateEntitiesPlugin.newEntity(GenerateEntitiesPlugin.java:210)

                                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.jboss.forge.shell.command.Execution.perform(Execution.java:150)

                                at org.jboss.forge.shell.command.fshparser.FSHRuntime.run(FSHRuntime.java:125)

                                at org.jboss.forge.shell.command.fshparser.FSHRuntime.run(FSHRuntime.java:63)

                                at org.jboss.forge.shell.ShellImpl$ExecutorThread.run(ShellImpl.java:829)

                                at org.jboss.forge.shell.ShellImpl.execute(ShellImpl.java:852)

                                at org.jboss.forge.shell.ShellImpl.doShell(ShellImpl.java:642)

                                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.jboss.weld.bean.proxy.AbstractBeanInstance.invoke(AbstractBeanInstance.java:48)

                                at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:125)

                                at org.jboss.forge.shell.ShellImpl$Proxy$_$$_WeldClientProxy.doShell(ShellImpl$Proxy$_$$_WeldClientProxy.java)

                                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.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:305)

                                at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:54)

                                at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:163)

                                at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:299)

                                at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:188)

                                at org.jboss.weld.introspector.ForwardingWeldMethod.invokeOnInstance(ForwardingWeldMethod.java:59)

                                at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:198)

                                at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:282)

                                at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:265)

                                at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:234)

                                at org.jboss.weld.manager.BeanManagerImpl.notifyObservers(BeanManagerImpl.java:635)

                                at org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:622)

                                at org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:616)

                                at org.jboss.forge.shell.Bootstrap$1.run(Bootstrap.java:151)

                                at java.lang.Thread.run(Thread.java:662)

                      ***ERROR*** [generate-entities] Login failed for user 'my_user'.

                       

                       

                      I tried using the Hibernate Tool configuration setup wizard and I was able to connect using the wizard. I would prefer to use forge to connect so I'm wondering if the plugin is not recognizing the generate-entities --password mypassword command. Any other ideas?

                       

                      Thanks,

                       

                      Blue

                      • 8. Re: Hibernate-Tools-plugin - prompts for Username but not the password
                        Koen Aers Master

                        Hi Blue,

                         

                        I guess I'll have to do some deeper diving... Can you in the meantime give me the exact configuration that you are working with? (ie client and server OS'es and Forge/JBT version)

                         

                        Cheers,

                        Koen

                        • 9. Re: Hibernate-Tools-plugin - prompts for Username but not the password
                          Blue Newbie

                          Koen,

                           

                          Here is my setup:

                           

                          OS: WinXP SP3

                          JBT: 3.3.0 Beta1

                          JAVA: EE6

                          Forge: 1.0.4.Final

                          Eclipse: 3.7.2

                          SQL Server: 2008

                           

                          Let me know if you need any additional details.

                           

                          Thanks,

                           

                          Blue

                          • 10. Re: Hibernate-Tools-plugin - prompts for Username but not the password
                            oakay Newbie

                            Has this resolved yet?

                            I have the same problem except that I'm using oracle.

                            • 11. Re: Hibernate-Tools-plugin - prompts for Username but not the password
                              Koen Aers Master

                              The Hibernate tools plugin needed a major overhaul and that's what I'm doing at the moment. I have decided to solve the issue in the process. So noit has not been solved yet. But stay posted, a fix should be available soon.

                               

                              Cheers,

                              Koen

                              • 12. Re: Hibernate-Tools-plugin - prompts for Username but not the password
                                Blue Newbie

                                Thanks for the update Koen! I'll keep an eye out for the updated plugin.

                                 

                                Blue

                                • 13. Re: Hibernate-Tools-plugin - prompts for Username but not the password
                                  Koen Aers Master

                                  Hi guys,

                                   

                                  Sorry for the delay, a few other things have kept me busy. Good news though, this issue should be out of the way. As always it was a simple oversight...

                                   

                                  Let me know how it goes.

                                   

                                  Cheers,

                                  Koen

                                  1 2 Previous Next