• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

org.hibernate.exception.GenericJDBCException: Cannot open connection

 
Ankit Varshney
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello friends,

I am deploying my ear file using NetBeans 6.5.1,Jboss 5.0.1GA and hibernate.
But while running my application I am getting some exception..The details are given below....


While debugging the code the error point is....

What I understand is that while an entity want to connect with the database its throwing the above Exception..
There is no problem for a JSP to communicate with database using session bean....It running fine..
Please help me out to sort the problem..
My persistence.xml looks like this...

 
Christian Dillinger
Ranch Hand
Posts: 200
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is your datasource you use here "<jta-data-source>java:/jnrldc/mysql83</jta-data-source> " correct? Can you open a connection with the parameters saved there?
 
Ankit Varshney
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes ,Its Right
As I am able to retrieve my user name and password from a Jsp Page using the session bean,So I dont think its a problem of DataSource....
 
Amar Deep Singh Chaudhary
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey ankit,
the problem, which i am seeing here is that, may be your entities are not connected with the database, can you tell me that at which point you have defined that. entity to connect to database. Have makes all the entries in **-ds.xml in jboss deploy directory, if not then you need to make that, the other problem which may is that, you will not be getting the reference of NamedQuery in which you are passing the parameter, can you also show us the code of your Entity, so that we can look into that, also show your **-ds.xml file code.

Thanks
With Regards
Amar Deep Singh
http://amardeep.100webspace.net
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic