Singam
Singam

Reputation: 503

Derby JDBC Driver not found when a War is deployed on Payara Micro

I am trying to run the example as per the Link below, step by step:

https://dzone.com/articles/easy-java-ee-microservices-with-payara-micro

The example makes use of Apache Derby DB that I have included in Maven POM and also gets bundled in the WEB-INF/lib folder of the War file.

However, when I try to run the application with command

sudo java -jar payara-micro-5.2020.4.jar --deploy <path to>/SampleService-1.0.war

I get the following error:

javax.resource.ResourceException: The driver could not be loaded: org.apache.derby.jdbc.ClientDriver```

Upvotes: 0

Views: 449

Answers (1)

Onur Başt&#252;rk
Onur Başt&#252;rk

Reputation: 735

  1. It may be a class loading order problem. Check out https://docs.payara.fish/community/docs/5.201/documentation/payara-server/classloading.html
  2. Derby has been removed starting from version 5.201. Check out https://docs.payara.fish/community/docs/5.2020.4/documentation/payara-micro/h2/h2.html Use the exact same versions in your example tutorial or use H2 instead of Derby.
  3. Finally check out "Adding Third-Party JARs to a Micro Instance" https://docs.payara.fish/community/docs/5.201/documentation/payara-micro/adding-jars.html

Upvotes: 1

Related Questions