Announcement Announcement Module
Collapse
No announcement yet.
ClassPathXmlApplicationContext: Constructor threw exception Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • ClassPathXmlApplicationContext: Constructor threw exception

    Hello,
    I try to deploy and start an application using Weblogic. It is built with Spring. One configuration file contains one bean of class ClassPathXmlApplicationContext which has other configuration files given as attributes to the constructor. After deploying I try to start it. I get:

    Could not instantiate bean class [org.springframework.context.support.ClassPathXmlAp plicationContext]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'org.springframework.dao.annotation.PersistenceExc eptionTranslationPostProcessor#0': Initialization of bean failed; nested exception is java.lang.IllegalStateException: No persistence exception translators found in bean factory. Cannot perform exception translation.

    In stack trace I found following:

    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'org.springframework.dao.annotation.PersistenceExc eptionTranslationPostProcessor#0': Initialization of bean failed; nested exception is java.lang.IllegalStateException: No persistence exception translators found in bean factory. Cannot perform exception translation.
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:527)

    In this class (AbstractAutowireCapableBeanFactory) in line 527 I see:

    Code:
    516 		try {
    517 			populateBean(beanName, mbd, instanceWrapper);
    518 			if (exposedObject != null) {
    519 				exposedObject = initializeBean(beanName, exposedObject, mbd);
    520 			}
    521 		}
    522 		catch (Throwable ex) {
    523 			if (ex instanceof BeanCreationException && beanName.equals(((BeanCreationException) ex).getBeanName())) {
    524 				throw (BeanCreationException) ex;
    525 			}
    526 			else {
    527 				throw new BeanCreationException(mbd.getResourceDescription(), beanName, "Initialization of bean failed", ex);
    528 			}
    529 		}
    I don't know if I am going good way.

    Did somebody have similiar error?

  • #2
    I read about ContextSingletonBeanFactoryLocator - now I understand construction with many contexts inside the context. But the problem was in the sentece:
    No persistence exception translators found in bean factory.
    I found solution at stackoverflow, I added following line to one of the contexts:
    Code:
    <bean class="org.springframework.orm.hibernate3.HibernateExceptionTranslator"/>
    and I think it helps (I still have errors but different)

    Comment

    Working...
    X