5 Replies Latest reply on Sep 3, 2005 11:04 AM by Marek Libra

    Fedora,JBoss 3.2.7, MySQL 4.1.2 Access denied

    Marek Libra Newbie

      Hi All,

      I can't set up this environment.

      All I did is:
      1) I unpacked the installation package of JBoss (just downloaded from jboss.com)
      2) Copied mysql-connector-java-3.1.10-bin.jar into default/lib directory
      3) As written in many tutorials, I edited files in conf direcotry as follows:
      login-config.xml:
      Added

       <application-policy name = "MySqlDbRealm">
       <authentication>
       <login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule" flag = "required">
       <module-option name ="principal">root</module-option>
       <module-option name ="userName">root</module-option>
       <module-option name ="password">mySecret</module-option>
       <module-option name ="managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=MySqlDS</module-option>
       </login-module>
       </authentication>
       </application-policy>
      


      standardjaws.xml
      Changed
      <type-mapping>mySQL</type-mapping>
      for java:/DefaultDS datasource

      standardjbosscmp-jdbc.xml
      Changed
      <datasource-mapping>mySQL</datasource-mapping>
      for java:/DefaultDS datasource

      Under deploy directory
      Added file mysql-ds.xml with following content:
      <datasources>
       <local-tx-datasource>
       <jndi-name>DefaultDS</jndi-name>
       <connection-url>jdbc:mysql://localhost:3306/test</connection-url>
       <driver-class>com.mysql.jdbc.Driver</driver-class>
       <user-name>root</user-name>
       <password>mySecret</password>
       <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
       </local-tx-datasource>
      </datasources>
      


      Under deploy/jms I added the mysql-jdbc2-service.xml file

      I deleted files hsqldb-jdbc2-service.xml and hsqldb-ds.xml

      During the booting of JBoss I get many exceptions, the main of them is:
      MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM:
      ObjectName: jboss.mq:service=StateManager
       state: FAILED
       I Depend On: jboss.jca:service=LocalTxCM,name=DefaultDS
      
       Depends On Me: jboss.mq:service=DestinationManager
      javax.management.MBeanException: org.jboss.mq.SpyJMSException: Error creating connection to the database.; - nested throwable: (org.jboss.util.NestedSQLException: Could not create connection; - nested throwable: (java.sql.SQLException: Access denied for user 'root'@'localhost.localdomain' (using password: YES)); - nested throwable: (org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: Access denied for user 'root'@'localhost.localdomain' (using password: YES))))
      ObjectName: jboss.mq:service=PersistenceManager
       state: FAILED
       I Depend On: jboss.jca:service=LocalTxCM,name=DefaultDS
      
       Depends On Me: jboss.mq:service=DestinationManager
      javax.management.MBeanException: org.jboss.mq.SpyJMSException: Could not get a connection for jdbc2 table construction ; - nested throwable: (org.jboss.util.NestedSQLException: Could not create connection; - nested throwable: (java.sql.SQLException: Access denied for user 'root'@'localhost.localdomain' (using password: YES)); - nested throwable: (org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: Access denied for user 'root'@'localhost.localdomain' (using password: YES))))
      


      Of course mysqld is running and I can connect to it using 'mysql -u root -p'.

      In Wiki page http://wiki.jboss.org/wiki/Wiki.jsp?page=SetUpAMysqlDatasource I found that there's an issue with RedHat's systems.

      Please, how can I solve this problem?

      I would like to deploy EJBs to this server with local mysql database running.

      Thank you.