Benoit,

No success yet.  I started over completely clean:

-- Refreshed latest master from git, rebuilt clean and re-deployed to my server.
-- Created keystore using password in sample-configuration files.
-- Out of the box, it started clean.
-- I renamed james-database.properties to *.save and renamed james.database.mariadb.properties to james.database.properties
-- I downloaded a new mariadb-java-client-2.0.2.jar from the mariadb site.
-- I first put it in extensions-jars folder.  Failed
-- I moved it to james-server-jpa.app.lib Failed.

I actually need mysql, not maria.  I didn't try the test again with mysql this time.  But if mariadb doesn't work. I'm going to assume that mysql still will not work.

Earlier in the day when I couldn't think of anything else to try, I went back to derby just to get past this problem temporarily, and I brought in all of my own customized conf xml files and added all of the associated jar files to extensions-jars just to see if JAMES could find other extension jar files.  I got a bunch of Guice @inject errors on my mailet implementations, which is a question for another day.  But the fact that it reported Guice errors means it found my custom mailet jar files without any problem.

I also double-checked my java version, and I'm running 11.

As I mentioned earlier, I copied the mysql jar from my running production server (probably 10-12 month old production JAMES 3.0.x, but not having any problems.)

My next step is to install a parallel spring server from the same build on this same server using the same mariadb / mysql drivers and see if the problem moves to spring install or not.  Not sure what I'll do either way to resolve the guice problem.  But more information is good.

I am also totally comfortable with adding log or println statements anywhere in the james code if you tell me what to log.

Thanks again for your help.

Jerry


On 10/4/2021 3:11 AM, btell...@apache.org wrote:
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


---------------------------------------------------------------------
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