Hello,

Extra driver needs to be explicitly added to the classpath.

java -Djdk.tls.ephemeralDHKeySize=2048 \
     -classpath 'james-server-jpa-app.lib/*:/path/to/driver.jar' \
     -javaagent:/root/libs/openjpa-3.1.2.jar \
     -Dlogback.configurationFile=/root/conf/logback.xml \
      -Dworking.directory=/root/ org.apache.james.JPAJamesServerMain

Note that I did add extra instructions on the 3.7.0 release line.

 -
https://github.com/apache/james-project/tree/master/server/apps/jpa-app#using-alternative-jdbc-drivers

 -
https://github.com/apache/james-project/blob/master/server/apps/jpa-app/docker-compose.yml

Best regards,

Benoit

On 04/10/2021 11:06, Jerry Malcolm wrote:
> I have a different issue in my migration from spring to jpa-guice.  I
> absolutely cannot get james/java to locate my jdbc driver.  I copied a
> working driver from my spring server and the associated
> james-database.properties to my jpa-guice server.  I played around
> with classpaths and ended up putting the mysql jar directly in the
> james-server-jpa-app.lib folder.  But no matter what I do,  I always get:
>
> Caused by: java.lang.ClassNotFoundException: org.mysql.jdbc.Driver
>         at
> java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
>         at
> java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
>
> I'm using mysql, not maria.  But just in desperation, I downloaded the
> mariadb driver and put it in the lib folder as well.  I changed the
> properties file to call out the mariadb driver.  Got the same error. 
> It can't find mariadb driver either.  I changed it back to derby, and
> it worked.
>
> So I've got mysql (that is working fine in my production server),
> mariadb, and derby drivers side by side in the same lib folder. Java
> finds 1 and can't find the other two.
>
> I have a pretty good handle on how jar files, classpaths, loaders
> work.  This one totally baffles me.  Is there something I need to
> change for the jpa-guice build or some place specific that I need to
> put the driver jar?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
> For additional commands, e-mail: server-dev-h...@james.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org

Reply via email to