View previous topic :: View next topic |
Author |
Message |
y351 Apprentice
Joined: 21 May 2017 Posts: 200
|
Posted: Thu Jan 11, 2018 10:19 am Post subject: [Davmail] - Erreur Java |
|
|
Bonjour,
Je désire utiliser Exchange avec Davmail.
J'ai installé à partir d'un Overlay :
Quote: |
[I] net-mail/davmail-bin [1]
Available versions: ~*3.9.8 ~*3.9.9 ~*4.3.3 ~*4.4.0 ~*4.4.1 ~4.5.0 ~4.5.1 ~4.6.0 ~4.6.1 4.6.2 4.7.0 4.7.1 4.7.2 4.7.3 4.8.0{tbz2} {doc}
Installed versions: 4.8.0{tbz2}(11:54:11 02/01/2018)(-doc)
Homepage: http://davmail.sourceforge.net/
Description: DavMail POP/IMAP/SMTP/Caldav/Carddav/LDAP Exchange Gateway
[1] "srcshelton" /var/lib/layman/srcshelton
|
Voici le contenu du package :
Quote: |
* Searching for davmail-bin ...
* Contents of net-mail/davmail-bin-4.8.0:
/etc
/etc/conf.d
/etc/conf.d/davmail
/etc/env.d
/etc/env.d/90davmail
/etc/init.d
/etc/init.d/davmail
/opt
/opt/davmail-4.8.0
/opt/davmail-4.8.0/bin
/opt/davmail-4.8.0/bin/davmail.jar
/opt/davmail-4.8.0/conf
/opt/davmail-4.8.0/conf/davmail.properties
/opt/davmail-4.8.0/lib
/opt/davmail-4.8.0/lib/activation-1.1.1.jar
/opt/davmail-4.8.0/lib/commons-codec-1.3.jar
/opt/davmail-4.8.0/lib/commons-collections-3.1.jar
/opt/davmail-4.8.0/lib/commons-httpclient-3.1.jar
/opt/davmail-4.8.0/lib/commons-logging-1.0.4.jar
/opt/davmail-4.8.0/lib/htmlcleaner-2.2.jar
/opt/davmail-4.8.0/lib/jackrabbit-webdav-2.4.3.jar
/opt/davmail-4.8.0/lib/jcharset-1.3.jar
/opt/davmail-4.8.0/lib/jcifs-1.3.14.jar
/opt/davmail-4.8.0/lib/jdom-1.0.jar
/opt/davmail-4.8.0/lib/log4j-1.2.16.jar
/opt/davmail-4.8.0/lib/mail-1.4.3.jar
/opt/davmail-4.8.0/lib/slf4j-api-1.3.1.jar
/opt/davmail-4.8.0/lib/slf4j-log4j12-1.3.1.jar
/opt/davmail-4.8.0/lib/stax-api-1.0.1.jar
/opt/davmail-4.8.0/lib/stax2-api-3.1.1.jar
/opt/davmail-4.8.0/lib/woodstox-core-asl-4.1.2.jar
/opt/davmail-4.8.0/lib/xercesImpl-2.8.1.jar
/var
/var/log
/var/log/davmail
|
1) J'utilise Systemd mais le service n'existe pas : il faudrait en créer un.
2) J'essaie donc de le lancer en CLI :
Code: |
java -cp /opt/davmail-4.8.0/lib -jar /opt/davmail-4.8.0/bin/davmail.jar
|
Voici le résultat obtenu :
Quote: |
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/httpclient/HttpMethod
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
at java.lang.Class.getMethod0(Class.java:3018)
at java.lang.Class.getMethod(Class.java:1784)
at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.httpclient.HttpMethod
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 7 more
|
Quote: |
Available Java Virtual Machines:
[1] icedtea-bin-8 system-vm
|
Qu'en pensez-vous ?
Merci d'avance pour vos retours. |
|
Back to top |
|
|
xaviermiller Bodhisattva
Joined: 23 Jul 2004 Posts: 8723 Location: ~Brussels - Belgique
|
Posted: Thu Jan 11, 2018 10:24 am Post subject: |
|
|
Hello,
L'exécution se plaint qu'elle ne trouve pas le composant http d'Apache.
As-tu installé dev-java/commons-httpclient ?
Si cela fonctionne une fois installé, contacte le mainteneur de l'ebuild pour qu'il ajoute cette dépendance manquante. _________________ Kind regards,
Xavier Miller |
|
Back to top |
|
|
y351 Apprentice
Joined: 21 May 2017 Posts: 200
|
Posted: Thu Jan 11, 2018 10:50 am Post subject: |
|
|
Salut,
Après l'avoir installé, j'ai le même erreur :
Quote: |
[I] dev-java/commons-httpclient
Available versions: (3) 3.1-r1^t{tbz2}
{doc examples source test ELIBC="FreeBSD"}
Installed versions: 3.1-r1(3)^t{tbz2}(11:40:00 01/11/1(-doc -examples -source -test ELIBC="-FreeBSD")
Homepage: http://hc.apache.org/
Description: The Jakarta Commons HttpClient library
|
Code: |
java -cp /opt/davmail-4.8.0/lib -jar /opt/davmail-4.8.0/bin/davmail.jar |
Quote: |
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/httpclient/HttpMethod
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
at java.lang.Class.getMethod0(Class.java:3018)
at java.lang.Class.getMethod(Class.java:1784)
at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.httpclient.HttpMethod
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 7 more
|
Quote: |
* Searching for commons-httpclient in dev-java ...
* Contents of dev-java/commons-httpclient-3.1-r1:
/usr
/usr/share
/usr/share/commons-httpclient-3
/usr/share/commons-httpclient-3/lib
/usr/share/commons-httpclient-3/lib/commons-httpclient.jar
/usr/share/commons-httpclient-3/package.env
|
Code: |
java -cp "/opt/davmail-4.8.0/lib,/usr/share/commons-httpclient-3/lib" -jar /opt/davmail-4.8.0/bin/davmail.jar
|
Quote: |
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/httpclient/HttpMethod
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
at java.lang.Class.getMethod0(Class.java:3018)
at java.lang.Class.getMethod(Class.java:1784)
at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.httpclient.HttpMethod
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 7 more |
|
|
Back to top |
|
|
fedeliallalinea Administrator
Joined: 08 Mar 2003 Posts: 31387 Location: here
|
Posted: Thu Jan 11, 2018 11:30 am Post subject: |
|
|
Toutes les dépendances sont incluses dans le paquet.
Ce script exécute davmail (j'espère )
Code: | #!/bin/sh
DIR="/opt/davmail-4.8.0/"
for JAR in $( find "${DIR}"/lib/ -type f -name \*.jar ); do
CLASSPATH="${CLASSPATH}:${JAR}"
done
java -cp "${DIR}"/bin/davmail.jar${CLASSPATH} davmail.DavGateway "${DIR}"/conf/davmail.properties |
_________________ Questions are guaranteed in life; Answers aren't. |
|
Back to top |
|
|
y351 Apprentice
Joined: 21 May 2017 Posts: 200
|
Posted: Thu Jan 11, 2018 1:58 pm Post subject: |
|
|
J'étais en train de regarder la conf du /etc/init.d/davmail...
En effet, ça lance mieux.
Mais erreur :
Quote: |
2018-01-11 12:59:11,848 WARN [ImapConnection-55286] org.apache.commons.httpclient.HttpMethodBase - Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended.
2018-01-11 12:59:12,216 ERROR [ImapConnection-55286] davmail.exchange.ExchangeSession - Authentication failed: invalid user or password, retry with domain\user or use default domain setting
2018-01-11 12:59:12,216 ERROR [ImapConnection-55286] davmail - Authentication failed: invalid user or password, retry with domain\user or use default domain setting
davmail.exception.DavMailAuthenticationException: Authentication failed: invalid user or password, retry with domain\user or use default domain setting
at davmail.exchange.ExchangeSession.throwAuthenticationFailed(ExchangeSession.java:752)
at davmail.exchange.ExchangeSession.postLogonMethod(ExchangeSession.java:583)
at davmail.exchange.ExchangeSession.formLogin(ExchangeSession.java:653)
at davmail.exchange.ExchangeSession.<init>(ExchangeSession.java:240)
at davmail.exchange.dav.DavExchangeSession.<init>(DavExchangeSession.java:500)
at davmail.exchange.ExchangeSessionFactory.getInstance(ExchangeSessionFactory.java:147)
at davmail.exchange.ExchangeSessionFactory.getInstance(ExchangeSessionFactory.java:90)
at davmail.imap.ImapConnection.run(ImapConnection.java:112)
|
Et ce n'est pas le mot de passe
Je vais tester plusieurs comptes : LDAP(AD), compte mail |
|
Back to top |
|
|
y351 Apprentice
Joined: 21 May 2017 Posts: 200
|
Posted: Thu Jan 11, 2018 2:01 pm Post subject: |
|
|
Quote: |
davmail.server=true
davmail.enableEws=auto
davmail.url=https://toto.example.org
davmail.popPort=1110
davmail.imapPort=1143
davmail.smtpPort=1025
davmail.caldavPort=1080
davmail.ldapPort=1389
davmail.proxyUser=
davmail.proxyHost=
davmail.proxyPort=
davmail.proxyPassword=
davmail.enableProxy=false
davmail.useSystemProxies=false
davmail.noProxyFor=
davmail.allowRemote=true
davmail.bindAddress=
davmail.clientSoTimeout=
davmail.ssl.keystoreType=JKS
davmail.ssl.keystoreFile=
davmail.ssl.keystorePass=
davmail.ssl.keyPass=
davmail.server.certificate.hash=
davmail.ssl.nosecurecaldav=false
davmail.ssl.nosecureimap=false
davmail.ssl.nosecureldap=false
davmail.ssl.nosecurepop=false
davmail.ssl.nosecuresmtp=false
davmail.disableUpdateCheck=true
davmail.enableKeepalive=false
davmail.folderSizeLimit=0
davmail.defaultDomain=
davmail.caldavPastDelay=90
davmail.forceActiveSyncUpdate=false
davmail.imapAutoExpunge=true
davmail.imapIdleDelay=
davmail.imapAlwaysApproxMsgSize=
davmail.keepDelay=30
davmail.sentKeepDelay=90
davmail.popMarkReadOnRetr=false
davmail.smtpSaveInSent=true
davmail.logFilePath=/var/log/davmail.log
davmail.logFileSize=1MB
log4j.logger.davmail=WARN
log4j.logger.httpclient.wire=WARN
log4j.logger.org.apache.commons.httpclient=WARN
log4j.rootLogger=WARN
|
|
|
Back to top |
|
|
El_Goretto Moderator
Joined: 29 May 2004 Posts: 3174 Location: Paris
|
Posted: Thu Jan 11, 2018 7:32 pm Post subject: |
|
|
y351 wrote: | J'étais en train de regarder la conf du /etc/init.d/davmail...
En effet, ça lance mieux.
Mais erreur :
Quote: |
2018-01-11 12:59:11,848 WARN [ImapConnection-55286] org.apache.commons.httpclient.HttpMethodBase - Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended.
2018-01-11 12:59:12,216 ERROR [ImapConnection-55286] davmail.exchange.ExchangeSession - Authentication failed: invalid user or password, retry with domain\user or use default domain setting
2018-01-11 12:59:12,216 ERROR [ImapConnection-55286] davmail - Authentication failed: invalid user or password, retry with domain\user or use default domain setting
davmail.exception.DavMailAuthenticationException: Authentication failed: invalid user or password, retry with domain\user or use default domain setting
at davmail.exchange.ExchangeSession.throwAuthenticationFailed(ExchangeSession.java:752)
at davmail.exchange.ExchangeSession.postLogonMethod(ExchangeSession.java:583)
at davmail.exchange.ExchangeSession.formLogin(ExchangeSession.java:653)
at davmail.exchange.ExchangeSession.<init>(ExchangeSession.java:240)
at davmail.exchange.dav.DavExchangeSession.<init>(DavExchangeSession.java:500)
at davmail.exchange.ExchangeSessionFactory.getInstance(ExchangeSessionFactory.java:147)
at davmail.exchange.ExchangeSessionFactory.getInstance(ExchangeSessionFactory.java:90)
at davmail.imap.ImapConnection.run(ImapConnection.java:112)
|
Et ce n'est pas le mot de passe
Je vais tester plusieurs comptes : LDAP(AD), compte mail |
Hohé l'autre comment il y va, il traite le log de menteur
Bon, j'ai repéré un gros mot dans le post de départ (Exchange, beurk), et je vois "IMAP" et "Authentication Failed". Est-ce que l'accès IMAP que tu tentes est bien activé sur le bousin côté serveur?
PS: je me permets d'être désagréable vis à vis du produit parce que typiquement dans ma boîte l'accès IMAP est désactivé sur cette cochonnerie d'Office365. Et v'là l'accès moisi en POP3 pour la messagerie et l'impossibilité d'accéder au calendrier depuis des outils standards... _________________ -TrueNAS & jails: µ-serv Gen8 E3-1260L, 16Go ECC + µ-serv N40L, 10Go ECC
-Réseau: APU2C4 (OpenWRT) + GS726Tv3 + 2x GS108Tv2 + Archer C5v1 (OpenWRT) |
|
Back to top |
|
|
y351 Apprentice
Joined: 21 May 2017 Posts: 200
|
Posted: Fri Jan 12, 2018 5:19 pm Post subject: |
|
|
Il n'y a pas de problème de mot de passe. |
|
Back to top |
|
|
|