idea 版本 2018.2
用Idea的run/debug启动一个SpringBoot + Mybatis + dubbo 的项目报错,项目代码和配置文件都没有问题,用maven打包成jar,使用
java -jar 命令可以启动成功! 但是在Idea中就是不可以....
当时相关maven依赖:
出错信息:
2019-08-28 19:38:15.709 INFO 4624 --- [ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'mapper-com.github.pagehelper.autoconfigure.MapperProperties' of type [com.github.pagehelper.autoconfigure.MapperProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-08-28 19:38:15.929 WARN 4624 --- [ restartedMain] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.github.pagehelper.autoconfigure.MapperAutoConfiguration': Invocation of init method failed; nested exception is java.lang.RuntimeException: java.lang.RuntimeException: java.lang.IllegalStateException: No typehandler found for property address
2019-08-28 19:38:18.254 INFO 4624 --- [ restartedMain] com.alibaba.druid.pool.DruidDataSource : {dataSource-1} closed
2019-08-28 19:38:18.254 INFO 4624 --- [ restartedMain] o.s.c.ehcache.EhCacheManagerFactoryBean : Shutting down EhCache CacheManager
2019-08-28 19:38:18.258 INFO 4624 --- [ restartedMain] o.apache.catalina.core.StandardService : Stopping service Tomcat
2019-08-28 19:38:18.266 INFO 4624 --- [ restartedMain] utoConfigurationReportLoggingInitializer :
Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2019-08-28 19:38:18.276 ERROR 4624 --- [ restartedMain] o.s.boot.SpringApplication : Application startup failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.github.pagehelper.autoconfigure.MapperAutoConfiguration': Invocation of init method failed; nested exception is java.lang.RuntimeException: java.lang.RuntimeException: java.lang.IllegalStateException: No typehandler found for property address
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:137) ~[spring-beans-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:409) ~[spring-beans-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1620) ~[spring-beans-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555) ~[spring-beans-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) ~[spring-beans-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761) ~[spring-beans-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:866) ~[spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542) ~[spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) ~[spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:737) [spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:370) [spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:314) [spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1162) [spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1151) [spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE]
at com.ym.platform.ManageServiceApplication.main(ManageServiceApplication.java:49) [classes/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_202]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_202]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_202]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_202]
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) [spring-boot-devtools-1.5.2.RELEASE.jar:1.5.2.RELEASE]
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.IllegalStateException: No typehandler found for property address
at tk.mybatis.mapper.mapperhelper.MapperHelper.setSqlSource(MapperHelper.java:247) ~[mapper-3.3.9.jar:na]
at tk.mybatis.mapper.mapperhelper.MapperHelper.processConfiguration(MapperHelper.java:310) ~[mapper-3.3.9.jar:na]
at tk.mybatis.mapper.mapperhelper.MapperHelper.processConfiguration(MapperHelper.java:289) ~[mapper-3.3.9.jar:na]
at com.github.pagehelper.autoconfigure.MapperAutoConfiguration.addPageInterceptor(MapperAutoConfiguration.java:69) ~[mapper-spring-boot-autoconfigure-1.0.0.jar:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_202]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_202]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_202]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_202]
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:366) ~[spring-beans-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:311) ~[spring-beans-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:134) ~[spring-beans-4.3.7.RELEASE.jar:4.3.7.RELEASE]
... 23 common frames omitted
Caused by: java.lang.RuntimeException: java.lang.IllegalStateException: No typehandler found for property address
at tk.mybatis.mapper.mapperhelper.MapperTemplate.setSqlSource(MapperTemplate.java:246) ~[mapper-3.3.9.jar:na]
at tk.mybatis.mapper.mapperhelper.MapperHelper.setSqlSource(MapperHelper.java:244) ~[mapper-3.3.9.jar:na]
... 33 common frames omitted
Caused by: java.lang.IllegalStateException: No typehandler found for property address
at org.apache.ibatis.mapping.ResultMapping$Builder.validate(ResultMapping.java:151) ~[mybatis-3.4.4.jar:3.4.4]
at org.apache.ibatis.mapping.ResultMapping$Builder.build(ResultMapping.java:140) ~[mybatis-3.4.4.jar:3.4.4]
at tk.mybatis.mapper.entity.EntityTable.getResultMap(EntityTable.java:212) ~[mapper-3.3.9.jar:na]
at tk.mybatis.mapper.mapperhelper.MapperTemplate.setResultType(MapperTemplate.java:165) ~[mapper-3.3.9.jar:na]
at tk.mybatis.mapper.provider.ExampleProvider.selectByExample(ExampleProvider.java:82) ~[mapper-3.3.9.jar:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_202]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_202]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_202]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_202]
at tk.mybatis.mapper.mapperhelper.MapperTemplate.setSqlSource(MapperTemplate.java:234) ~[mapper-3.3.9.jar:na]
... 34 common frames omitted
后来装了JRebel 插件,用其启动项目,成功....不知道是为什么???