2 Replies Latest reply on Dec 11, 2009 2:36 AM by surajmundada

    can not create connection to mysql

      Hi,

      my config is Jboss As 5.1.0.GA + Eclipse Galilio + Seam 2.2.0.GA + Jboss Tools 3.1.0

      I created a Seam Web Project. my registration-ear/registration.ds looks like

      <datasources>
       <local-tx-datasource>
       <jndi-name>registrationDatasource</jndi-name>
       <use-java-context>true</use-java-context>
       <connection-url>jdbc:mysql://localhost:3306/test</connection-url>
       <driver-class>com.mysql.jdbc.Driver</driver-class>
       <user-name>root</user-name>
       <password>root</password>
       </local-tx-datasource>
      </datasources>


      registration-ejb/ejbModule/META-INF/persistence.xml looks like

      <persistence-unit name="registration">
       <provider>org.hibernate.ejb.HibernatePersistence</provider>
       <jta-data-source>java:/registrationDatasource</jta-data-source>
       <properties>
       <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect"/>
       <property name="hibernate.hbm2ddl.auto" value="update"/>
       <property name="hibernate.show_sql" value="true"/>
       <property name="hibernate.format_sql" value="true"/>
       <property name="hibernate.default_schema" value="test"/>
       <property name="jboss.entity.manager.factory.jndi.name" value="java:/registrationEntityManagerFactory"/>
       </properties>
       </persistence-unit>
      


      and registration-ejb/hibernate-console.properties looks like

      hibernate.connection.password=root
      hibernate.connection.username=root
      hibernate.connection.driver_class=com.mysql.jdbc.Driver
      hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
      hibernate.connection.url=jdbc:mysql://localhost:3306/test
      
      hibernate.connection.provider_class=org.hibernate.connection.DriverManagerConnectionProvider
      hibernate.datasource=
      hibernate.transaction.manager_lookup_class=


      when deployed, I get following exception:
      org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: NO))
      


      which is causing javax.ejb.EJBTransactionRolledbackException: @In attribute requires non-null value: register.em

      em is reference for EntityManager in my action listener.

      Any help?

      Suraj