GeeCON Prague 2014*
The moose likes Spring and the fly likes Petclinic of Spring2.5.6 with MYSQL and GLASSFISH Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Petclinic of Spring2.5.6 with MYSQL and GLASSFISH" Watch "Petclinic of Spring2.5.6 with MYSQL and GLASSFISH" New topic
Author

Petclinic of Spring2.5.6 with MYSQL and GLASSFISH

Yeddu Prabhakara Rao
Greenhorn

Joined: Feb 06, 2010
Posts: 4
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.


Do the thing you fear and the death of the fear is certain
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

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


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Yeddu Prabhakara Rao
Greenhorn

Joined: Feb 06, 2010
Posts: 4
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.

 
GeeCON Prague 2014
 
subject: Petclinic of Spring2.5.6 with MYSQL and GLASSFISH