1 Replies - 1657 Views - Last Post: 09 July 2009 - 02:30 AM

#1 tashe  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 107
  • Joined: 10-March 09

JDBC problem in Java Web Service

Posted 09 July 2009 - 01:00 AM

I am trying to connect my REST web service to a Oracle DB. I have ojdbc14-10.2.0.2. When I run the webapp that uses my service and try to get data from the DB it displays the error. I did connect successfully to the same DB with the same code and driver but from a regular Java desktop app. For the REST service we are using Jersey.

HTTP Status 500 - 

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

type Exception report

[b]message [/b]

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

[b]exception [/b]

javax.servlet.ServletException: java.lang.NoClassDefFoundError: oracle/jdbc/pool/OracleDataSource
	com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:311)
	com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:425)
	com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:590)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


[b]root cause [/b]

com.sun.jersey.api.container.MappableContainerException: java.lang.NoClassDefFoundError: oracle/jdbc/pool/OracleDataSource
	com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:74)
	com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:166)
	com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:74)
	com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:114)
	com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:66)
	com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:658)
	com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:616)
	com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:607)
	com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:309)
	com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:425)
	com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:590)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)




Does anyone have an idea what causes this error? thanks

Is This A Good Question/Topic? 0
  • +

Replies To: JDBC problem in Java Web Service

#2 tashe  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 107
  • Joined: 10-March 09

Re: JDBC problem in Java Web Service

Posted 09 July 2009 - 02:30 AM

I had imported the jdbc driver, but that was not enough. I had to copy it to the common/lib folder in the Apache Tomcat installation directory to resolve the problem.
/solved
Was This Post Helpful? 1

Page 1 of 1