1 2 Previous Next 20 Replies Latest reply on Sep 14, 2006 5:58 PM by ewernli

    Bad password for username=admin

    andrewboyd

      Hi All,
      I'm using 2.4.0 final and Mysql 5.

      I have switched to using MySql database but now I can't log in at all. I haven't changed the admin password as I'm just starting this project. So I would expect it to still be "admin", but that does not seem to work. Also I tried to use the user I set in my portal-mysql-ds.xml but that doesn't work either.

      Any Suggestions?

      Thanks,

      Andrew

        • 1. Re: Bad password for username=admin
          peterj

          Did you see the post by nhatnam at http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3967728#3967728? I'm wondering if in your database the jbp_users table is also empty.

          I just now ran portal 2.4.0GA with MySQL 5.0.15, and have no problems with logging in.

          You say you switched to MySQL. When you did that, did you also start with a fresh deployment of the portal?

          • 2. Re: Bad password for username=admin
            andrewboyd

            Thanks for responding Peter. I did see that other post, but since it was piggy-backing another (related) issue I figured that I would post one just of my symtoms.

            I'm not sure what you mean by "fresh deployment of the portal". That being the case I'm sure I didn't do it. Could you please elaborate what you ment?

            Thanks again,

            Andrew

            • 3. Re: Bad password for username=admin

              remove default/tmp, default/data, default/log and default/work

              • 4. Re: Bad password for username=admin
                andrewboyd

                Thanks for the quick reply. I removed those dirs but still had the problem.

                The jbp_users table was empty so I created the user admin/admin through the portal create user form.

                I'm not sure if my admin/admin user will have the correct privilages.

                But now I'm getting the following exception:

                 ERROR [JDBCExceptionReporter] Table 'jbossportal.jbp_instance_per_user' doesn't exist
                 ERROR [ControllerCommand] Rendering portlet window default.default.CatalogPortletWindow produced an internal error
                e.exception.SQLGrammarException: could not execute query
                rg.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
                


                Progress? Hopefully.

                Anyone know what columns are in jbossportal.jbp_instance_per_user?

                Any suggestions


                • 5. Re: Bad password for username=admin

                  Make sure you modified the mysql db with the truncation error issue, as in our wiki.

                  • 6. Re: Bad password for username=admin
                    andrewboyd

                    Hi Roy,
                    Thanks for looking at my issue and giving us such a nice portal implementation. My connection url is:

                    <connection-url>jdbc:mysql://localhost:3306/jbossportal?useServerPrepStmts=false&amp;jdbcCompliantTruncation=false</connection-url>
                    


                    Which I believe is the solution to the Truncation issue.

                    Should I create the jbp_instance_per_user manually? If so what is the column data, please?

                    Thanks again,

                    Andrew

                    • 7. Re: Bad password for username=admin

                      No, the url is only part of the solution. You must fix the flags in the mysql ini itself: http://wiki.jboss.org/wiki/Wiki.jsp?page=AvoidMySQL5DataTruncationErrors

                      • 8. Re: Bad password for username=admin
                        andrewboyd

                        Roy thanks for responding. I did change the strict mode as the wiki said:

                         1. If you have MySQL 5 installed already and running in strict mode, edit the my.ini (or my.cfg) file of MySQL and remove the "STRICT_TRANS_TABLES" part from the line: sql-mode=STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
                         2. Add "jdbcCompliantTruncation=false" in your datasource descriptor file (*-ds.xml) under the deploy directory. Your connection URL should look like: <connection-url>jdbc:mysql://your-host-name:3306/jbossportal?useServerPrepStmts=false&jdbcCompliantTruncation=false</connection-url>
                        


                        Although looking at it now it seems the NO_AUTO_CREATE_USER setting would be the reason I was not able to login as admin as the admin could not be created automaticly. comments?

                        So I do have the my.ini configured as described for the truncation issue. Does anyone know why I'm getting:
                        Table 'jbossportal.jbp_instance_per_user' doesn't exist
                        


                        Thanks in advance,

                        Andrew

                        • 9. Re: Bad password for username=admin
                          peterj

                          The NO_AUTO_CREATE_USER does not have any effect on the portal, that is purely a MySQL setting.

                          The 'table not found' error is expected the first time you run the portal with a new database. Hibernate creates the table automatically.

                          Are any other errors being displayed, either on the console or in the log file?

                          Here is my *-ds.xml file, do you see any noticable difference with yours:

                          <?xml version="1.0" encoding="UTF-8"?>
                          <datasources>
                           <local-tx-datasource>
                           <jndi-name>PortalDS</jndi-name>
                           <connection-url>jdbc:mysql://localhost:3306/portal24?useServerPrepStmts=false&jdbcCompliantTruncation=false</connection-url>
                           <driver-class>com.mysql.jdbc.Driver</driver-class>
                           <user-name>portal</user-name>
                           <password>portalpassword</password>
                           </local-tx-datasource>
                          </datasources>



                          • 10. Re: Bad password for username=admin
                            peterj

                            Another thought, what GRANT options did you use for the user? Here si the SQL file I run to reload the database:

                            DROP DATABASE portal24;
                            CREATE DATABASE portal24;
                            GRANT ALL PRIVILEGES ON portal24.* TO 'portal'@'localhost' IDENTIFIED BY 'portalpassword' WITH GRANT OPTION;





                            • 11. Re: Bad password for username=admin
                              andrewboyd

                              Peter,
                              I want to thank you for taking the time to help! I compaired your ds-xml to mine and they look the same. here is mine:

                              <?xml version="1.0" encoding="UTF-8"?>
                              <datasources>
                               <local-tx-datasource>
                               <jndi-name>PortalDS</jndi-name>
                               <connection-url>jdbc:mysql://localhost:3306/jbossportal?useServerPrepStmts=false&amp;jdbcCompliantTruncation=false</connection-url>
                               <driver-class>com.mysql.jdbc.Driver</driver-class>
                               <user-name>portalUser</user-name>
                               <password>portalUser</password>
                               </local-tx-datasource>
                              </datasources>
                              


                              The 'table not found' error is expected the first time you run the portal with a new database. Hibernate creates the table automatically.

                              I was aware that some errors happened with the initial startup but I've seen this one before. I just rebooted and here are the errors during startup:

                               INFO [FacesConfigurator] Reading config /WEB-INF/faces-config.xml
                               ERROR [LocaleUtils] Locale name null or empty, ignoring
                              
                              ... snip ...
                              
                              WARN [EhCacheProvider] Could not find configuration [org.hibernate.cache.UpdateTimestampsCache]; using defaults.
                              INFO [StandardQueryCache] starting query cache at region: org.hibernate.cache.StandardQueryCache
                              WARN [EhCacheProvider] Could not find configuration [org.hibernate.cache.StandardQueryCache]; using defaults.
                              WARN [JDBCExceptionReporter] SQL Error: 1146, SQLState: 42S02
                              ERROR [JDBCExceptionReporter] Table 'jbossportal.jbp_instance_per_user' doesn't exist
                              INFO [Dialect] Using dialect: org.hibernate.dialect.MySQLDialect
                              


                              ...snip...

                              17:14:22,593 ERROR [SchemaUpdate] Unsuccessful: create table JBP_INSTANCE_PER_USER (PK bigint not null auto_increment, INSTANCE_PK bigint, SER_STATE longblob, USER_ID varchar(170) not null, PORTLET_RE
                              F varchar(170) not null, primary key (PK), unique (USER_ID, PORTLET_REF))
                              17:14:22,593 ERROR [SchemaUpdate] Specified key was too long; max key length is 1000 bytes
                              17:14:22,609 ERROR [SchemaUpdate] Unsuccessful: alter table JBP_INSTANCE_PER_USER add index FK9349B3D05EE4E4AE (INSTANCE_PK), add constraint FK9349B3D05EE4E4AE foreign key (INSTANCE_PK) references JBP
                              _INSTANCE (PK)
                              17:14:22,609 ERROR [SchemaUpdate] Table 'jbossportal.jbp_instance_per_user' doesn't exist
                              17:14:22,609 INFO [SchemaUpdate] schema update complete
                              


                              Do you think I should go ahead and drop the database and re-create as you show above? I don't have any data. Perhaps since I don't have the hybernate -ds.xml there anymore it will treate it as the initial startup and will create everyting for me.

                              Thanks again,

                              Andrew

                              • 12. Re: Bad password for username=admin
                                andrewboyd

                                Hmmm...
                                Looking at mine and yours once they are both in between the code tags I do see that I have a &amp; and you don't. Let me change mine.

                                Andrew

                                • 13. Re: Bad password for username=admin
                                  peterj

                                  I think we are getting somewhere.

                                  The "SQL Error: 1146, SQLState: 42S02" is expected, I get that too.

                                  I am not getting the "Specified key was too long; max key length is 1000 bytes". See http://bugs.mysql.com/bug.php?id=4541. Are you, by any chance using utf-8 as the character set for the database?

                                  • 14. Re: Bad password for username=admin
                                    andrewboyd

                                    I am using utf-8. Should I not?

                                    After changing the &amp; to & I now get:

                                    17:32:54,468 ERROR [MainDeployer] Could not initialise deployment: file:/C:/work/Projects/BBT/inetMillionaire/app-server/jboss-portal-2.4.0/server/inetMillionaire/deploy/portal-mysql-ds.xml
                                    org.jboss.deployment.DeploymentException: Could not parse dd; - nested throwable: (org.xml.sax.SAXParseException: The reference to entity "jdbcCompliantTruncation" must end with the ';' delimiter.)
                                     at org.jboss.deployment.XSLSubDeployer.findDd(XSLSubDeployer.java:231)
                                     at org.jboss.deployment.XSLSubDeployer.init(XSLSubDeployer.java:161)
                                    

                                    Although when I look at your ds I don't see any ;

                                    Andrew

                                    1 2 Previous Next