Giter Club home page Giter Club logo

Comments (22)

garyrussell avatar garyrussell commented on June 9, 2024

You seem to have an old version of com.sun.mail:imap on your classpath - try using a more recent version (e.g. 1.5.6).

from spring-integration-samples.

rohangulati avatar rohangulati commented on June 9, 2024

This also happens when you are using javax.mail standalone with spring-boot-starter-mail. com.sun.mail:imap uses javax.mail(v.1.5.6) internally. When you are using javax.mail version other than 1.5.6, you have 2 version of the IMAPFolder (one from com.sun.mail and other from javax.mail) in your dependency tree. Maven will resolve this conflict by choosing IMAPFolder from javax.mail which does not contain theidle() method. This causes the java.lang.NoSuchMethodError exception.


Solution
You can update the version of javax.mail to 1.5.6 to make it compliant with com.sun.mail:imap

from spring-integration-samples.

pankajkh avatar pankajkh commented on June 9, 2024

Hi Rohan,
Yes, we are using javax.mail standalone. https://mvnrepository.com/artifact/javax.mail/mail/1.4.7
Should I replace it with https://mvnrepository.com/artifact/com.sun.mail/javax.mail/1.5.6 ?

Thanks,
Pankaj

from spring-integration-samples.

artembilan avatar artembilan commented on June 9, 2024

No, replacement. You should declare like:

compile "javax.mail:javax.mail-api:1.5.6"
compile "com.sun.mail:javax.mail:1.5.6"
compile "com.sun.mail:imap:1.5.6"

from spring-integration-samples.

rohangulati avatar rohangulati commented on June 9, 2024

@pankajkh I had the same issue, so updating the version of javax.mail to 1.5.6 my pom.xml fixed this

from spring-integration-samples.

pankajkh avatar pankajkh commented on June 9, 2024

@artembilan : Can you please provide more detail ? How it will fix the issue.
@rohangulati : there is no version 1.5.6 to upgrade for jar (javax.mail:mail). I need to replace with other jar (com.sun.mail:javax.mail).

from spring-integration-samples.

rohangulati avatar rohangulati commented on June 9, 2024

@pankajkh You should use https://mvnrepository.com/artifact/javax.mail/javax.mail-api/1.5.6

from spring-integration-samples.

artembilan avatar artembilan commented on June 9, 2024

One more time:

javax.mail:javax.mail-api:1.5.6

not

javax.mail:javax.mail:1.5.6

The impl is in the com.sun.mail:javax.mail:1.5.6.

from spring-integration-samples.

pankajkh avatar pankajkh commented on June 9, 2024

Thanks a lot, got it now.

from spring-integration-samples.

venkatr123 avatar venkatr123 commented on June 9, 2024

Hi all
iam getting same error
javax.mail:javax.mail-api:1.5.6
here no like idle() in this api
{
javax.mail:javax.mail:1.5.6
here idle() method there
}
uisng this api

from spring-integration-samples.

venkatr123 avatar venkatr123 commented on June 9, 2024

can you give clarity which api i have to use to remove this error
Exception in thread "Thread-2" java.lang.NoSuchMethodError: com.sun.mail.imap.IMAPFolder.idle()V
at com.uralian.cgiats.EmailAccess$IdleThread.run(EmailAccess.java:267)

from spring-integration-samples.

garyrussell avatar garyrussell commented on June 9, 2024

You must still have an incompatible imap jar on the class path somehow. Run the jvm with -verbose to see which jar IMAPFolder is being loaded from.

from spring-integration-samples.

venkatr123 avatar venkatr123 commented on June 9, 2024

IMAPFolder class is only there in javax.mail:javax.mail:1.5.6
not in javax.mail:javax.mail-api:1.5.6

in run time it's not picking the idle() method it's there in IMAPFolder in javax.mail:javax.mail:1.5.6
where can i add to pick this jar

from spring-integration-samples.

garyrussell avatar garyrussell commented on June 9, 2024

As I said -verbose is your friend.

Or, perhaps you are running in an app server that has an old javamail.

from spring-integration-samples.

venkatr123 avatar venkatr123 commented on June 9, 2024

i am running this application as standalone by using this jar https://mvnrepository.com/artifact/javax.mail/javax.mail/1.6.0 this not web app

from spring-integration-samples.

garyrussell avatar garyrussell commented on June 9, 2024

What version of Spring Integration? 5.1.1 uses javamail 1.6.2 and works fine.

Show your complete POM.

from spring-integration-samples.

venkatr123 avatar venkatr123 commented on June 9, 2024

this is spring version
<spring.version>4.3.8.RELEASE</spring.version>

from spring-integration-samples.

garyrussell avatar garyrussell commented on June 9, 2024

I asked for spring-integration version.

from spring-integration-samples.

venkatr123 avatar venkatr123 commented on June 9, 2024

means i did't get you

from spring-integration-samples.

garyrussell avatar garyrussell commented on June 9, 2024

This is becoming tedious; as I said

Show your complete POM.

from spring-integration-samples.

venkatr123 avatar venkatr123 commented on June 9, 2024

we are not using spring integaration

from spring-integration-samples.

garyrussell avatar garyrussell commented on June 9, 2024

So why are you asking this question in a Spring Integration GitHub issue?

from spring-integration-samples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.