Re: Using Postgres

Benoit TELLIER <[email protected]>
Newsgroups gmane.comp.jakarta.james.user
Message-ID <[email protected]>
Hello Serge,

Sorry for jumping late on the topic to provide you help.

/root/libs is the folder you need to put things in for them to be on the
classpath.

extension-jars is a folder looked up when loading extensions (mailet,
matcher, listeners, webadmin routes etc...) and is not directly on the
classpath...

I did put an example of setting up JPA app with an external DB:
https://github.com/apache/james-project/tree/master/server/apps/jpa-app#using-alternative-jdbc-drivers-with-docker


Best regards,

Benoit TELLIER

On 03/01/2022 20:43, Bs Serge wrote:
> # docker exec -it james_run sh
> # find -name post*
> ./james-server-cli.lib/postgresql-42.3.1.jar
> ./extensions-jars/postgresql-42.3.1.jar
> ./james-server-jpa-guice.lib/postgresql-42.3.1.jar
> ./postgresql-42.3.1.jar
> #
>
> I have included the Postgres jar file in every possible directory but
> still, I get the same error : ClassNotFoundException: org.postgresql.Driver
>
> Regards,
>
>
> On Mon, Jan 3, 2022 at 2:03 PM Bs Serge <[email protected]> wrote:
>
>> Progress update :
>>
>> I added the Postgres jar file in the 'extensions-jars' folder and I can
>> see it being loaded in the classpath in the logs :
>>
>> 11:41:55.472 [34m[INFO ] [0;39m o.a.j.u.ExtendedClassLoader - Loading
>> custom classpath resource /root/./extensions-jars/postgresql-42.3.1.jar
>>
>> but I'm still getting the same error :  java.lang.ClassNotFoundException:
>> org.postgresql.Driver
>>
>> Below is the full logs
>>
>> Full logs:
>> https://paste.0xfc.de/?1df0ef907332046f#56txc688Yicbqgt84VFiaDJ6tvB3joLwoKDmE2wtxkvi
>>
>> Any thoughts or comments would be appreciated!
>>
>> Best regards,
>>
>> On Fri, Dec 31, 2021 at 7:09 PM Bs Serge <[email protected]> wrote:
>>
>>> James 3.6.1 Guice+JPA in a docker container
>>>
>>> Hi all,
>>>
>>> I'm using this database configuration [1] in james-database.properties
>>> file to connect to the Postgres server on the Linux host,
>>>
>>> I also added the Postgres JDBC driver version 42.3.1 jar file [2] in the
>>> `james-server-cli.lib` folder inside the container,
>>>
>>> and when I restart the docker container, it give this error [3]
>>> `ClassNotFoundException: org.postgresql.Driver`
>>>
>>> I'm wondering what I did wrong
>>>
>>> Any thoughts or comments would be appreciated!
>>>
>>> [1]
>>> https://paste.0xfc.de/?d1c74b073c748f1a#88WJMDV1v3yg9Zd15zeXoyr3rM4BaCVZB7N5wxzRt9cY
>>>
>>> [2] https://jdbc.postgresql.org/download.html
>>>
>>> [3]
>>> https://paste.0xfc.de/?bb4c913bb483930a#FcHAonPNN9LQzfzkSFuQHjwTHT92VUdNswByeMjNSHza
>>>
>>> Best regards,
>>>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.