Error resolving class . Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias

1,167 views
Skip to first unread message

rajesh dr

unread,
Apr 6, 2016, 8:34:10 AM4/6/16
to mybatis-user
Getting below exception when i initialize spring mybatis in linux system...the same is working in different linux machine...how should we resolve such environmental issue?


Error resolving class . Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'lovNode'.  Cause: java.lang.ClassNotFoundException: Cannot find class: lovNode
Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDetailsMapper': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public final void org.mybatis.spring.support.SqlSessionDaoSupport.setSqlSessionFactory(org.apache.ibatis.session.SqlSessionFactory); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [cpdi-database-config.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'class path resource [com/pes/eu/cpdi/persistence/mapper/BaseMapper.xml]'; nested exception is java.lang.RuntimeException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class . Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'lovNode'.  Cause: java.lang.ClassNotFoundException: Cannot find class: lovNode
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:288)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1120)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:522)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:607)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:105)
at com.pes.eu.cpdi.report.job.ContextSetupService.<init>(ContextSetupService.java:62)
at com.pepsico.eu.cpdi.report.job.ProjectSummaryReportBatchJob.main(ProjectSummaryReportBatchJob.java:32)
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: public com.pepsico.eu.cpdi.persistence.BaseMapper com.pepsico.eu.cpdi.service.impl.BaseServiceImpl.baseMapper; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.pepsico.eu.cpdi.persistence.BaseMapper] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:514)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:285)
... 14 more
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.pepsico.eu.cpdi.persistence.BaseMapper] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:949)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:818)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:730)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:486)
... 16 more
Related cause:
o

Rick R

unread,
Apr 6, 2016, 8:48:14 AM4/6/16
to mybati...@googlegroups.com
I find it hard to believe it's working "under one version of Linux" and not an other.  Sounds like you don't have the following class in scope. You've aliased but it can't find it. You sure you have your <property name="typeAliasesPackage" value="com.foo...."/> set up correctly?

Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'lovNode'.  Cause: java.lang.ClassNotFoundException: Cannot find class: lovNode

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mybatis-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Rick R
Reply all
Reply to author
Forward
0 new messages