Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Localhost not working

 
Rose Rimsky
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi! I'm newbie to hibernate, I'm working with it in a Java web project. There's something I can't understand, in my hibernate.cfg.xml, when I change the hibernate.connection.url property to localhost instead of my IP address, I can't connect to my db. The following error appears: java.sql.SQLException: I/O Exception: The Network Adapter could not establish the connection. When I use my IP address everything works fine, but I was just wondering why is this happening. I have checked my port and the listener, and they are ok, so what could be happening?

I'm using Hibernate 3, GlassFish v3, Java EE 5, Java Platform JDK 1.6., and Oracle 11g. Here is my hibernate config file:

Thanks in advance for any help!!
 
Rohithaksha Kalluraya
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its possible that your database server is not listening on localhost (loopback device). To verify that you can do

which returns an error if your database server is not listening on localhost.

 
Rose Rimsky
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rohithaksha Kalluraya wrote:Its possible that your database server is not listening on localhost (loopback device). To verify that you can do

which returns an error if your database server is not listening on localhost.



Hi Rohithaksha, thanks four your reply, I did what you tell me and as you mentioned, it appeared a message error: Could not open connection to the host, on port 1521: Connection failed. How may I solve this?? I will appreciate any suggestion

Thanks!!
 
Rohithaksha Kalluraya
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah! That error suggests database server is not listening on localhost.

Sorry! I am not sure how to fix that. That should be some setting in the database side and not anything to do with hibernate settings. Database administration related forums might help you.
 
Rose Rimsky
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Rohithaksha, one more time, thanks four your reply! As you suggested I've post this problem in the JDBC forum. Hope someone there may know how to solve this error

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic