Have you tried puttil the driver JAR in james-server-jpa-app.lib, maybe?

On 04/10/2021 12:02, Jerry Malcolm wrote:
>
> On 10/3/2021 11:36 PM, Jerry Malcolm wrote:
>>
>> On 10/3/2021 11:14 PM, btell...@apache.org wrote:
>>> 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.
>>
>> Benoit,
>>
>> Thanks, I'll try that.  I did a git clone about a month ago.  So I
>> missed that in the release notes.  I'm just sandboxing now. Once I
>> think I've got everything working, I'll pull again from the master
>> for my production build.
>>
> Benoit,
>
> No success using the classpath parameter.  Here's what I have for the
> full start up line:
>
> exec java \
>  -javaagent:james-server-jpa-app.lib/openjpa-3.1.2.jar \
>  -classpath
> 'james-server-jpa-app.lib/*:/usr/share/james/conf/lib/external/mysql-connector-java-8.0.26.jar'
> \
>  -Dworking.directory=. \
>  -Djdk.tls.ephemeralDHKeySize=2048 \
>  -Dlogback.configurationFile=conf/logback.xml \
>  -Xms128m \
>  -Xmx512m \
>  -Dcom.sun.management.jmxremote=true \
>  -Dcom.sun.management.jmxremote.authenticate=false \
>  -jar james-server-jpa-app.jar \
>
> I checked that the jar file specified does exist in conf/lib/eternal.
>
> I tried using the relative path: conf/lib/external/....jar as well as
> the fully qualified path as specified in the command line above.  I'm
> still getting ClassNotFound exceptions on the mySQL class.
>
>>
>>>
>>>   -
>>> 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
>>>
>>
>
> ---------------------------------------------------------------------
> 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