Announcement Announcement Module
Collapse
No announcement yet.
NoSuchMethodError: javax.mail.Session: method getInstance( Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • NoSuchMethodError: javax.mail.Session: method getInstance(

    I kept getting the below error when using JavaMailSenderImpl...

    I have the latest "mail-1.3.2.jar" and "activation.jar" under

    tomcat/common/lib... should these files be somewhere else?

    any help is greatly appreciated, thank you.


    Context initialization failed

    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'mailSender' defined in ServletContext resource [/WEB-INF/classes/applicationContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.FatalBeanException: Could not instantiate class [org.springframework.mail.javamail.JavaMailSenderIm pl]; constructor threw exception; nested exception is java.lang.NoSuchMethodError: javax.mail.Session: method getInstance(Ljava/util/PropertiesLjavax/mail/Session; not found
    org.springframework.beans.FatalBeanException: Could not instantiate class [org.springframework.mail.javamail.JavaMailSenderIm pl]; constructor threw exception; nested exception is java.lang.NoSuchMethodError: javax.mail.Session: method getInstance(Ljava/util/PropertiesLjavax/mail/Session; not found
    java.lang.NoSuchMethodError: javax.mail.Session: method getInstance(Ljava/util/PropertiesLjavax/mail/Session; not found
    at org.springframework.mail.javamail.JavaMailSenderIm pl.<init>(JavaMailSenderImpl.java:70)
    at java.lang.reflect.Constructor.newInstance(Native Method)
    at org.springframework.beans.BeanUtils.instantiateCla ss(BeanUtils.java:77)
    at org.springframework.beans.BeanUtils.instantiateCla ss(BeanUtils.java:54)
    at org.springframework.beans.factory.support.SimpleIn stantiationStrategy.instantiate(SimpleInstantiatio nStrategy.java:48)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:272)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:223)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:236)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:159)
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:261)
    at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:317)
    at org.springframework.web.context.support.AbstractRe freshableWebApplicationContext.refresh(AbstractRef reshableWebApplicationContext.java:131)
    at org.springframework.web.context.ContextLoader.crea teWebApplicationContext(ContextLoader.java:177)
    at org.springframework.web.context.ContextLoader.init WebApplicationContext(ContextLoader.java:105)
    at org.springframework.web.context.ContextLoaderServl et.init(ContextLoaderServlet.java:81)
    at javax.servlet.GenericServlet.init(GenericServlet.j ava:256)
    at org.apache.catalina.core.StandardWrapper.loadServl et(StandardWrapper.java:935)
    at org.apache.catalina.core.StandardWrapper.load(Stan dardWrapper.java:823)
    at org.apache.catalina.core.StandardContext.loadOnSta rtup(StandardContext.java:3427)
    at org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:3628)
    at org.apache.catalina.core.ContainerBase.addChildInt ernal(ContainerBase.java:821)
    at org.apache.catalina.core.ContainerBase.addChild(Co ntainerBase.java:807)
    at org.apache.catalina.core.StandardHost.addChild(Sta ndardHost.java:595)
    at org.apache.catalina.core.StandardHostDeployer.inst all(StandardHostDeployer.java:307)
    at org.apache.catalina.core.StandardHost.install(Stan dardHost.java:788)
    at org.apache.catalina.startup.HostConfig.deployWARs( HostConfig.java:492)
    at org.apache.catalina.startup.HostConfig.deployApps( HostConfig.java:400)
    at org.apache.catalina.startup.HostConfig.start(HostC onfig.java:718)
    at org.apache.catalina.startup.HostConfig.lifecycleEv ent(HostConfig.java:358)
    at org.apache.catalina.util.LifecycleSupport.fireLife cycleEvent(LifecycleSupport.java:166)
    at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1196)
    at org.apache.catalina.core.StandardHost.start(Standa rdHost.java:754)
    at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1188)
    at org.apache.catalina.core.StandardEngine.start(Stan dardEngine.java:363)
    at org.apache.catalina.core.StandardService.start(Sta ndardService.java:497)
    at org.apache.catalina.core.StandardServer.start(Stan dardServer.java:2190)
    at org.apache.catalina.startup.Catalina.start(Catalin a.java:512)
    at org.apache.catalina.startup.Catalina.execute(Catal ina.java:400)
    at org.apache.catalina.startup.Catalina.process(Catal ina.java:180)
    at java.lang.reflect.Method.invoke(Native Method)
    at org.apache.catalina.startup.Bootstrap.main(Bootstr ap.java:203)

  • #2
    found an old "mail.jar" in classpath...problem solved

    Comment

    Working...
    X