Erudika / para

Multitenant backend server for building web and mobile apps rapidly. The backend for busy developers. (self-hosted or hosted)
https://paraio.org
Apache License 2.0
531 stars 146 forks source link

Newbie: Running Para with postgres driver #222

Closed AvnerCohen closed 1 year ago

AvnerCohen commented 1 year ago

Apologies if this is too basic, I have been trying to find the solution with no success:

Trying to run para (for scoold) on a local host:

2023-06-12 11:45:31 [INFO ] --- Para.initialize() [production] ---
2023-06-12 11:45:31 [INFO ] Loaded new DAO, Search and Cache implementations - SqlDAO, LuceneSearch and CaffeineCache.
2023-06-12 11:45:31 [ERROR] Error loading SQL driver "org.postgresql.Driver", class not found.
2023-06-12 11:45:31 [ERROR] Error loading SQL driver "org.postgresql.Driver", class not found.
2023-06-12 11:45:31 [ERROR] Error loading SQL driver "org.postgresql.Driver", class not found.
2023-06-12 11:45:32 [ERROR] Error loading SQL driver "org.postgresql.Driver", class not found.

para-application.conf

para.root_access_key = "app:para"
para.root_secret_key = "dddddd"
para.dao = "SqlDAO"
para.sql.driver = "org.postgresql.Driver"
para.sql.url = "postgresql://localhost:xxx/scoold_database"
para.sql.user = "xxxx"
para.sql.password = "xxxx"

Command been used to run it:

java -jar -Dconfig.file=./para-application.conf para-jar-1.48.2.jar postgresql-42.6.0.jar para-dao-sql-1.45.10-shaded.jar

Local folder:

$>  ls
para-jar-1.48.2.jar  para.log   scoold para-application.conf  para-dao-sql-1.45.10-shaded.jar  para-metrics.log     postgresql-42.6.0.jar

Happy to provide additional info if what I provided is incomplete.

albogdano commented 1 year ago

You should have a ./lib folder where you can put the JDBC connector driver for PostgreSQL (a JAR file). Without that you won't be able to connect. After you put the JAR file in ./lib, restart Para.

AvnerCohen commented 1 year ago

Thanks. This does seem to solve it for me:

$>ls -l
./
../
data/
lib/
para-application.conf
para-dao-sql-1.45.10-shaded.jar
para-jar-1.48.2.jar
scoold/

And the lib folder:

$> ls -a lib
postgresql-42.6.0.jar

The error when I start Para is still:

2023-06-13 06:31:54 [INFO ] --- Para.initialize() [production] ---
2023-06-13 06:31:54 [INFO ] Loaded new DAO, Search and Cache implementations - SqlDAO, LuceneSearch and CaffeineCache.
2023-06-13 06:31:54 [ERROR] Error loading SQL driver "org.postgresql.Driver", class not found.
2023-06-13 06:31:54 [ERROR] Error loading SQL driver "org.postgresql.Driver", class not found.
2023-06-13 06:31:54 [ERROR] Error loading SQL driver "org.postgresql.Driver", class not found.
2023-06-13 06:31:54 [ERROR] Error loading SQL driver "org.postgresql.Driver", class not found.
albogdano commented 1 year ago

Try starting Para with the loader.path=lib argument:

java -jar -Dconfig.file=./application.conf -Dloader.path=lib  para.jar
AvnerCohen commented 1 year ago

Yep, this was totally it! thanks !

mljohns89 commented 7 months ago

This isn't working for me