7 Replies Latest reply on Jun 13, 2008 12:38 PM by michaelchan

    MySQL strange hostname problem

    michaelchan

      Hi All,

      I am trying to configure jBoss Portal 2.6.5 sp1 to use MySQL db,

      I have copied over the portal-mysql5-ds.xml and mysql-ds.xml and edit db username and password accordingly. However, it seems that some strange hostname was appended by jboss when deploying the portal. I get the following error (repeatedly).

      Caused by: org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Access denied for user 'jbossportal'@'1777777777767777767540 database 'jbossportal')

      Anyone encountered the same problem before?

      Thanks


        • 1. Re: MySQL strange hostname problem
          prabhat.jha

          First, you should only have portal-mysql-ds.xml (or whatever name you give it as long as it's named like *-dx.xml). You can leave hsqldb-ds.xml untouched. I would suggest you double check this file or you can paste the contents here.

          • 2. Re: MySQL strange hostname problem
            michaelchan

             

            "prabhat.jha@jboss.com" wrote:
            First, you should only have portal-mysql-ds.xml (or whatever name you give it as long as it's named like *-dx.xml). You can leave hsqldb-ds.xml untouched. I would suggest you double check this file or you can paste the contents here.


            content of portal-mysql-ds.xml:

            <?xml version="1.0" encoding="UTF-8"?>

            <local-tx-datasource>
            <jndi-name>PortalDS</jndi-name>
            <connection-url>jdbc:mysql://localhost:3306/jbossportal?useServerPrepStmts=fals</connection-url>
            <driver-class>com.mysql.jdbc.Driver</driver-class>
            <user-name>jbossportal</user-name>
            jboss
            </local-tx-datasource>



            • 3. Re: MySQL strange hostname problem
              michaelchan

              <?xml version="1.0" encoding="UTF-8"?>

              <local-tx-datasource>
              <jndi-name>PortalDS</jndi-name>
              <connection-url>jdbc:mysql://localhost:3306/jbossportal?useServerPrepStmts=false</connection-url>
              <driver-class>com.mysql.jdbc.Driver</driver-class>
              <user-name>jbossportal</user-name>
              jboss
              </local-tx-datasource>



              The correct one

              • 4. Re: MySQL strange hostname problem
                michaelchan

                This is getting even stranger now, look at the following error:


                Reason: org.jboss.util.NestedSQLException: Could not create connection; - nested throwable: (com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Access denied for user 'jbossportal'@'1777777777767777767400 database 'jbossportal'); - nested throwable: (org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Access denied for user 'jbossportal'@'0 database 'jbossportal'))



                How come jboss append those 0 and 17777.... ????

                • 5. Re: MySQL strange hostname problem
                  prabhat.jha

                  I use mysql and jboss portal all the time and I have never seen this before. Let's see if other community members can point out something.

                  • 6. Re: MySQL strange hostname problem
                    peterj

                    What OS are you running? Linux? If so, post the /etc/hosts file.

                    Also, are you using the -b option to start JBossAS?

                    Also, did you create a database named 'jbossportal' and a user name jbossportal with password jboss?

                    Finally, when posting XML text, embed it within [ code ] brackets (select the text and click on the Code button).

                    • 7. Re: MySQL strange hostname problem
                      michaelchan

                      Thanks for your reply.

                      You remind me of checking the hosts file.

                      It turns out that there are some strange things in the hosts file. I removed em and jBoss portal is now working

                      Thanks again