• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 338
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is your Oracle JDBC driver.

in your classpath would be a good spot for it.
 
Rembrandt Reyes
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
- 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?



 
Ranch Hand
Posts: 874
Android VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.



 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic