This week's book giveaway is in the Artificial Intelligence and Machine Learning forum.
We're giving away four copies of Zero to AI - A non-technical, hype-free guide to prospering in the AI era and have Nicolò Valigi and Gianluca Mauro on-line!
See this thread for details.
Win a copy of Zero to AI - A non-technical, hype-free guide to prospering in the AI era this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

org.hibernate.exception.GenericJDBCException: Cannot open connection

 
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...

 
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....
 
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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic