Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Database access in Servlet(Getting error trying to query derby database from web app)
Database access in Servlet [message #662244] Tue, 29 March 2011 16:29 Go to next message
No real name is currently offline No real name
Messages: 3
Registered: March 2011
Junior Member
Hello, and thank you ahead of time for any help.

My Eclipse configuration is Eclipse (Helios) Java EE IDE for Web Developers, and Tomcat 7. I have a dynamic web project with 1 html file, and 1 Servlet. In the servlet, when I try to access the Derby database I get a java.lang.ClassNotFoundException error.

When I create a regular Java application I do not have any problems accessing Derby, everything works fine. I only seem to have this issue in a Dynamic Web Project.

I have commented out all database code, and verified that it runs fine without the database code, so I ruled out the thought that it could be related to the Web Server.

This is a very simple web application and database, I'm just trying to get something simple to work, so I dont have any funky configurations going on.

The error seems to be caused by the following line of code:
Class.forName("org.apache.derby.jdbc.ClientDriver");

I definitely added the Derby nature to the project, the Derby server is started, and the Derby libraries are under "Java Resources: src > Libraries > Derby Libraries".

The exact error I get is below. I've tried searching the web, and tried different things, but haven't had any luck. Thanks for any help/guidance you can provide.

java.lang.ClassNotFoundException: org.apache.derby.jdbc.ClientDriver
at org.apache.catalina.loader.WebappClassLoader.loadClass(Webap pClassLoader.java:1676)
at org.apache.catalina.loader.WebappClassLoader.loadClass(Webap pClassLoader.java:1521)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at ClientSearchServlet.doGet(ClientSearchServlet.java:76)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFi lter(ApplicationFilterChain.java:304)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(App licationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(Standar dWrapperValve.java:240)
at org.apache.catalina.core.StandardContextValve.invoke(Standar dContextValve.java:164)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(A uthenticatorBase.java:498)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHo stValve.java:164)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorRepo rtValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogVa lve.java:562)
at org.apache.catalina.core.StandardEngineValve.invoke(Standard EngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAd apter.java:394)
at org.apache.coyote.http11.Http11Processor.process(Http11Proce ssor.java:243)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHand ler.process(Http11Protocol.java:188)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHand ler.process(Http11Protocol.java:166)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(J IoEndpoint.java:302)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unkno wn Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
java.lang.ClassNotFoundException: org.apache.derby.jdbc.ClientDriver
at org.apache.catalina.loader.WebappClassLoader.loadClass(Webap pClassLoader.java:1676)
at org.apache.catalina.loader.WebappClassLoader.loadClass(Webap pClassLoader.java:1521)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at ClientSearchServlet.doGet(ClientSearchServlet.java:76)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFi lter(ApplicationFilterChain.java:304)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(App licationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(Standar dWrapperValve.java:240)
at org.apache.catalina.core.StandardContextValve.invoke(Standar dContextValve.java:164)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(A uthenticatorBase.java:498)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHo stValve.java:164)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorRepo rtValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogVa lve.java:562)
at org.apache.catalina.core.StandardEngineValve.invoke(Standard EngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAd apter.java:394)
at org.apache.coyote.http11.Http11Processor.process(Http11Proce ssor.java:243)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHand ler.process(Http11Protocol.java:188)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHand ler.process(Http11Protocol.java:166)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(J IoEndpoint.java:302)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unkno wn Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Re: Database access in Servlet [message #662274 is a reply to message #662244] Tue, 29 March 2011 22:37 Go to previous message
No real name is currently offline No real name
Messages: 3
Registered: March 2011
Junior Member
My apologies, I just realized I posted this question in the wrong forum.
Previous Topic:[HELP]Problems when rendering in HTML through JavaBridge
Next Topic:Speed issues & profiling
Goto Forum:
  


Current Time: Sat Jul 26 13:32:15 EDT 2014

Powered by FUDForum. Page generated in 0.06159 seconds