Alfresco compatibility with Existing Oracle DB - java

I have installed Enterprise Version of alfresco and trying to use it with existing Oracle DB schema.
For that I have changed properties in alfresco-global.properties file from PostgreSQL to Oracle.
And I am getting authenticate error while login into alfresco admin.
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.beans.factory.config.PropertyPathFactoryBean#48ff4096' defined in class path resource [alfresco/ibatis/ibatis-context.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialect' defined in class path resource [alfresco/hibernate-context.xml]: Cannot resolve reference to bean '&sessionFactory' while setting bean property 'localSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSourceCheck' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean '&sessionFactory' while setting bean property 'localSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [alfresco/hibernate-context.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Hibernate Dialect must be explicitly set
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:529)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:276)
... 105 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialect' defined in class path resource [alfresco/hibernate-context.xml]: Cannot resolve reference to bean '&sessionFactory' while setting bean property 'localSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSourceCheck' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean '&sessionFactory' while setting bean property 'localSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [alfresco/hibernate-context.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Hibernate Dialect must be explicitly set
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:334)

Related

Excecption upon start of tomcat server with spring application

All of a sudden started to get following error upon starting the server.
Switched from java 1.8 to java 1.7 but no luck...
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.filterChains': Cannot resolve reference to bean 'org.springframework.security.web.DefaultSecurityFilterChain#4' while setting bean property 'sourceList' with key [4]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.web.DefaultSecurityFilterChain#4': Cannot resolve reference to bean 'mobileFilter' while setting constructor argument with key [2]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mobileFilter' defined in ServletContext resource [/WEB-INF/classes/security-context.xml]: Cannot resolve reference to bean 'authenticationManager' while setting bean property 'authenticationManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authenticationManager' defined in ServletContext resource [/WEB-INF/classes/security-context.xml]: Cannot resolve reference to bean 'daoAuthenticationProvider' while setting bean property 'providers' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'daoAuthenticationProvider' defined in ServletContext resource [/WEB-INF/classes/security-context.xml]: Cannot resolve reference to bean 'userDetailsService' while setting bean property 'userDetailsService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDetailsService' defined in ServletContext resource [/WEB-INF/classes/security-context.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'personClientFactory' threw exception; nested exception is java.lang.NullPointerException
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.web.DefaultSecurityFilterChain#4': Cannot resolve reference to bean 'mobileFilter' while setting constructor argument with key [2]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mobileFilter' defined in ServletContext resource [/WEB-INF/classes/security-context.xml]: Cannot resolve reference to bean 'authenticationManager' while setting bean property 'authenticationManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authenticationManager' defined in ServletContext resource [/WEB-INF/classes/security-context.xml]: Cannot resolve reference to bean 'daoAuthenticationProvider' while setting bean property 'providers' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'daoAuthenticationProvider' defined in ServletContext resource [/WEB-INF/classes/security-context.xml]: Cannot resolve reference to bean 'userDetailsService' while setting bean property 'userDetailsService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDetailsService' defined in ServletContext resource [/WEB-INF/classes/security-context.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'personClientFactory' threw exception; nested exception is java.lang.NullPointerException

Error creating bean with name springApplicationAdminRegistrar

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.

Websphere - application error during start

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)

WebAppConfiguration doesn't play well with ContextConfiguration?

I have an existing Java app using Spring MVC 3.2.1. The existing unit tests all work fine. Now I'm trying to a new unit test, using the #WebAppConfiguration annotation for the first time, and it's blowing up with a wacky error.
Here's my new unit test, taken almost verbatim from this page:
#RunWith(SpringJUnit4ClassRunner.class)
#WebAppConfiguration
#ContextConfiguration(locations={"classpath:war-test-context.xml"})
#Transactional
public class GenericPageControllerTest {
#Autowired
private WebApplicationContext webApplicationContext;
private MockMvc mockMvc;
#Before
public void setup() {
this.mockMvc = webAppContextSetup(this.webApplicationContext).build();
}
#Test
public void testControllerSecurityTestThingyTestWithALongNameTest() throws Exception {
this.mockMvc.perform(get("/payOptions.html"))
.andExpect(redirectedUrl("/login.html"));
}
}
Here's the error I'm getting:
java.lang.IllegalStateException: Failed to load ApplicationContext
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor#0' defined in class path resource [war-test-context.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [war-test-context.xml]: Cannot resolve reference to bean 'persistenceUnitManager' while setting bean property 'persistenceUnitManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'persistenceUnitManager' defined in class path resource [war-test-context.xml]: Cannot resolve reference to bean 'caDataSource' while setting bean property 'dataSources' with key [TypedStringValue: value [caDataSource], target type [null]]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'caDataSource': Invocation of init method failed; nested exception is org.springframework.dao.DataAccessResourceFailureException: Failed to populate database; nested exception is org.springframework.jdbc.datasource.init.CannotReadScriptException: Cannot read SQL script from ServletContext resource [/database/myapp_schema.sql]
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [war-test-context.xml]: Cannot resolve reference to bean 'persistenceUnitManager' while setting bean property 'persistenceUnitManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'persistenceUnitManager' defined in class path resource [war-test-context.xml]: Cannot resolve reference to bean 'caDataSource' while setting bean property 'dataSources' with key [TypedStringValue: value [caDataSource], target type [null]]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'caDataSource': Invocation of init method failed; nested exception is org.springframework.dao.DataAccessResourceFailureException: Failed to populate database; nested exception is org.springframework.jdbc.datasource.init.CannotReadScriptException: Cannot read SQL script from ServletContext resource [/database/myapp_schema.sql]
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'persistenceUnitManager' defined in class path resource [war-test-context.xml]: Cannot resolve reference to bean 'caDataSource' while setting bean property 'dataSources' with key [TypedStringValue: value [caDataSource], target type [null]]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'caDataSource': Invocation of init method failed; nested exception is org.springframework.dao.DataAccessResourceFailureException: Failed to populate database; nested exception is org.springframework.jdbc.datasource.init.CannotReadScriptException: Cannot read SQL script from ServletContext resource [/database/myapp_schema.sql]
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'caDataSource': Invocation of init method failed; nested exception is org.springframework.dao.DataAccessResourceFailureException: Failed to populate database; nested exception is org.springframework.jdbc.datasource.init.CannotReadScriptException: Cannot read SQL script from ServletContext resource [/database/myapp_schema.sql]
Caused by: org.springframework.dao.DataAccessResourceFailureException: Failed to populate database; nested exception is org.springframework.jdbc.datasource.init.CannotReadScriptException: Cannot read SQL script from ServletContext resource [/database/myapp_schema.sql]
Caused by: org.springframework.jdbc.datasource.init.CannotReadScriptException: Cannot read SQL script from ServletContext resource [/database/myapp_schema.sql]
Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/database/myapp_schema.sql]
Other tests using just the #ContextConfiguration annotation find this file and instantiate this bean just fine. Can anyone tell me why the #WebAppConfiguration bean is making it throw up? Here's the configuration section it's telling me won't work:
<jdbc:embedded-database id="caDataSource" type="HSQL">
<jdbc:script location="database/myapp_schema.sql"/>
<jdbc:script location="database/myapp_data.sql"/>
</jdbc:embedded-database>
The files are on the classpath, but they're in a different project - that might be the only wrinkle. Anyone got any ideas, or handy links?
Looks like this is the reason.
When you use WebApplicationContext you lose the ability to use classpath: configuration or other stuff, and are limited to whatever's in /src/main/webapp (or another location as provided).
WebAppContext javadoc is here.

including hibernate-validator breaks existing hibernate configuration

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

Categories

Resources