File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes JDBC - Connection Refused Error.  Connecting (trying) to Oracle DB. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JDBC - Connection Refused Error.  Connecting (trying) to Oracle DB." Watch "JDBC - Connection Refused Error.  Connecting (trying) to Oracle DB." New topic
Author

JDBC - Connection Refused Error. Connecting (trying) to Oracle DB.

Rembrandt Reyes
Greenhorn

Joined: Feb 18, 2009
Posts: 3
warning: greenhorn = me.

I am getting the following error message in my log file whenever I run my Java app which makes connections to an Oracle DB:


SQLException: Io exception: Connection refused
(DESCRIPTION=(ERR=1153)(VSNNUM=169869568)(ERROR_STACK=(ERROR=(CODE=1153)(EMFI=4)
(ARGS='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.###.###)(PORT=1521)))
(CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))null))'))(ERROR=(CODE=303)(EMFI=1))))

I am sure the HOST is correct. I have also tried using the server name.

Using google fu, I've found references to needing to use a driver called classes12.jar Although I'm not quite sure what to do with it (I've place it in different locations of the app directory but it didn't do anything)

Let me know what other information I can share to help me solve my problem.

Background info, we've recently changed from using a single node to load balancing 2 nodes. That is when the problem started (and when I inherited this application).
I should also warn that this is my first programming/DB assignment coming from a hardware backround. I miss the warm comforts of my switches and routers....


Thank you in advance.


Remy
Paul Campbell
Ranch Hand

Joined: Oct 06, 2007
Posts: 338
It is your Oracle JDBC driver.

in your classpath would be a good spot for it.
Rembrandt Reyes
Greenhorn

Joined: Feb 18, 2009
Posts: 3
- Thanks for the reply Paul.

I've made sure the classes12.jar is in the ClassPath and it already was.
D:\SystemApps\Oracle\ora92\jdbc\lib\classes12.jar

I also added classes12.jar as a jar to my project and then redeployed the app.

I'm still getting the same errors.

- To make sure I understand this, classes12.jar is an oracle driver or what Java uses to communicate with the oracle database. By placing it in the environment variables, the system knows where to find the said driver (and the file does exist in the location above)

- Do I need to do anything else with the file to get it to "be seen"?


- More info: I've installed tomcat on my machine and deployed the code there. It works. No errors. I didn't have to change anything locally (server and local machine are both using Tomcat 5.5). I'm not sure how my local copy is able to talk to Oracle without the classes12.jar driver?



Balu Sadhasivam
Ranch Hand

Joined: Jan 01, 2009
Posts: 874


It might be because of firewall between Appserver and DB. check if you are able to connect to DB server using

" telnet ServerIP 1521 " and see what message you get. If you get the Connection refused error , check the firewall settings
Rembrandt Reyes
Greenhorn

Joined: Feb 18, 2009
Posts: 3
Thank you Balu. I am able to telnet ok.

Here are some more information if helpful:

The application that is failing is called AppscopeBATCH. It primarily makes runs several cron jobs that use SQL to update tables/views. It can also run manual jobs so that we don't have to wait for evening.

Another App also on this server called AppscopeReports goes into the tables that AppscopeBATCH writes to and generates reports from them.

At the server, AppscopeBATCH isn't running at all and gives those errors I stated. AppscopeReports will run SOMETIMES. 50% of the time it will give a similar connection refused error. I just hit F5 and it will work.

I am of course able to run AppscopeBATCH successfully 100% on my local machine. I am also able to run AppscopeReports 100% on my local machine.

The Database is using 2 nodes/2 IPs. Locally, I can connect successfully using single node or load balanced dual node. On the server, it fails or is sporadic on either.


I'm sorry this sounds so messy.



Suhas Mohamedali
Greenhorn

Joined: Jun 05, 2012
Posts: 29
Please download odbc14.jar (for 1.4 and 1.5) from

webpage

Copy it into JBOSS_HOME\server\default\lib.

And try to restart the server again.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JDBC - Connection Refused Error. Connecting (trying) to Oracle DB.
 
Similar Threads
connection refused
Oracle 10g RAC Configuration, JBOSS
JDBC thin /Oracle - Connection refused
JBoss Classpath
Connecting to oracle through glassfish