org.springframework.beans.factory.BeanCreationException

Error creating bean with name 'commonContext' defined in URL [jar:file:/opt/opennms/lib/opennms-services-1.9.2.jar!/beanRefContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.context.support.ClassPathXmlApplicationContext]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'init-capsdConfig-factory' defined in class path resource [META-INF/opennms/applicationContext-commonConfigs.xml]: Invocation of init method failed; nested exception is org.exolab.castor.xml.MarshalException: unable to find FieldDescriptor for 'service' in ClassDescriptor of capsd-configuration{File: [not available]; line: 194; column: 74}

Samebug tips4

Spring Security detects beans in the root context. Move the detection of the bean (or declare it explictly) in the root context.

Mixed JpaTransactionManager with JTA transaction type in the beans.xml and persistence.xml

Don't give up yet. Our experts can help. Paste your full stack trace to get a solution.

Solutions on the web466

  • via Unknown by Unknown author,
  • via Unknown by Unknown author,
  • Stack trace

    • org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'commonContext' defined in URL [jar:file:/opt/opennms/lib/opennms-services-1.9.2.jar!/beanRefContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.context.support.ClassPathXmlApplicationContext]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'init-capsdConfig-factory' defined in class path resource [META-INF/opennms/applicationContext-commonConfigs.xml]: Invocation of init method failed; nested exception is org.exolab.castor.xml.MarshalException: unable to find FieldDescriptor for 'service' in ClassDescriptor of capsd-configuration{File: [not available]; line: 194; column: 74} at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106) at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:617) at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:144) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:993) at org.springframework.beans.factory.supportAbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:897) at org.springframework.beansfactory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1049)

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    Unknown UserUnknown User
    2 times, last one
    linxiaolonglinxiaolong
    Once,
    batwalrus76batwalrus76
    Once,
    Unknown visitor
    Unknown visitorOnce,
    abrazenebabrazeneb
    34 times, last one
    55 more bugmates