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
Related
I am currently working on an application that fails to run after upgrading to a newer snapshot version of a custom 3rd party dependency. Upon using this updated dependency I get the following error
java.lang.IllegalStateException: Failed to load ApplicationContext
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'listener': Unsatisfied dependency expressed through field 'mapper'; nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'objectMapper' defined in class path resource [com/****/****/****/WebMvcConfig.class]: Bean instantiation via factory method failed;
nested exception is org.springframework.beans.BeanInstantiationException:
Failed to instantiate [com.fasterxml.jackson.databind.ObjectMapper]: Factory method 'objectMapper' threw exception; nested exception is java.lang.NullPointerException
The 'mapper' is what I am using locally, 'objectMapper' refers to a remote dependency. I realize this is may be challenging without code, but what could be causing this error? If I remove my objectmapper instance, the error only shifts to another section of the program, but the stack trace always leads to this:
Error creating bean with name 'objectMapper' defined in class path resource [com/****/****/****/WebMvcConfig.class]: Bean instantiation via factory method failed;
nested exception is org.springframework.beans.BeanInstantiationException:
Failed to instantiate [com.fasterxml.jackson.databind.ObjectMapper]: Factory method 'objectMapper' threw exception; nested exception is java.lang.NullPointerException
Ive tried different versions of com.fasterxml.jackson.core but that does not seem to help. Any suggestions at all would be appreciated.
Edit:
Additional Stack Trace:
java.lang.IllegalStateException: Failed to load ApplicationContext
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'cashModule' defined in file
[/Users/*****/******/*******/target/classes/*****/****/****/*****/cashModule.class]: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'service5' defined in file
[/Users/****/******/******/target/classes/****/****/*****/*****/EventProcessingService.class]: Unsatisfied dependency expressed through constructor parameter 0;
nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'eventSource' defined in class path resource [com/****/****/****/******/EventConfig.class]:
Unsatisfied dependency expressed through method 'eventSource' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.cloud.stream.messaging.Source': Unsatisfied dependency expressed through field 'bindingTargetFactories'; nested exception is
org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'channelFactory' defined in class path resource [org/springframework/cloud/stream/config/BinderFactoryConfiguration.class]: Unsatisfied dependency expressed through method 'channelFactory' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'compositeMessageChannelConfigurer' defined in class path resource [org/springframework/cloud/stream/config/BinderFactoryConfiguration.class]: Unsatisfied dependency expressed through method 'compositeMessageChannelConfigurer' parameter 0;
nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'messageConverterConfigurer' defined in class path resource
[org/springframework/cloud/stream/config/BinderFactoryConfiguration.class]: Unsatisfied dependency expressed through method 'messageConverterConfigurer' parameter 1; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'compositeMessageConverterFactory' defined in class path resource [org/springframework/cloud/stream/config/ContentTypeConfiguration.class]:
Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.stream.converter.CompositeMessageConverterFactory]: Factory method 'compositeMessageConverterFactory' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'objectMapper' defined in class path resource
[com/****/****/*****/WebMvcConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.fasterxml.jackson.databind.ObjectMapper]: Factory method 'objectMapper' threw exception; nested exception is java.lang.NullPointerException
Ignoring bean creation exception on FactoryBean type check: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userMapper' defined in file:
Unsatisfied dependency expressed through bean property 'sqlSessionFactory': : Error creating bean with name 'sqlSessionFactory' defined in class path resource [config/spring-mybatis.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [D:\Program Files\apache-tomcat-8.0.33\me-webapps\yftj-web\WEB-INF\classes\cn\scyf\hmss\mapper\OrderMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error creating document instance.
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)
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)