TK Mapper General mapper Bug

Source: Internet
Author: User
<bean class= "Tk.mybatis.spring.mapper.MapperScannerConfigurer" >
            <property name= "Basepackage" value= " Com.isea533.mybatis.mapper "/>
            <property name=" Properties ">
                <value>
                    mappers= Tk.mybatis.mapper.common.Mapper
                </value>
            </property>
        </bean>

The Basepackage property value cannot contain the package where the generic mapper resides

Error starting ApplicationContext.
To display the Auto-configuration report re-run your application with ' debug ' enabled.
2018-03-14 12:39:21.741 ERROR [main] [Hio-sys] o.s.boot.springapplication-application startup failed Org.springframework.beans.factory.BeanCreationException:Error creating bean with Name ' Tk.mybatis.mapper.autoconfigure.MapperAutoConfiguration ': Invocation of Init method failed; Nested exception is org.springframework.beans.factory.BeanCreationException:Error creating beans with Name ' Basemapper ' defined in file []: Invocation of Init method failed; Nested exception is tk.mybatis.mapper.MapperException:tk.mybatis.mapper.MapperException: Java.lang.ClassCastException:sun.reflect.generics.reflectiveObjects.TypeVariableImpl cannot is cast to Java.lang.Class at Org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization (initdestroyannotationbeanpostprocessor.java:137) at Org.springframework.beans.factoRy.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization ( abstractautowirecapablebeanfactory.java:409) at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean ( abstractautowirecapablebeanfactory.java:1620) at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean ( abstractautowirecapablebeanfactory.java:555) at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean ( abstractautowirecapablebeanfactory.java:483) at org.springframework.beans.factory.support.abstractbeanfactory$1. GetObject (abstractbeanfactory.java:306) at Org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton ( defaultsingletonbeanregistry.java:230) at Org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (abstractbeanfactory.java:302) at Org.springframework.beans.factory.support.AbstractBeanFactory.getBean (Abstractbeanfactory.java:197) at Org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons ( defaultlistablebeanfactory.java:761) at Org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization ( abstractapplicationcontext.java:867) at Org.springframework.context.support.abstractapplicationcontext.__refresh (abstractapplicationcontext.java:543) at Org.springframework.context.support.AbstractApplicationContext.jrLockAndRefresh ( Abstractapplicationcontext.java) at Org.springframework.context.support.AbstractApplicationContext.refresh ( Abstractapplicationcontext.java) at Org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh ( embeddedwebapplicationcontext.java:122) at Org.springframework.boot.SpringApplication.refresh ( springapplication.java:693) at Org.springframework.boot.SpringApplication.refreshContext (Springapplication.java : at Org.springframework.boot.SpringApplication.Run (springapplication.java:303) at Com.jzy.hio.HioSysApplication.main (hiosysapplication.java:35) caused by: Org.springframework.beans.factory.BeanCreationException:Error creating Bean with Name ' basemapper ' defined in file [C + + Users\coffee\onedrive\workspace\v2r1-hio-base\target\classes\com\jzy\hio\base\mapper\basemapper.class]: Invocation of Init method failed; Nested exception is tk.mybatis.mapper.MapperException:tk.mybatis.mapper.MapperException: Java.lang.ClassCastException:sun.reflect.generics.reflectiveObjects.TypeVariableImpl cannot is cast to Java.lang.Class at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean ( abstractautowirecapablebeanfactory.java:1628) at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean ( abstractautowirecapablebeanfactory.java:555) at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean ( Abstractautowirecapablebeanfactory.java:483) at Org.springframework.beans.factory.support.abstractbeanfactory$1.getobject (AbstractBeanFactory.java:306 ) at Org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton ( defaultsingletonbeanregistry.java:230) at Org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (abstractbeanfactory.java:302) at Org.springframework.beans.factory.support.AbstractBeanFactory.getBean (abstractbeanfactory.java:202) at Org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType_jrOrig ( defaultlistablebeanfactory.java:519) at Org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType ( Defaultlistablebeanfactory.java) at Org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType_jrOrig ( defaultlistablebeanfactory.java:508) at Org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType ( Defaultlistablebeanfactory.java) at ORG.SPRINGFRamework.context.support.AbstractApplicationContext.getBeansOfType (abstractapplicationcontext.java:1188) at Tk.mybatis.mapper.autoconfigure.MapperAutoConfiguration.addPageInterceptor (mapperautoconfiguration.java:71) at SUN.REFLECT.NATIVEMETHODACCESSORIMPL.INVOKE0 (Native Method) at Sun.reflect.NativeMethodAccessorImpl.invoke ( nativemethodaccessorimpl.java:62) at Sun.reflect.delegatingmethodaccessorimpl.__invoke ( delegatingmethodaccessorimpl.java:43) at Sun.reflect.DelegatingMethodAccessorImpl.invoke ( Delegatingmethodaccessorimpl.java) at Sun.reflect.DelegatingMethodAccessorImpl.invoke ( Delegatingmethodaccessorimpl.java) at Java.lang.reflect.Method.invoke (method.java:498) at Org.springframework.bean S.factory.annotation.initdestroyannotationbeanpostprocessor$lifecycleelement.invoke ( initdestroyannotationbeanpostprocessor.java:366) at org.springframework.beans.factory.annotation.initdestroyannotationbeanpostprocessor$ Lifecyclemetadata.invokeinitmethods (initdestroyannotationbeanpostprocessor.java:311) at Org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization (initdestroyannotationbeanpostprocessor.java:134) ... Common frames omitted caused by:tk.mybatis.mapper.MapperException:tk.mybatis.mapper.MapperException: Java.lang.ClassCastException:sun.reflect.generics.reflectiveObjects.TypeVariableImpl cannot is cast to Java.lang.Class at Tk.mybatis.mapper.mapperhelper.MapperHelper.setSqlSource (mapperhelper.java:248) at TK.MYBATIS.M Apper.mapperhelper.MapperHelper.processConfiguration (mapperhelper.java:311) at Tk.mybatis.spring.mapper.MapperFactoryBean.checkDaoConfig (mapperfactorybean.java:54) at Org.springframework.dao.support.DaoSupport.afterPropertiesSet (daosupport.java:44) at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods ( abstractautowirecapablebeanfactory.java:1687) at Org.springframework.beans.factory. Support. Abstractautowirecapablebeanfactory.initializebean (abstractautowirecapablebeanfactory.java:1624) ... Common frames omitted caused by:tk.mybatis.mapper.MapperException:java.lang.ClassCastException: Sun.reflect.generics.reflectiveObjects.TypeVariableImpl cannot is cast to Java.lang.Class at Tk.mybatis.mapper.mapper Helper. Mappertemplate.setsqlsource (mappertemplate.java:258) at Tk.mybatis.mapper.mapperhelper.MapperHelper.setSqlSource (mapperhelper.java:245) ... Common frames omitted caused by:java.lang.ClassCastException: Sun.reflect.generics.reflectiveObjects.TypeVariableImpl cannot is cast to Java.lang.Class at Tk.mybatis.mapper.mapper Helper. Mappertemplate.getentityclass (mappertemplate.java:290) at Tk.mybatis.mapper.provider.base.BaseSelectProvider.selectOne (BASESELECTPROVIDER.JAVA:50) at SUN.REFLECT.NATIVEMETHODACCESSORIMPL.INVOKE0 (Native Method) at Sun.reflect.NativeMethodAccessorImpl.invoke ( nativemethodaccessorimpl.java:62) at Sun.reFlect. Delegatingmethodaccessorimpl.__invoke (delegatingmethodaccessorimpl.java:43) at Sun.reflect.DelegatingMethodAccessorImpl.invoke (Delegatingmethodaccessorimpl.java) at Sun.reflect.DelegatingMethodAccessorImpl.invoke (Delegatingmethodaccessorimpl.java) at Java.lang.reflect.Method.invoke (method.java:498) at Tk.mybatis.mapper.mapperhelper.MapperTemplate.setSqlSource ( mappertemplate.java:246) ... Common frames omitted

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.