This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
Im trying to configure petclinic sample of spring2.5.6 with mysql and glassfish. I configured jdbc.properties with all the mysql details.
when I try to access db from app, the following error occurs:
Data access failure: Could not open JDBC Connection for transaction; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Access denied for user 'root '@'localhost' (using password: YES))
Ive tried out the following without any success:
1) Reset the root password for mysql
2) Grant all the privileges on petclinic db to 'root' user in Mysql.
Is it the problem with Mysql or with Glassfish? Kindly advise/suggest the solution.
Do the thing you fear and the death of the fear is certain
Do you have a DataSource configuration for connecting to MySQL in Glassfish? And what is your DataSource bean in your Spring configuration. Is it pointing to the DataSource that Glassfish put into its JNDI tree?
Mark Spritzler wrote:Do you have a DataSource configuration for connecting to MySQL in Glassfish? And what is your DataSource bean in your Spring configuration. Is it pointing to the DataSource that Glassfish put into its JNDI tree?
Thanks for responding. No, I dont have Datasource configuration for MySQL in Glassfish. My DataSource bean in Spring configuration uses org.apache.commons.dbcp.BasicDataSource.
Is it mandatory to have Datasource configured in Glassfish (using JNDI name) ?
Earlier, I've deployed another application without Datasource configured in Glassfish, I was only using Datasource bean which has Oracle db related info, and it worked perfect.
Now, Is datasource configuration mandatory when using MySQL with Glassfish ?