Erudika / para-dao-sql

A generic SQL DAO plugin for Para (H2, MySQL, MariaDB, ProstgreSQL, MS SQL Server, Oracle, SQLite)
https://paraio.org
Apache License 2.0
5 stars 2 forks source link

Postgres Driver is not working #14

Closed yphanikumar1995 closed 2 years ago

yphanikumar1995 commented 2 years ago

I downloaded the para-dao-sql jar file to inside lib folder and restarted the para container but iam getting below error

2022-08-18 07:06:25 [ERROR] Error loading SQL driver "org.postgresql.Driver", class not found.
2022-08-18 07:06:55 [ERROR] Error loading SQL driver "org.postgresql.Driver", class not found.
2022-08-18 07:07:25 [ERROR] Error loading SQL driver "org.postgresql.Driver", class not found.
2022-08-18 07:07:55 [ERROR] Error loading SQL driver "org.postgresql.Driver", class not found.

I used below setting in para

para.dao = "SqlDAO"
para.sql.driver = "org.postgresql.Driver"
para.sql.url = "postgresql://postgres:5432"
para.sql.user = "postgres"
para.sql.password = "password"

any other configuration required ?

albogdano commented 2 years ago

Do you have the PostgreSQL connector driver JAR file inside ./lib directory? You may have to start Para with this command:

java -jar -Dloader.path=./lib -Dconfig.file=./para-application.conf para.jar
yphanikumar1995 commented 2 years ago

Hi @albogdano , thanks it is worked after i added the postgres jdbc jar into lib folder https://jdbc.postgresql.org/download.html i am using below Dockerfile , it may help for someone

FROM erudikaltd/para:v1.46.1 AS base
FROM erudikaltd/para-dao-sql:1.45.4 AS dao
FROM base AS final
COPY --from=dao /para/lib/*.jar /para/lib
ADD https://jdbc.postgresql.org/download/postgresql-42.4.2.jar /para/lib
RUN chmod -R 755 /para/lib
mljohns89 commented 7 months ago

For me it was:

env:
- name: LOADER_PATH
   value: "lib"
albogdano commented 7 months ago

An ENV variable LOADER_PATH probably won't work. It has to be a system property named loader.path.

mljohns89 commented 7 months ago

I'm building a helm chart and on v1.47.2. I tried everything and setting the LOADER_PATH env variable was the ONLY thing that worked.

On Sat, Mar 30, 2024, 3:56 AM Alex Bogdanovski @.***> wrote:

An ENV variable LOADER_PATH probably won't work. It has to be a system property named loader.path.

— Reply to this email directly, view it on GitHub https://github.com/Erudika/para-dao-sql/issues/14#issuecomment-2027959305, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABO5DKHSKAXERQ2GTQR4M3DY2ZO3LAVCNFSM564YKTG2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMBSG44TKOJTGA2Q . You are receiving this because you commented.Message ID: @.***>

albogdano commented 7 months ago

@mljohns89 Thank you for clarifying that! I was not sure because that property is part of Spring, not Para.