I am struck with this error from 2 days. Any help?
ERROR o.s.web.context.ContextLoader - Context initialization failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sessionFilter' defined in file [/usr/local/tomcat/webapps/portal/WEB-INF/classes/META-INF/spring/applicationContext-security.xml]: Unsatisfied dependency expressed through constructor argument with index 1 of type [com.xxx.cloud.common.sessionclient.retrievers.SessionRetrievalStrategy]: : Error creating bean with name 'securityConfig': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'xxx/abc/realm_id' is defined: not found in JNDI environment; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'securityConfig': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'xxx/abc/realm_id' is defined: not found in JNDI environment
Code:
#Resource(mappedName = "xyz/abc/realm_id")
private String assId;
#Bean
public String assId() {
return assId;
}
applicationContext-Security.xml where the bean is defined, but it doesnt pick up
<beans:bean id="xyz/abc/realm_id" class="com.xxxxxxxx.SecurityConfig">
<beans:property name="assId" value="123456789"/>
</beans:bean>
We cannot use tomcat context.xml.
Related
when starting the application, see the below error:
Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'blockDataController': Injection of resource dependencies failed;
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'blockSummaryImpl': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'prodCodeMapper' defined in file [D:\YueNiuProject\StockMarket\yueniu-stock-data\market-data-dao\target\classes\com\yueniu\stock\market\data\mapper\block\ProdCodeMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory';
nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Unsatisfied dependency expressed through method 'sqlSessionFactory' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception;
nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class
the connection with a sql database, you must configure datasource in application.properties
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.url=jdbc:mysql://..
spring.datasource.username=//..
spring.datasource.password=//..
if you dont need to config the datasource, you can use the exclude . like this:
#SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
it would not register the DataSource with default configuration, then passed the issue for throw Exception
sometimes if you bean configuration in same package it won't work. Like the properties loading bean need to be in separate package. Not sure this answer will be accepted or not , for me it worked after moving below code into different package.
#Bean
public PlatformTransactionManager oracleTransactionManager() {
JpaTransactionManager transactionManager = new JpaTransactionManager();
transactionManager.setEntityManagerFactory(oracleEntityManager().getObject());
return transactionManager;
}
Trying to override spring bean using Alias.
I want to over ride roundCurrency method of commonI18NService
OOTB definition
<alias alias="commonI18NService" name="defaultCommonI18NService"/>
<bean id="defaultCommonI18NService" class="de.hybris.platform.servicelayer.i18n.impl.DefaultCommonI18NService" parent="abstractBusinessService">
<property name="languageDao" ref="languageDao"/>
<property name="currencyDao" ref="currencyDao"/>
<property name="countryDao" ref="countryDao"/>
<property name="regionDao" ref="regionDao"/>
<property name="conversionStrategy" ref="conversionStrategy"/>
</bean>
Our custom code :-
public class DefaultCustomCommonI18NService extends DefaultCommonI18NService
{
#Override
public double roundCurrency(double value, int digits)
{
// custom logic
return value;
}
}
Inject custom bean :-
<alias alias="commonI18NService" name="defaultCustomCommonI18NService"/>
<bean id="defaultCustomCommonI18NService" class="com.extended.service.impl.DefaultCustomCommonI18NService" parent="defaultCommonI18NService"/>
But it throws exception on server startUP
INFO [localhost-startStop-1] [HybrisContextFactory] Loading <<application>> spring config <master> from extension (saporderexchangeb2b) located in (saporderexchangeb2b-spring.xml) took: (121.4 ms)
WARN [localhost-startStop-1] [CloseAwareApplicationContext] Exception encountered during context initialization - cancelling refresh attempt
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'listMergeBeanPostProcessor': Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'commercePlaceOrderMethodHooksListMergeDirective' defined in class path resource [b2bapprovalprocess-spring.xml]: Cannot resolve reference to bean 'b2bApprovalBusinessProcessCreationPlaceOrderMethodHook' while setting bean property 'add'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'b2bApprovalBusinessProcessCreationPlaceOrderMethodHook' defined in class path resource [b2bapprovalprocess-spring.xml]: Cannot resolve reference to bean 'defaultB2BCreateOrderFromCartStrategy' while setting bean property 'businessProcessCreationStrategy'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultB2BCreateOrderFromCartStrategy' defined in class path resource [b2bapprovalprocess-spring.xml]: Cannot resolve reference to bean 'cloneAbstractOrderStrategy' while setting bean property 'cloneAbstractOrderStrategy'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultCloneAbstractOrderStrategy' defined in class path resource [order-spring.xml]: Cannot resolve reference to bean 'typeService' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultTypeService' defined in class path resource [servicelayer-spring.xml]: Cannot resolve reference to bean 'converterRegistry' while setting bean property 'converterRegistry'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'defaultConverterRegistry' defined in class path resource [servicelayer-spring.xml]: Unsatisfied dependency expressed through bean property 'commonI18NService': : No qualifying bean of type [de.hybris.platform.servicelayer.i18n.CommonI18NService] is defined: expected single matching bean but found 2: defaultCommonI18NService,defaultcustomCommonI18NService; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [de.hybris.platform.servicelayer.i18n.CommonI18NService] is defined: expected single matching bean but found 2: defaultCommonI18NService,defaultcustomCommonI18NService
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:136) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:408) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1566) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
This is happening because the autowiring strategy of defaultConverterRegistry is byType:
<bean id="defaultConverterRegistry" ... autowire="byType" >
which means Spring found two candidates for commonI18NService bean defaultCommonI18NService and defaultcustomCommonI18NService hence don't know which one to inject.
I propose to make your defaultcustomCommonI18NService a primary bean to be the autowired by using primary="true", see
<bean id="defaultCustomCommonI18NService" class="com.extended.service.impl.DefaultCustomCommonI18NService" parent="defaultCommonI18NService" primary="true" />
I have started getting below exception after I migrated project from Spring Boot version from 1.2.3.RELEASE to 1.3.0.RELEASE.
Error creating bean with name 'springApplicationAdminRegistrar'
defined in class path resource
[org/springframework/boot/autoconfigure/admin/SpringApplicationAdminJmxAutoConfiguration.class]:
Invocation of init method failed; nested exception is
javax.management.InstanceAlreadyExistsException:
org.springframework.boot:type=Admin,name=SpringApplication
Stacktrace around this error is:
WARN o.s.c.a.AnnotationConfigApplicationContext:545 - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'springApplicationAdminRegistrar' defined in class path resource [org/springframework/boot/autoconfigure/admin/SpringApplicationAdminJmxAutoConfiguration.class]: Invocation of init method failed; nested exception is javax.management.InstanceAlreadyExistsException: org.springframework.boot:type=Admin,name=SpringApplication
INFO o.s.j.e.a.AnnotationMBeanExporter:449 - Unregistering JMX-exposed beans on shutdown
WARN o.s.b.f.s.DefaultListableBeanFactory:1480 - Bean creation exception on FactoryBean type check: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userManagementDAO' defined in file [${PATH_TO_PROJECT}\target\classes\com\mycom\myproject\mappers\UserManagementDAO.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory': : Error creating bean with name 'getSqlSessionFactory' defined in class path resource [com/mycom/myproject/config/DAOConfig.class]: Invocation of init method failed; nested exception is java.lang.ExceptionInInitializerError; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'getSqlSessionFactory' defined in class path resource [com/mycom/myproject/config/DAOConfig.class]: Invocation of init method failed; nested exception is java.lang.ExceptionInInitializerError
WARN o.s.b.f.s.DefaultListableBeanFactory:1480 - Bean creation exception on FactoryBean type check: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userManagementDAO' defined in file [${PATH_TO_PROJECT}\target\classes\com\mycom\myproject\mappers\UserManagementDAO.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory': : Error creating bean with name 'getSqlSessionFactory': Requested bean is currently in creation: Is there an unresolvable circular reference?; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'getSqlSessionFactory': Requested bean is currently in creation: Is there an unresolvable circular reference?
WARN o.s.b.f.s.DefaultListableBeanFactory:1480 - Bean creation exception on FactoryBean type check: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userManagementDAO' defined in file [${PATH_TO_PROJECT}\target\classes\com\mycom\myproject\mappers\UserManagementDAO.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory': : Error creating bean with name 'getSqlSessionFactory': Requested bean is currently in creation: Is there an unresolvable circular reference?; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'getSqlSessionFactory': Requested bean is currently in creation: Is there an unresolvable circular reference?
WARN o.s.b.f.s.DefaultListableBeanFactory:1480 - Bean creation exception on FactoryBean type check: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sampleDAO' defined in file [${PATH_TO_PROJECT}\target\classes\com\mycom\myproject\mappers\SampleDAO.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory': : Error creating bean with name 'getSqlSessionFactory' defined in class path resource [com/mycom/myproject/config/DAOConfig.class]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class com.mycom.myproject.entities.master.Method; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'getSqlSessionFactory' defined in class path resource [com/mycom/myproject/config/DAOConfig.class]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class com.mycom.myproject.MyEntity
WARN o.s.b.f.s.DefaultListableBeanFactory:1480 - Bean creation exception on FactoryBean type check: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sampleDAO' defined in file [${PATH_TO_PROJECT}\target\classes\com\mycom\myproject\mappers\SampleDAO.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory': : Error creating bean with name 'getSqlSessionFactory' defined in class path resource [com/mycom/myproject/config/DAOConfig.class]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class com.mycom.myproject.entities.master.Method; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'getSqlSessionFactory' defined in class path resource [com/mycom/myproject/config/DAOConfig.class]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class com.mycom.myproject.MyEntity
Any pointer to debug this issue?
Context was loading manually(Java Code) from code for fetching a bean, removing which resolved the issue.
However my problem is solved but still not sure how it was working with last version of spring boot.
I have an issue during start of application. I made a WAR file which runs in tomcat well. But i need to deploy it into websphere application server (8.5.5.4). JVM edited - installed IBM java 1.7 and xmx to 1,8GB.
After deploy of application code below can be found in logs
2015-01-28 12:13:48,733 INFO [WebContainer : 3] [com.atlassian.confluence.lifecycle] contextInitialized Starting Confluence 5.5.3 [build 5515 based on commit hash dc14a8a1bb8ff5f410b8fec10fffebe66c51617e]
2015-01-28 12:13:50,672 WARN [WebContainer : 3] [atlassian.config.xml.AbstractDom4jXmlConfigurationPersister] saveDocumentAtomically Unable to move D:\test\cfwshome\confluence.cfg.xml5794152920166961085tmp to D:\test\cfwshome\confluence.cfg.xml. Falling back to non-atomic overwrite.
2015-01-28 12:13:51,020 INFO [WebContainer : 3] [atlassian.plugin.manager.DefaultPluginManager] init Initialising the plugin system
2015-01-28 12:13:51,169 WARN [WebContainer : 3] [osgi.container.felix.ExportsBuilder] getUrlClassLoaders ignoring non-URLClassLoader class com.ibm.ws.classloader.CompoundClassLoader
2015-01-28 12:13:51,170 WARN [WebContainer : 3] [osgi.container.felix.ExportsBuilder] getUrlClassLoaders ignoring non-URLClassLoader class com.ibm.ws.classloader.CompoundClassLoader
2015-01-28 12:13:51,171 WARN [WebContainer : 3] [osgi.container.felix.ExportsBuilder] getUrlClassLoaders ignoring non-URLClassLoader class com.ibm.ws.classloader.ProtectionClassLoader
2015-01-28 12:13:51,171 WARN [WebContainer : 3] [osgi.container.felix.ExportsBuilder] getUrlClassLoaders ignoring non-URLClassLoader class org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader
2015-01-28 12:13:51,184 WARN [WebContainer : 3] [osgi.container.felix.ExportsBuilder] collectClassPath Missing manifest prevents deep scan of 'file:/D:/SOFT/IBM/WS/APP/deploytool/itp/batch2.jar'
2015-01-28 12:26:05,878 WARN [Deferrable Alarm : 3] [ws.runtime.component.ThreadMonitorImpl] logToJSR47Logger WSVR0605W: Podproces "WebContainer : 3" (00000065) je aktivní po dobu 743 919 a může být zablokovaný. Na serveru je celkem 1 podprocesů, které mohou být zablokované.
at java.io.WinNTFileSystem.getLastModifiedTime(Native Method)
at java.io.File.lastModified(File.java:950)
at java.util.zip.ZipFile.<init>(ZipFile.java:231)
at java.util.zip.ZipFile.<init>(ZipFile.java:161)
at java.util.jar.JarFile.<init>(JarFile.java:169)
at java.util.jar.JarFile.<init>(JarFile.java:133)
at com.atlassian.plugin.osgi.container.felix.ExportsBuilder.getUrlClassPath(ExportsBuilder.java:356)
at com.atlassian.plugin.osgi.container.felix.ExportsBuilder.generateExports(ExportsBuilder.java:257)
at com.atlassian.plugin.osgi.container.felix.ExportsBuilder.determineExports(ExportsBuilder.java:175)
at com.atlassian.plugin.osgi.container.felix.ExportsBuilder.getExports(ExportsBuilder.java:127)
at com.atlassian.plugin.osgi.container.felix.FelixOsgiContainerManager.start(FelixOsgiContainerManager.java:249)
at com.atlassian.plugin.osgi.container.felix.FelixOsgiContainerManager.onStart(FelixOsgiContainerManager.java:205)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
..
..
..
another part of stack trace (as i mentioned in last comment bellow)
[30 January 15 14: 48: 28: 836 GMT] 0000007c ContextLoader E org.springframework.web.context.ContextLoader initWebApplicationContext Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'macroIconManager' Defined in class path resource [services / pluginServiceContext.xml]: Can not resolve reference to bean 'httpRetrievalService' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'httpRetrievalService' Defined in class path resource [applicationContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SettingsManager' Defined in class path resource [applicationContext.xml]: Can not resolve reference to bean 'upgradeManager' while setting bean property 'upgradeManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'upgradeManager' Defined in class path resource [upgradeSubsystemContext.xml]: Can not resolve reference to bean 'contentPermissionConstraintsUpgradeTask' while setting bean property 'schemaUpgradeTasks' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'contentPermissionConstraintsUpgradeTask' Defined in class path resource [upgradeSubsystemContext.xml]: Can not resolve reference to bean 'contentPermissionConstraintsCleaner' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'contentPermissionConstraintsCleaner' Defined in class path resource [upgradeSubsystemContext.xml]: Can not resolve reference to bean 'contentEntityManager' while setting bean property 'contentEntityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'contentEntityManager' Defined in class path resource [applicationContext.xml]: Can not resolve reference to bean 'linkManager' while setting bean property 'linkManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'linkManager' Defined in class path resource [applicationContext.xml]: Can not resolve reference to bean 'outgoingLinksExtractor' while setting bean property 'outgoingLinksExtractor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'outgoingLinksExtractor' Defined in class path resource [applicationContext.xml]: Can not resolve reference to bean 'xmlEventReaderFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'xmlEventReaderFactory' Defined in class path resource [renderingContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.atlassian.confluence.content.render.xhtml.DefaultXmlEventReaderFactory]: Constructor threw exception; nested exception is java.lang.IllegalArgumentException: Class XMLInputFactory does not recognize the property "com.ctc.wstx.normalizeAttrValues".
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)
at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:495)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:162)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:925)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.creat eBeanInstance(AbstractAutowireCapableBeanFactory.java:835)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged (AccessController.java:303)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
..
..
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'httpRetrievalService' Defined in class path resource [applicationContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SettingsManager' Defined in class path resource [applicationContext.xml]: Can not resolve reference to bean 'upgradeManager' while setting bean property 'upgradeManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'upgradeManager' Defined in class path resource [upgradeSubsystemContext.xml]: Can not resolve reference to bean 'contentPermissionConstraintsUpgradeTask' while setting bean property 'schemaUpgradeTasks' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'contentPermissionConstraintsUpgradeTask' Defined in class path resource [upgradeSubsystemContext.xml]: Can not resolve reference to bean 'contentPermissionConstraintsCleaner' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'contentPermissionConstraintsCleaner' Defined in class path resource [upgradeSubsystemContext.xml]: Can not resolve reference to bean 'contentEntityManager' while setting bean property 'contentEntityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'contentEntityManager' Defined in class path resource [applicationContext.xml]: Can not resolve reference to bean 'linkManager' while setting bean property 'linkManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'linkManager' Defined in class path resource [applicationContext.xml]: Can not resolve reference to bean 'outgoingLinksExtractor' while setting bean property 'outgoingLinksExtractor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'outgoingLinksExtractor' Defined in class path resource [applicationContext.xml]: Can not resolve reference to bean 'xmlEventReaderFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'xmlEventReaderFactory' Defined in class path resource [renderingContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.atlassian.confluence.content.render.xhtml.DefaultXmlEventReaderFactory]: Constructor threw exception; nested exception is java.lang.IllegalArgumentException: Class XMLInputFactory does not recognize the property "com.ctc.wstx.normalizeAttrValues".
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged (AccessController.java:303)
..
..
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SettingsManager' Defined in class path resource [applicationContext.xml]: Can not resolve reference to bean 'upgradeManager' while setting bean property 'upgradeManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'upgradeManager' Defined in class path resource [upgradeSubsystemContext.xml]: Can not resolve reference to bean 'contentPermissionConstraintsUpgradeTask' while setting bean property 'schemaUpgradeTasks' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'contentPermissionConstraintsUpgradeTask' Defined in class path resource [upgradeSubsystemContext.xml]: Can not resolve reference to bean 'contentPermissionConstraintsCleaner' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'contentPermissionConstraintsCleaner' Defined in class path resource [upgradeSubsystemContext.xml]: Can not resolve reference to bean 'contentEntityManager' while setting bean property 'contentEntityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'contentEntityManager' Defined in class path resource [applicationContext.xml]: Can not resolve reference to bean 'linkManager' while setting bean property 'linkManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'linkManager' Defined in class path resource [applicationContext.xml]: Can not resolve reference to bean 'outgoingLinksExtractor' while setting bean property 'outgoingLinksExtractor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'outgoingLinksExtractor' Defined in class path resource [applicationContext.xml]: Can not resolve reference to bean 'xmlEventReaderFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'xmlEventReaderFactory' Defined in class path resource [renderingContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.atlassian.confluence.content.render.xhtml.DefaultXmlEventReaderFactory]: Constructor threw exception; nested exception is java.lang.IllegalArgumentException: Class XMLInputFactory does not recognize the property "com.ctc.wstx.normalizeAttrValues".
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)
I am writing a java module in which I have used hibernate validator. The module works fine by itself.
However when it is included as part of a parent project which uses hibernate for standard entity mapping as an ORM, the parent module breaks down by complaining that it is unable to set up the validation factory (and thus fails to setup the session factory).
exception message is "Invocation of init method failed; nested exception is org.hibernate.HibernateException: Unable to get the default Bean Validation factory"
-Pulkit
EDIT:
hibernate-validator : 4.3.1.Final
hibernate-core : 3.6.5
Stacktrace :
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'messageSourceServiceTarget' defined in class
path resource [applicationContext-service.xml]: Cannot resolve
reference to bean 'mutableResourceBundleMessageSource' while setting
bean property 'activeMessageSource'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'mutableResourceBundleMessageSource' defined
in class path resource [applicationContext-service.xml]:
Initialization of bean failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name
'org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor#0'
defined in class path resource [applicationContext-service.xml]:
Cannot resolve reference to bean 'transactionInterceptor' while
setting bean property 'transactionInterceptor'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'transactionInterceptor' defined in class path
resource [applicationContext-service.xml]: Cannot resolve reference to
bean 'transactionManager' while setting bean property
'transactionManager'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'transactionManager' defined in class path
resource [applicationContext-service.xml]: Cannot resolve reference to
bean 'sessionFactory' while setting bean property 'sessionFactory';
nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'sessionFactory' defined in class path
resource [applicationContext-service.xml]: Invocation of init method
failed; nested exception is org.hibernate.HibernateException: Unable
to get the default Bean Validation factory