• 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

TNS Error

 
Ranch Hand
Posts: 295
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi people, I am currently working with Servlets, JSP and JDBC.

I run my appln for the first time, successfully, the second time, I get an error stating "TNS could not resolve Service Name"

Is this related to DB or my Server (Tomcat)

How to set it right?

Cheers,
Swamy
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Basically this is backend problem.This error comes when the service for database is not started or the listener is not configured properly.I hope u r using oracle as database.
 
Ramaswamy Srinivasan
Ranch Hand
Posts: 295
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Yeah am using Oracle as my backend. I could figure out this to be a back end issue.

Any ways to correct it?

cheers,
Swamy
 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
actually need to know what driver are you using.

oracle.jdbc.driver.OracleDriver
jdbc racle:thin:@<machine IP>:<1521 or if other port>:SID

are you using the same driver or some other???

if this one we can use the SID of the database. no need to create a listener and a service. you can just delete your listener and service both. if its not used by some other app.

hope this helps.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I face the same problem when i request the listener and the listener is not up. after bringing up the listener i used to get the same error. so it is better not to request the listener if the listener is not up or your machine, where the listener reside, is not up.

it is like. Why you request me while i m not up now i am not gonna listen you anyway. configure me again.

and you are like :roll:
 
Ramaswamy Srinivasan
Ranch Hand
Posts: 295
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi adeel,

You are to my rescue again man....happy about that....

Well....i'm not using thin....am using jdbc dbc SN with "sun.jdbc.odbc.JdbcOdbcDriver"

Any luck? where to find the root?

cheers,
Swamy
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why use jdbcOdbc bridge buddy. it will affect your performance in a negative way. you can use classes12.zip instead.

anyways dont know whether SID works with your driver or not. try it out yourself. and if not just configure the listener and service again, and never try to request listener again during listener starting up. let the service start the listener.
 
Santosh Jagtap
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
If u have database access try this
goto net config and create a service for ure db
if it is already created just check in services whether it is in started (sholud not be starting)state.
or if tht is also fine then check for tnsnames.ora file which is on client machine (since u r using odbc so i assume u have oracle client installed on ure machine)in oracle/network/admin folder check the db entry for ure database name.
and dnt forget to check whether the database is up or not.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic