Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Petclinic of Spring2.5.6 with MYSQL and GLASSFISH

 
Yeddu Prabhakara Rao
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

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.

Thanks.

 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Yeddu Prabhakara Rao
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?

Mark


Mark,

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 ?

Regards,
Yeddu.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic