permaculture playing cards*
The moose likes Servlets and the fly likes error in servlet with oracle Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "error in servlet with oracle" Watch "error in servlet with oracle" New topic
Author

error in servlet with oracle

mohamed mustaq
Greenhorn

Joined: Dec 19, 2005
Posts: 21
hi ,
when i try to connect database in servlet pgming i got this error.
i am using eclipse with jboss server.
if anyone knows please let me know.

the error which i got in browser is
type Exception report

message

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

exception

javax.servlet.ServletException: Servlet.init() for servlet CPlanSer1 threw exception
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:72)
org.jboss.web.tomcat.security.JBossSecurityMgrRealm.invoke(JBossSecurityMgrRealm.java:275)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
java.lang.Thread.run(Thread.java:595)


root cause

java.lang.NoClassDefFoundError: oracle/jdbc/driver/OracleDriver
cplan.CPlanSer1.init(CPlanSer1.java:51)
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:72)
org.jboss.web.tomcat.security.JBossSecurityMgrRealm.invoke(JBossSecurityMgrRealm.java:275)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
java.lang.Thread.run(Thread.java:595)


note The full stack trace of the root cause is available in the Apache Tomcat/5.0.26 logs.


--------------------------------------------------------------------------------
Paul Bourdeaux
Ranch Hand

Joined: May 24, 2004
Posts: 783
java.lang.NoClassDefFoundError: oracle/jdbc/driver/OracleDriver

Looks to me like your servlet is not finding the needed driver for the database connection. Are you sure the correct jar is in yyour library directory? Are you using database connection pooling? If you could post the code from your servlet I could try and help more.

On a side note, the "javax.servlet.ServletException: Servlet.init() for servlet CPlanSer1 threw exception" line worries me. Are you establishing a database connection in the init method of your servlet? This in itself has some inherent problems with design. We can discuss those after we figure out what is wrong with the connection.


“Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.” - Rich Cook
Clarke Kent
Greenhorn

Joined: Dec 19, 2005
Posts: 14
check if you included the oracle jdbc jar files in your war file.
mohamed mustaq
Greenhorn

Joined: Dec 19, 2005
Posts: 21
thanks yar,
i solved the problem by adding class111.jar into jboss/server/lib/class111.jar
it works fine.
thank you
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: error in servlet with oracle
 
Similar Threads
My First WebApplication Exception
The server encountered an internal error () that prevented it from fulfilling this re
Error allocating a servlet instance
tomcat error 500- when executing loginservlet example
Name based virtual hosts