0

I'm building a very simple JAX-RS RESTful dynamic web project in eclipse for the purpose of studying.
Using eclipse Oxygen.2 4.7.2, jersey 2.26, Jackson 2.9.0 Apache Tomcat 9.0.4 and Apache Derby 10.14.1.0 Database (for client/server mode).
I've followed multiple tutorials and documentation on the matter.
Converting the project to maven and adding the derby database works.
Leaving the project un-mavenned and adding the derby database relevant jars into the /WebContent/WEB-INF/lib/ directory also works.
However, adding these same jars as a user library in the project's java build path does not work and ends up with the exception mentioned in the title when a call is made to the JDBC driver.

Class.forName("org.apache.derby.jdbc.ClientDriver")

I need help to understand what I'm missing. To reiterate my question: Why does adding the derby jars as build path libraries not work but adding them to lib folder worked? I apologize if this sounds like a silly question but I'm new to the subject. Adding jersey and jackson as libraries in the build path did work. Is derby different or should it work and I did something wrong?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Benjq
  • 143
  • 1
  • 8
  • 1
    Please show the configuration of the deployment assembly (under the project properties) – Mark Rotteveel Feb 11 '18 at 08:41
  • hello Mark Rotteveel, here's what I see in the Web Deployment Assembly for this project: "/src" at "WEB-INF/classes", "WebContent" at "/". Then have a "Jackson" and "Jersey" libs both pointing at "WEB-INF/lib" (probably leftovers from previous trials) – Benjq Feb 11 '18 at 17:16
  • 2
    OK, thank you Mark Rotteveel for your quick attention to my question and also your hint. I have now solved the issue after reading your hint on the deployment assembly and also seeing a similar stackoverflow q&a that popped up on the 'related' panel on the side that I didn't find before https://stackoverflow.com/questions/7005644/classnotfoundexception-when-using-user-libraries-in-eclipse-build-path?rq=1 – Benjq Feb 11 '18 at 17:41

0 Answers0