User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JSP section within the Web Development category of DaniWeb, a massive community of 402,509 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,790 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JSP advertiser: Lunarpages JSP Web Hosting
Views: 1348 | Replies: 11
Reply
Join Date: Jan 2008
Posts: 6
Reputation: vincenzom86 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
vincenzom86 vincenzom86 is offline Offline
Newbie Poster

Help Problem with JDBC driver config

  #1  
Jan 16th, 2008
Hi all this is my problem:


description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: Exception in JSP: /DAO.jsp:16

13:
14: Class.forName("oracle.jdbc.driver.OracleDriver");
15:
16: conn = DriverManager.getConnection("jdbc:oracle:thin:vincenzom86@localhost:1521E","xxx","xxx");
17:
18: Statement st = conn.createStatement();
19:


Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:451)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:355)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

root cause

javax.servlet.ServletException: No suitable driver found for jdbc:oracle:thin:vincenzom86@localhost:1521E


I use Oracle 10g and Tomcat for web server...i try all config for my connect driver but i'v always the same exception.
Thanks for the warning

Vincenzo
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Feb 2006
Posts: 1,378
Reputation: masijade is a jewel in the rough masijade is a jewel in the rough masijade is a jewel in the rough masijade is a jewel in the rough 
Rep Power: 8
Solved Threads: 120
masijade's Avatar
masijade masijade is offline Offline
Nearly a Posting Virtuoso

Re: Problem with JDBC driver config

  #2  
Jan 16th, 2008
Place the Oracle Driver jar into tomcats common/lib directory.
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote  
Join Date: Jan 2008
Posts: 6
Reputation: vincenzom86 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
vincenzom86 vincenzom86 is offline Offline
Newbie Poster

Re: Problem with JDBC driver config

  #3  
Jan 16th, 2008
thanks for the answer...i ve do it but always the same problem...i'm trying to download another driver.there' s some configuration for 1 xml file to do?because i've read something about server.xml file configuration.
Reply With Quote  
Join Date: Feb 2006
Posts: 1,378
Reputation: masijade is a jewel in the rough masijade is a jewel in the rough masijade is a jewel in the rough masijade is a jewel in the rough 
Rep Power: 8
Solved Threads: 120
masijade's Avatar
masijade masijade is offline Offline
Nearly a Posting Virtuoso

Re: Problem with JDBC driver config

  #4  
Jan 16th, 2008
Make sure it is actually the thin driver that you have, and not the oci driver. My first response was incorrect, ClassNotFound is classpath, no suitable driver is a misspelled url, or you have the oci driver installed rather than the thin driver.

Also, I don't believe you want username@hostname, but rather just hostname. i.e.
jdbc:oracle:thin://locahost:1521:dbName

Read the documentation for the driver you do have for the proper url.
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote  
Join Date: Jan 2008
Posts: 6
Reputation: vincenzom86 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
vincenzom86 vincenzom86 is offline Offline
Newbie Poster

Re: Problem with JDBC driver config

  #5  
Jan 17th, 2008
masijade thanks for the attention.i've try to change the driver conn with:

jdbc:oracle:thin://PC280631275888:1521E","xxx","xxx"

but now i've this error:

14: Class.forName("oracle.jdbc.driver.OracleDriver");
15:
16: conn = DriverManager.getConnection("jdbc:oracle:thin://PC280631275888:1521E","vincenzom86","m0lf3tt4");
17:
18: Statement st = conn.createStatement();
19:


Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:451)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:355)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

root cause

javax.servlet.ServletException: Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
The Connection descriptor used by the client was:
localhost:1521:orcl


i've see the listner.ora file and this is my config:

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = XE)
(ORACLE_HOME = C:\oraclexe\app\oracle\product\10.2.0\server)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = XE)
(ORACLE_HOME = C:\oraclexe\app\oracle\product\10.2.0\server)
(PROGRAM = extproc)
)
)

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
(ADDRESS = (PROTOCOL = TCP)(HOST = PC280631275888)(PORT = 1521))
)
)

DEFAULT_SERVICE_LISTENER = (XE)


i've also try to reboot server and db but always the same...
Reply With Quote  
Join Date: Feb 2006
Posts: 1,378
Reputation: masijade is a jewel in the rough masijade is a jewel in the rough masijade is a jewel in the rough masijade is a jewel in the rough 
Rep Power: 8
Solved Threads: 120
masijade's Avatar
masijade masijade is offline Offline
Nearly a Posting Virtuoso

Re: Problem with JDBC driver config

  #6  
Jan 17th, 2008
Is this the url you're using
jdbc:oracle:thin://PC280631275888:1521:XE

Since you're not using code tags, I can't tell because you keep getting a "smilely" I don't recognise.

Seemingly, though, according to the error message
The Connection descriptor used by the client was:
localhost:1521:orcl
you are using:
jdbc:oracle:thin://localhost:1521:orcl
Maybe in another place in the code, or something?
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote  
Join Date: Jan 2008
Posts: 6
Reputation: vincenzom86 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
vincenzom86 vincenzom86 is offline Offline
Newbie Poster

Re: Problem with JDBC driver config

  #7  
Jan 17th, 2008
no...i'use only this string :

E"" alt="conn = DriverManager.getConnection("jdbc:oracle:thin://PC280631275888:1521E"" border="0" />.

scuse me for the emoticons but i'dont know how to format the text..but is XE
i've read that seems to use orcl and not XE but i don't know where...!!!in the tnsnames.ora and listener.ora SID name are all = XE!!!
Reply With Quote  
Join Date: Jan 2008
Posts: 6
Reputation: vincenzom86 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
vincenzom86 vincenzom86 is offline Offline
Newbie Poster

Re: Problem with JDBC driver config

  #8  
Jan 17th, 2008
conn string here :

conn = DriverManager.getConnection("jdbc:oracle:thin://PC280631275888:1521E"


sorry again
Reply With Quote  
Join Date: Feb 2006
Posts: 1,378
Reputation: masijade is a jewel in the rough masijade is a jewel in the rough masijade is a jewel in the rough masijade is a jewel in the rough 
Rep Power: 8
Solved Threads: 120
masijade's Avatar
masijade masijade is offline Offline
Nearly a Posting Virtuoso

Re: Problem with JDBC driver config

  #9  
Jan 17th, 2008
Surround your code (and the conn line from above) with code tags. i.e.

[code]SID[/code]

will appear as

Last edited by masijade : Jan 17th, 2008 at 4:41 am.
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote  
Join Date: Feb 2006
Posts: 1,378
Reputation: masijade is a jewel in the rough masijade is a jewel in the rough masijade is a jewel in the rough masijade is a jewel in the rough 
Rep Power: 8
Solved Threads: 120
masijade's Avatar
masijade masijade is offline Offline
Nearly a Posting Virtuoso

Re: Problem with JDBC driver config

  #10  
Jan 17th, 2008
Originally Posted by vincenzom86 View Post
no...i'use only this string :

E"" alt="conn = DriverManager.getConnection("jdbc:oracle:thin://PC280631275888:1521E"" border="0" />.

scuse me for the emoticons but i'dont know how to format the text..but is XE
i've read that seems to use orcl and not XE but i don't know where...!!!in the tnsnames.ora and listener.ora SID name are all = XE!!!


Then, I can only say that you need to get the Oracle admins to check it out.
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb JSP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the JSP Forum

All times are GMT -4. The time now is 6:00 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC