java.lang.NoClassDefFoundError: javax/security/sasl/SaslException

Atlassian JIRA | Pedro Cora [Atlassian] | 2 years ago
tip
Do you find the tips below useful? Click on the to mark them and say thanks to Rafael Fischer Viola , poroszd and rafael . Or join the community to write better ones.
  1. 0

    JIRA errors out when you are trying to add a mail server that only has {{CRAM-MD5}} and {{DIGEST-MD5}} as login methods: {noformat} DEBUG: JavaMail version 1.4.5 DEBUG: successfully loaded resource: /META-INF/javamail.default.providers DEBUG: Tables of loaded providers DEBUG: Providers Listed By Class Name: {com.sun.mail.smtp.SMTPSSLTransport=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], com.sun.mail.smtp.SMTPTransport=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc], com.sun.mail.imap.IMAPSSLStore=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3SSLStore=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc], com.sun.mail.imap.IMAPStore=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3Store=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc]} DEBUG: Providers Listed By Protocol: {imaps=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], imap=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], smtps=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], pop3=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc], pop3s=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc], smtp=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]} DEBUG: successfully loaded resource: /META-INF/javamail.default.address.map DEBUG: getProvider() returning javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc] DEBUG: mail.imap.fetchsize: 16384 DEBUG: mail.imap.statuscachetimeout: 1000 DEBUG: mail.imap.appendbuffersize: -1 DEBUG: mail.imap.minidletime: 10 DEBUG: disable AUTH=PLAIN DEBUG: trying to connect to host "imap.someniceandsecurehost.com", port 993, isSSL true * OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE LOGINDISABLED XAPPLEPUSHSERVICE AUTH=CRAM-MD5 AUTH=DIGEST-MD5 AUTH=GSSAPI] Dovecot ready. DEBUG IMAP: AUTH: CRAM-MD5 DEBUG IMAP: AUTH: DIGEST-MD5 DEBUG IMAP: AUTH: GSSAPI DEBUG: protocolConnect login, host=imap.someniceandsecurehost.com, user=username, password=<non-null> 2014-09-19 15:29:34,940 http-bio-8080-exec-14 ERROR user 929x97x1 asd1fb 192.168.3.234 /rest/servicedesk/1/servicedesk/SI/incomingemail/validateemailforcreation [servicedesk.squalor.email.MailServerVerifier] Unable to connect to the server at intranet.druide.com due to the following exception: Unfortunately JIRA Service Desk couldn't connect to the mail server. Here is what the mail server said: "No login methods supported!" {noformat} After some troubleshooting, I've found that since JavaMail fully supports SASL, it should have support for the two login methods mentioned. And adding: {{ -Dmail.imap.sasl.mechanisms=CRAM-MD5 -Dmail.imap.sasl.enable=true}} we are able to create a normal JIRA Incoming Mail account and configure a e-mail handler. However if you try to create the E-mail Service on Service Desk, you are unable to get past the first screen when configuring the mail server settings and the following exception is added to the logs: {noformat} 2014-10-08 16:45:50,785 http-bio-8080-exec-11 ERROR username 1005x101x1 1asx2asy 192.158.4.123 /rest/servicedesk/1/servicedesk/SI/incomingemail/validateemailforcreation [common.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service: javax/security/sasl/SaslException java.lang.NoClassDefFoundError: javax/security/sasl/SaslException at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at com.sun.mail.imap.protocol.IMAPProtocol.sasllogin(IMAPProtocol.java:701) at com.sun.mail.imap.IMAPStore.login(IMAPStore.java:716) at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:648) at javax.mail.Service.connect(Service.java:295) at com.atlassian.servicedesk.squalor.email.MailServerVerifier.verifyMailServer(MailServerVerifier.java:38) ... Caused by: java.lang.ClassNotFoundException: javax.security.sasl.SaslException at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:772) at org.apache.felix.framework.ModuleImpl.access$200(ModuleImpl.java:73) at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1690) at java.lang.ClassLoader.loadClass(Unknown Source) {noformat}

    Atlassian JIRA | 2 years ago | Pedro Cora [Atlassian]
    java.lang.NoClassDefFoundError: javax/security/sasl/SaslException
  2. 0

    JIRA errors out when you are trying to add a mail server that only has {{CRAM-MD5}} and {{DIGEST-MD5}} as login methods: {noformat} DEBUG: JavaMail version 1.4.5 DEBUG: successfully loaded resource: /META-INF/javamail.default.providers DEBUG: Tables of loaded providers DEBUG: Providers Listed By Class Name: {com.sun.mail.smtp.SMTPSSLTransport=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], com.sun.mail.smtp.SMTPTransport=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc], com.sun.mail.imap.IMAPSSLStore=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3SSLStore=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc], com.sun.mail.imap.IMAPStore=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3Store=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc]} DEBUG: Providers Listed By Protocol: {imaps=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], imap=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], smtps=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], pop3=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc], pop3s=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc], smtp=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]} DEBUG: successfully loaded resource: /META-INF/javamail.default.address.map DEBUG: getProvider() returning javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc] DEBUG: mail.imap.fetchsize: 16384 DEBUG: mail.imap.statuscachetimeout: 1000 DEBUG: mail.imap.appendbuffersize: -1 DEBUG: mail.imap.minidletime: 10 DEBUG: disable AUTH=PLAIN DEBUG: trying to connect to host "imap.someniceandsecurehost.com", port 993, isSSL true * OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE LOGINDISABLED XAPPLEPUSHSERVICE AUTH=CRAM-MD5 AUTH=DIGEST-MD5 AUTH=GSSAPI] Dovecot ready. DEBUG IMAP: AUTH: CRAM-MD5 DEBUG IMAP: AUTH: DIGEST-MD5 DEBUG IMAP: AUTH: GSSAPI DEBUG: protocolConnect login, host=imap.someniceandsecurehost.com, user=username, password=<non-null> 2014-09-19 15:29:34,940 http-bio-8080-exec-14 ERROR user 929x97x1 asd1fb 192.168.3.234 /rest/servicedesk/1/servicedesk/SI/incomingemail/validateemailforcreation [servicedesk.squalor.email.MailServerVerifier] Unable to connect to the server at intranet.druide.com due to the following exception: Unfortunately JIRA Service Desk couldn't connect to the mail server. Here is what the mail server said: "No login methods supported!" {noformat} After some troubleshooting, I've found that since JavaMail fully supports SASL, it should have support for the two login methods mentioned. And adding: {{ -Dmail.imap.sasl.mechanisms=CRAM-MD5 -Dmail.imap.sasl.enable=true}} we are able to create a normal JIRA Incoming Mail account and configure a e-mail handler. However if you try to create the E-mail Service on Service Desk, you are unable to get past the first screen when configuring the mail server settings and the following exception is added to the logs: {noformat} 2014-10-08 16:45:50,785 http-bio-8080-exec-11 ERROR username 1005x101x1 1asx2asy 192.158.4.123 /rest/servicedesk/1/servicedesk/SI/incomingemail/validateemailforcreation [common.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service: javax/security/sasl/SaslException java.lang.NoClassDefFoundError: javax/security/sasl/SaslException at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at com.sun.mail.imap.protocol.IMAPProtocol.sasllogin(IMAPProtocol.java:701) at com.sun.mail.imap.IMAPStore.login(IMAPStore.java:716) at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:648) at javax.mail.Service.connect(Service.java:295) at com.atlassian.servicedesk.squalor.email.MailServerVerifier.verifyMailServer(MailServerVerifier.java:38) ... Caused by: java.lang.ClassNotFoundException: javax.security.sasl.SaslException at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:772) at org.apache.felix.framework.ModuleImpl.access$200(ModuleImpl.java:73) at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1690) at java.lang.ClassLoader.loadClass(Unknown Source) {noformat}

    Atlassian JIRA | 2 years ago | Pedro Cora [Atlassian]
    java.lang.NoClassDefFoundError: javax/security/sasl/SaslException
  3. 0
    samebug tip
    org.apache.http.config.Lookup class is in httpcore-4.3.jar not in httpclient-4.3.1.jar
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0
    samebug tip
    Upgrade play-plugins-redis to play-modules-redis. You may have to delete com.typesafe.plugin.RedisPlugin from play.plugins
  6. 0
    samebug tip
    You might have to readd your libraries if you just upgraded intelliJ. Try readding the netty library to the SDK.
    via GitHub by EBatTiVo
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.NoClassDefFoundError

    javax/security/sasl/SaslException

    at java.lang.Class.forName0()
  2. Java RT
    Class.forName
    1. java.lang.Class.forName0(Native Method)
    2. java.lang.Class.forName(Unknown Source)
    2 frames
  3. JavaMail API (compat)
    IMAPStore.protocolConnect
    1. com.sun.mail.imap.protocol.IMAPProtocol.sasllogin(IMAPProtocol.java:701)
    2. com.sun.mail.imap.IMAPStore.login(IMAPStore.java:716)
    3. com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:648)
    3 frames
  4. JavaMail API
    Service.connect
    1. javax.mail.Service.connect(Service.java:295)
    1 frame
  5. com.atlassian.servicedesk
    MailServerVerifier.verifyMailServer
    1. com.atlassian.servicedesk.squalor.email.MailServerVerifier.verifyMailServer(MailServerVerifier.java:38)
    1 frame