Results 1 to 3 of 3

Thread: Spring context getting destroyed

  1. #1
    Join Date
    Oct 2009
    Posts
    21

    Default Spring context getting destroyed

    Hi Everyone,

    I am facing a strange problem while starting my spring application.

    Whats happening is that Spring apparently automatically destroying the application context at the startup of the application.

    If I see the server startup logs, this is the sequence :

    1.building hibernate session factory.
    2. destroying singletons in [DefaultListableBeanFactoryxxx] (and then list of all the singleton beans in my application)
    3. closing hibernate session.
    4.context initialization failed.

    Below is the snippet from the actual server logs :

    [12/14/10 9:05:09:602 EST] 00000018 SessionFactor I org.hibernate.impl.SessionFactoryImpl <init> building session factory
    [12/14/10 9:05:09:637 EST] 00000018 SessionFactor I org.hibernate.impl.SessionFactoryObjectFactory addInstance Not binding factory to JNDI, no JNDI name configured
    [12/14/10 9:05:10:877 EST] 00000018 DefaultListab I org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry destroySingletons Destroying singletons in org.springframework.beans.factory.support.DefaultL istableBeanFactory@5e745e74: defining beans [all the bean names here, comma seperated]; root of factory hierarchy
    [12/14/10 9:05:10:879 EST] 00000018 LocalContaine I org.springframework.orm.jpa.AbstractEntityManagerF actoryBean destroy Closing JPA EntityManagerFactory for persistence unit 'Store'
    [12/14/10 9:05:10:880 EST] 00000018 SessionFactor I org.hibernate.impl.SessionFactoryImpl close closing
    [12/14/10 9:05:10:882 EST] 00000018 MBeanExporter I org.springframework.jmx.export.MBeanExporter destroy Unregistering JMX-exposed beans on shutdown
    [12/14/10 9:05:10:911 EST] 00000018 ContextLoader E org.springframework.web.context.ContextLoader initWebApplicationContext Context initialization failed
    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'EmailSender' defined in ServletContext resource [/WEB-INF/config/applicationContext.xml]: Cannot create inner bean 'org.springframework.mail.javamail.JavaMailSenderI mpl#38603860' of type [org.springframework.mail.javamail.JavaMailSenderIm pl] while setting bean property 'mailSender'; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'org.springframework.mail.javamail.JavaMailSenderI mpl#38603860' defined in ServletContext resource [/WEB-INF/config/applicationContext.xml]: Initialization of bean failed; nested exception is java.lang.NullPointerException
    at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveInnerBean(BeanDefinitio nValueResolver.java:230)
    at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveValueIfNecessary(BeanDe finitionValueResolver.java:117)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.applyPropertyValues(Abs tractAutowireCapableBeanFactory.java:1245)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.populateBean(AbstractAu towireCapableBeanFactory.java:1010)

    Just to let you know, that the 'mailSender' property is there and there is no issue with this property setting at all, that that is why destroy of spring singleton beans right before this error message seems to be a problem to me.

    Environment: Spring 2.5
    Websphere 6.1

    This is a showstopper and looking for a quick guidance on it.
    Any help/guidance on this will be highly appreciated.

    Thanks,
    Nitin.

  2. #2

    Default

    There does seem to be some initialization error related to the JavaMailSenderImpl defined in the applicationContext.xml file. Any chance you can post that file or the part that relates to the config of the mailSender bean?

  3. #3
    Join Date
    Dec 2010
    Posts
    1

    Default

    Hi!
    I've just visited this forum. Happy to get acquainted with you. Thanks!

    __________________
    Watch Blue Valentine Online Free

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •