while running my app it's giving error "context initialization failed" - java

while running my spring security application i'm getting the error.
This is the Error Stack
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#18': Cannot create inner bean '(inner bean)' of type [org.springframework.security.web.access.AccessDeniedHandlerImpl] while setting bean property 'accessDeniedHandler'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#20': Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'errorPage' threw exception; nested exception is java.lang.IllegalArgumentException: errorPage must begin with '/'at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean (BeanDefinitionValueResolver.java:279)at springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary (BeanDefinitionValueResolver.java:126)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues (AbstractAutowireCapableBeanFactory.java:1417)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean (AbstractAutowireCapableBeanFactory.java:1158)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean (AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean (AbstractAutowireCapableBeanFactory.java:458)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean (BeanDefinitionValueResolver.java:269)
... 40 more
Caused by: org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'org.springframework.security.web.DefaultSecurityFilterChain#0': Cannot create inner bean '(inner bean)' of type [org.springframework.security.web.access.ExceptionTranslationFilter] while setting constructor argument with key [9]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean) #18': Cannot create inner bean '(inner bean)' of type [org.springframework.security.web.access.AccessDeniedHandlerImpl] while setting bean property 'accessDeniedHandler'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#20': Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'errorPage' threw exception; nested exception is java.lang.IllegalArgumentException: errorPage must begin with '/'
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean (BeanDefinitionValueResolver.java:279)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary (BeanDefinitionValueResolver.java:126)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList (BeanDefinitionValueResolver.java:350)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary (BeanDefinitionValueResolver.java:154)
at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments (ConstructorResolver.java:623)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor (ConstructorResolver.java:148)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor (AbstractAutowireCapableBeanFactory.java:1075)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance (AbstractAutowireCapableBeanFactory.java:979)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean (AbstractAutowireCapableBeanFactory.java:487)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean (AbstractAutowireCapableBeanFactory.java:458)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject (AbstractBeanFactory.java:296)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton (DefaultSingletonBeanRegistry.java:223)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (AbstractBeanFactory.java:293)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean (AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference (BeanDefinitionValueResolver.java:320)
... 26 more

In the stack trace it's said errorPage must begin with '/'
You need to modify the entry in your *-security.xml file:
<security:access-denied-handler error-page="/<Your error page controller name>" />
Example:
<security:access-denied-handler error-page="/MyPage.htm" />
Error page must always start with "/"

Related

Exeception while running spring jar application file

Question:
If I run the jar file that I made with the spring application,That Shows an exception that a beans cannot be created. Ironically, it works fine in my local IntelliJ IDE. An exception occurs if I just run it in cmd.
How can I solve this?
-- Exception Log -- (after changed class name : cart)
2022-08-27 23:46:58.159 WARN 7816 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'boardController' defined in URL [jar:file:/C:/BoardGameShop/board-1.0.0.jar!/BOOT-INF/classes!/forum/board/controller/BoardController.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'itemService' defined in URL [jar:file:/C:/BoardGameShop/board-1.0.0.jar!/BOOT-INF/classes!/forum/board/service/ItemService.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'mybatisItemRepository' defined in URL [jar:file:/C:/BoardGameShop/board-1.0.0.jar!/BOOT-INF/classes!/forum/board/repository/MybatisItemRepository.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'itemMapper' defined in URL [jar:file:/C:/BoardGameShop/board-1.0.0.jar!/BOOT-INF/classes!/forum/board/repository/mybatisMapper/ItemMapper.class]: Cannot resolve reference to bean 'sqlSessionTemplate' while setting bean property 'sqlSessionTemplate'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sqlSessionTemplate' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Unsatisfied dependency expressed through method 'sqlSessionTemplate' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'class path resource [mapper/forum/cartMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'class path resource [mapper/forum/cartMapper.xml]'. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'cart'. Cause: java.lang.ClassNotFoundException: Cannot find class: cart
2022-08-27 23:46:58.162 INFO 7816 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2022-08-27 23:46:58.170 INFO 7816 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2022-08-27 23:46:58.187 ERROR 7816 --- [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'boardController' defined in URL [jar:file:/C:/BoardGameShop/board-1.0.0.jar!/BOOT-INF/classes!/forum/board/controller/BoardController.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'itemService' defined in URL [jar:file:/C:/BoardGameShop/board-1.0.0.jar!/BOOT-INF/classes!/forum/board/service/ItemService.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'mybatisItemRepository' defined in URL [jar:file:/C:/BoardGameShop/board-1.0.0.jar!/BOOT-INF/classes!/forum/board/repository/MybatisItemRepository.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'itemMapper' defined in URL [jar:file:/C:/BoardGameShop/board-1.0.0.jar!/BOOT-INF/classes!/forum/board/repository/mybatisMapper/ItemMapper.class]: Cannot resolve reference to bean 'sqlSessionTemplate' while setting bean property 'sqlSessionTemplate'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sqlSessionTemplate' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Unsatisfied dependency expressed through method 'sqlSessionTemplate' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'class path resource [mapper/forum/cartMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'class path resource [mapper/forum/cartMapper.xml]'. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'cart'. Cause: java.lang.ClassNotFoundException: Cannot find class: cart
... skip
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'itemService' defined in URL [jar:file:/C:/BoardGameShop/board-1.0.0.jar!/BOOT-INF/classes!/forum/board/service/ItemService.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'mybatisItemRepository' defined in URL [jar:file:/C:/BoardGameShop/board-1.0.0.jar!/BOOT-INF/classes!/forum/board/repository/MybatisItemRepository.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'itemMapper' defined in URL [jar:file:/C:/BoardGameShop/board-1.0.0.jar!/BOOT-INF/classes!/forum/board/repository/mybatisMapper/ItemMapper.class]: Cannot resolve reference to bean 'sqlSessionTemplate' while setting bean property 'sqlSessionTemplate'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sqlSessionTemplate' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Unsatisfied dependency expressed through method 'sqlSessionTemplate' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'class path resource [mapper/forum/cartMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'class path resource [mapper/forum/cartMapper.xml]'. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'cart'. Cause: java.lang.ClassNotFoundException: Cannot find class: cart
... skip
... 27 common frames omitted
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'mybatisItemRepository' defined in URL [jar:file:/C:/BoardGameShop/board-1.0.0.jar!/BOOT-INF/classes!/forum/board/repository/MybatisItemRepository.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'itemMapper' defined in URL [jar:file:/C:/BoardGameShop/board-1.0.0.jar!/BOOT-INF/classes!/forum/board/repository/mybatisMapper/ItemMapper.class]: Cannot resolve reference to bean 'sqlSessionTemplate' while setting bean property 'sqlSessionTemplate'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sqlSessionTemplate' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Unsatisfied dependency expressed through method 'sqlSessionTemplate' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'class path resource [mapper/forum/cartMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'class path resource [mapper/forum/cartMapper.xml]'. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'cart'. Cause: java.lang.ClassNotFoundException: Cannot find class: cart
... skip
... 41 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'itemMapper' defined in URL [jar:file:/C:/BoardGameShop/board-1.0.0.jar!/BOOT-INF/classes!/forum/board/repository/mybatisMapper/ItemMapper.class]: Cannot resolve reference to bean 'sqlSessionTemplate' while setting bean property 'sqlSessionTemplate'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sqlSessionTemplate' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Unsatisfied dependency expressed through method 'sqlSessionTemplate' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'class path resource [mapper/forum/cartMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'class path resource [mapper/forum/cartMapper.xml]'. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'cart'. Cause: java.lang.ClassNotFoundException: Cannot find class: cart
... skip
... 55 common frames omitted
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sqlSessionTemplate' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Unsatisfied dependency expressed through method 'sqlSessionTemplate' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'class path resource [mapper/forum/cartMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'class path resource [mapper/forum/cartMapper.xml]'. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'cart'. Cause: java.lang.ClassNotFoundException: Cannot find class: cart
... skip
... 69 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'class path resource [mapper/forum/cartMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'class path resource [mapper/forum/cartMapper.xml]'. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'cart'. Cause: java.lang.ClassNotFoundException: Cannot find class: cart
... skip
... 79 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'class path resource [mapper/forum/cartMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'class path resource [mapper/forum/cartMapper.xml]'. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'cart'. Cause: java.lang.ClassNotFoundException: Cannot find class: cart
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.3.21.jar!/:5.3.21]
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653) ~[spring-beans-5.3.21.jar!/:5.3.21]
... 93 common frames omitted
Caused by: org.springframework.core.NestedIOException: Failed to parse mapping resource: 'class path resource [mapper/forum/cartMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'class path resource [mapper/forum/cartMapper.xml]'. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'cart'. Cause: java.lang.ClassNotFoundException: Cannot find class: cart
... skip
... 94 common frames omitted
Caused by: org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'class path resource [mapper/forum/cartMapper.xml]'. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'cart'. Cause: java.lang.ClassNotFoundException: Cannot find class: cart
... skip
... 107 common frames omitted
Caused by: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'cart'. Cause: java.lang.ClassNotFoundException: Cannot find class: cart
... skip
... 109 common frames omitted
Caused by: org.apache.ibatis.type.TypeException: Could not resolve type alias 'cart'. Cause: java.lang.ClassNotFoundException: Cannot find class: cart
... skip
... 113 common frames omitted
Caused by: java.lang.ClassNotFoundException: Cannot find class: cart
... skip
... 115 common frames omitted
(Edit)
I checked the Mybatis log and found that sqlSessionFactoryBean was referring to the mapper xml file in another directory.
I would like to have sqlSessionFactoryBean refer to the mapper.xml that I wrote.
But, I don't know how.
1)application.properties setting
(username and password were hidden for security purposes)
2)Mybatis Log
mapper.xml Location that I wrote
src > main > resources > mapper > forum > *.xml

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

Alfresco compatibility with Existing Oracle DB

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)

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)

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