Results 1 to 11 of 11
  1. #1
    Join Date
    Sep 2004
    Posts
    6

    Unanswered: tomcat on linux oracle, could not establish the connection

    what i've got

    Tomcat 5.0.27 on linux fedora accessing an oracle db

    the error i get

    Database Error : java.sql.SQLException: Io exception: The Network Adapter could not establish the connection

    i'm kinda stumped, i've set up tomcat to access oracle before and have not seen this error, i've double check the code, sid, ip, port, login info and what not, and it all works (i set up tomcat on a windows machine, same version, accessing the same db with all the same info, and it works fine)

    any help would be great, so far the only thing i've come accross in forums is a few mentions of tomcat version x not being able to access an oracle db if on a linux machine, but i dont believe it.

  2. #2
    Join Date
    Jul 2003
    Posts
    2,296
    listener running?
    - The_Duck
    you can lead someone to something but they will never learn anything ...

  3. #3
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    what is in Oracle's listener.log file?
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  4. #4
    Join Date
    Sep 2004
    Posts
    6
    i checked the listener log, seems to be ok as far as i can tell, my knowlege is limited in this area, but i'm pretty sure its telling me its established, but the output on the tomcat side is still giving me the same error that i posed the first time:

    java.sql.SQLException: Io exception: The Network Adapter could not establish the connection

    it also appears as if the oracle listener.log is telling me that it's trying to extablish a link but can't connect.

    it almost seems like they aren't compatable systems for comunication, they know they are there, but they wont speak to one another. any clues are still welcome.

  5. #5
    Join Date
    Jul 2003
    Posts
    2,296
    1. can you connect via sql*plus to the database in question?
    2. please post the tnsnames.ora and sqlnet.ora file on the client.
    3. also, are you connecting jdbc thin?
    - The_Duck
    you can lead someone to something but they will never learn anything ...

  6. #6
    Join Date
    Sep 2004
    Posts
    6
    1 - yes, i can connect via sql*plus, i even have this same tomcat setup and code, exact cut and past set up running perfectly on my windows machine.
    2 - tns and sqlnet are fine.
    3 - yes to the thin client.

    like i said, everything does work, just not on the fedora machine. this is a database that i use in multiple different places, can connect via multiple different db editors, i can ping the oracle db machine from the linux box, i just can't get the friggin things to talk. its like they can see each other, but dont want to talk.

    does anyone know of any discrpencies between tomcat on linux and oracle?

    i might try older versions of tomcat, see what comes up, but i'd still like suggestions on what to do with the current stat of things. i will continue searching, if i find anything, i'll be sure to let everyone know.
    thanks for all the help.

  7. #7
    Join Date
    Jul 2003
    Posts
    2,296
    Code:
    For JDBC Thin: 
    You must specify a full name-value pair connect string 
    (the same as it might appear in the tnsnames.ora file) 
    instead of the short JDBC Thin syntax. 
    For example, instead of 
    "jdbc:oracle:thin:@host:port:sid"
    
    you would need to use a string of the form
    
    "jdbc:oracle:thin:@(DESCRIPTION="                    +
                           "(ADDRESS_LIST="              + 
                               "(ADDRESS=(PROTOCOL=TCP)" + 
                                        "(HOST=host)"    +                                      =
                                        "(PORT=port)"    +
                               ")"                       +
                           ")"                           +
                           "(CONNECT_DATA="              +
                               "(SERVICE_NAME=sid)"      +
                               "(SERVER=DEDICATED)"      +
                           ")"                           +
                         ")"
    - The_Duck
    you can lead someone to something but they will never learn anything ...

  8. #8
    Join Date
    Sep 2004
    Posts
    6
    wasn't sure where you wanted me to place it, i assume the .jsp file making the db call.

    "jdbc:oracle:thin:@= " +
    "(DESCRIPTION = " +
    "(ADDRESS_LIST = " +
    "(ADDRESS = (PROTOCOL = TCP)(HOST = hostname)(PORT = port)) " +
    ") " +
    "(CONNECT_DATA = " +
    "(SERVICE_NAME = sid) " +
    ") " +
    ")"

    did that and got:
    java.sql.SQLException: Io exception: NL Exception was generated
    did a search for NL exceptions....got about 3 hits

    i will play with what you have givin me.
    thanks once again for the suggestions.

  9. #9
    Join Date
    Jul 2003
    Posts
    2,296
    are you using MTS (multi-threaded server) or Dedicated?
    - The_Duck
    you can lead someone to something but they will never learn anything ...

  10. #10
    Join Date
    Sep 2004
    Posts
    6
    dedicated i believe.

  11. #11
    Join Date
    Jul 2003
    Posts
    2,296
    this link has a good deal of information:
    Code:
    http://www.websina.com/bugzero/kb/oracle-connection.html
    - The_Duck
    you can lead someone to something but they will never learn anything ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •