1. 程式人生 > >No converter found capable of converting from type有沒有大佬解決一下這個問題

No converter found capable of converting from type有沒有大佬解決一下這個問題

[  restartedMain] t.m.s.annotation.MapperScannerRegistrar  : 只有 Spring Boot 環境中可以通過 Environment(配置檔案,環境變數,執行引數等方式) 配置通用 Mapper,其他環境請通過 @MapperScan 註解中的 mapperHelperRef 或 properties 引數進行配置!如果你使用 tk.mybatis.mapper.session.Configuration 配置的通用 Mapper,你可以忽略該錯誤!


java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at tk.mybatis.spring.mapper.SpringBootBindUtil$SpringBoot2Bind.bind(SpringBootBindUtil.java:133) ~[mapper-spring-1.0.0.jar:na]
at tk.mybatis.spring.mapper.SpringBootBindUtil.bind(SpringBootBindUtil.java:58) ~[mapper-spring-1.0.0.jar:na]
at tk.mybatis.spring.mapper.ClassPathMapperScanner.setMapperProperties(ClassPathMapperScanner.java:274) ~[mapper-spring-1.0.0.jar:na]
at tk.mybatis.spring.annotation.MapperScannerRegistrar.registerBeanDefinitions(MapperScannerRegistrar.java:103) ~[mapper-spring-1.0.0.jar:na]
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.lambda$loadBeanDefinitionsFromRegistrars$1(ConfigurationClassBeanDefinitionReader.java:357) [spring-context-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at java.util.LinkedHashMap.forEach(LinkedHashMap.java:684) ~[na:1.8.0_121]
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsFromRegistrars(ConfigurationClassBeanDefinitionReader.java:356) [spring-context-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:144) [spring-context-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:117) [spring-context-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:328) ~[spring-context-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:233) ~[spring-context-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:273) ~[spring-context-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:93) ~[spring-context-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:694) ~[spring-context-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:532) ~[spring-context-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:395) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:327) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1255) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1243) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at com.sszy.ShanYuanAppApplication.main(ShanYuanAppApplication.java:13) ~[classes/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_121]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_121]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_121]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_121]
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) ~[spring-boot-devtools-2.0.1.RELEASE.jar:2.0.1.RELEASE]
Caused by: java.lang.reflect.InvocationTargetException: null
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_121]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_121]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_121]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_121]
at tk.mybatis.spring.mapper.SpringBootBindUtil$SpringBoot2Bind.bind(SpringBootBindUtil.java:125) ~[mapper-spring-1.0.0.jar:na]
... 26 common frames omitted
Caused by: org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'mapper.mappers' to java.util.List<java.lang.Class<?>>
at org.springframework.boot.context.properties.bind.Binder.handleBindError(Binder.java:250) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:226) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.context.properties.bind.Binder.lambda$bindBean$4(Binder.java:334) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:73) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:62) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:54) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.context.properties.bind.Binder.lambda$null$5(Binder.java:342) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[na:1.8.0_121]
at java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1351) ~[na:1.8.0_121]
at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126) ~[na:1.8.0_121]
at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498) ~[na:1.8.0_121]
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485) ~[na:1.8.0_121]
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) ~[na:1.8.0_121]
at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152) ~[na:1.8.0_121]
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:1.8.0_121]
at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464) ~[na:1.8.0_121]
at org.springframework.boot.context.properties.bind.Binder.lambda$bindBean$6(Binder.java:343) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.context.properties.bind.Binder$Context.withIncreasedDepth(Binder.java:442) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.context.properties.bind.Binder$Context.withBean(Binder.java:428) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.context.properties.bind.Binder$Context.access$400(Binder.java:382) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.context.properties.bind.Binder.bindBean(Binder.java:340) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.context.properties.bind.Binder.bindObject(Binder.java:279) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:221) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:210) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:166) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:153) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
... 31 common frames omitted
Caused by: org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [java.lang.String] to type [java.util.List<java.lang.Class<?>>]
at org.springframework.core.convert.support.GenericConversionService.handleConverterNotFound(GenericConversionService.java:321) ~[spring-core-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.core.convert.support.GenericConversionService.convert(GenericConversionService.java:194) ~[spring-core-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.boot.context.properties.bind.BindConverter$CompositeConversionService.convert(BindConverter.java:162) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.context.properties.bind.BindConverter.convert(BindConverter.java:96) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.context.properties.bind.IndexedElementsBinder.convert(IndexedElementsBinder.java:143) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.context.properties.bind.IndexedElementsBinder.bindIndexed(IndexedElementsBinder.java:84) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.context.properties.bind.IndexedElementsBinder.bindIndexed(IndexedElementsBinder.java:70) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.context.properties.bind.CollectionBinder.bindAggregate(CollectionBinder.java:50) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.context.properties.bind.AggregateBinder.bind(AggregateBinder.java:58) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.context.properties.bind.Binder.lambda$bindAggregate$2(Binder.java:306) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.context.properties.bind.Binder$Context.withIncreasedDepth(Binder.java:442) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.context.properties.bind.Binder$Context.access$100(Binder.java:382) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.context.properties.bind.Binder.bindAggregate(Binder.java:305) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.context.properties.bind.Binder.bindObject(Binder.java:263) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:221) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
... 55 common frames omitted


2018-05-16 16:34:31.225 ERROR 2372 --- [  restartedMain] o.s.b.d.LoggingFailureAnalysisReporter   : 


***************************
APPLICATION FAILED TO START
***************************


Description:


Failed to bind properties under 'mapper.mappers' to java.util.List<java.lang.Class<?>>:


    Reason: No converter found capable of converting from type [java.lang.String] to type [java.util.List<java.lang.Class<?>>]


Action:


Update your application's configuration


2018-05-16 16:34:31.227  INFO 2372 --- [  restartedMain] ConfigServletWebServerApplicationContext : Closing org.springframework.boot.web.ser
[email protected]
4c29fd44: startup date [Wed May 16 16:34:29 CST 2018]; root of context hierarchy

相關推薦

No converter found capable of converting from type沒有解決一下這個問題

[  restartedMain] t.m.s.annotation.MapperScannerRegistrar  : 只有 Spring Boot 環境中可以通過 Environment(配置檔案,環境變數,執行引數等方式) 配置通用 Mapper,其他環境請通過 @Ma

No converter found capable of converting from type [java.lang.String] to type

2018-08-13 14:01:51.885 ERROR 10244 --- [nio-8082-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] :

170616、解決 java.lang.IllegalArgumentException: No converter found for return value of type: class java.util.ArrayList

pen group string image exception bean val 轉換 技術 報錯截圖: 原因:搭建項目的時候,springmvc默認是沒有對象轉換成json的轉換器的,需要手動添加jackson依賴。 解決步驟: 1、添加jackson依賴到pom

解決java.lang.IllegalArgumentException: No converter found for return value of type: class java.util.ArrayList這個問題

method posit adapt orm ask resp 運行 poi erro 今天使用SSM框架,用@ResponseBody註解,出現了這個問題 java.lang.IllegalArgumentException: No converter found f

java.lang.IllegalArgumentException: No converter found for return value of type: class com.smart.result.Page

lang spring cep 問題 ava 列表 convert 調用 val 今天學習了一下spring boot 中的mybatis,用mybatis來增刪改查用戶,獲取用戶,添加用戶,修改用戶,刪除用戶,修改用戶,都是可以的,但是獲取帶分頁的用戶列表,一直拋出這個j

【Spring】No converter found for return value of type: class java.util.ArrayList

ase eno java frame tpm 更改 ref convert framework 錯誤信息: org.springframework.http.converter.HttpMessageNotWritableException: No converter fo

關於java.lang.IllegalArgumentException: No converter found for return value of type: class 的問題解決

1:此問題是responseBody返回的資料無法轉換成JSON格式資料 2:解決辦法 首先引入相關的jar包:         <dependency>     

springMVC報java.lang.IllegalArgumentException: No converter found for return value of type異常

問題描述:使用springMVC框架,用@responseBody返回物件的json資料,報出此異常。 部分程式碼: @ResponseBody public Result query(HttpServletRequest request, HttpServletResponse respons

springMvc中介面返回結果轉換報錯:No converter found for return value of type: class java.util.ArrayList

1.在spring web服務中介面返回結果報錯問題 org.springframework.http.converter.HttpMessageNotWritableException: No converter found for return value of typ

java.lang.IllegalArgumentException: No converter found for return value of type: class java.util.Arr

java.lang.IllegalArgumentException: No converter found for return value of type: class java.util.ArrayList c錯誤 在搭建ssm的專案時出現了上面所說的錯誤,出現這個錯誤的原

SpringMVC返回JSON提示:HttpMessageNotWritableException: No converter found for return value of type

目錄 一、問題描述 1.今天使用[email protected]返回JSON資料格式的時候發現提示下面的錯誤 2.錯誤內容為:Failed to write HTTP message: org.springframework.http.con

No converter found for return value of type: class cn.e3mall.pojo.TbItem

缺少轉換器沒有jacksonjar包,匯入下面依賴就可以了 <dependency>                 <groupId>com.

No converter found for return value of type: class java.util.ArrayList

這個問題困擾了許久,終於解決了。 先說下專案環境,因為不同的版本,配置會略有不同,下面稍有提及。 專案環境:jdk1.8 + spring4.3.5 + jackson2.7.4 方法報404錯誤,檢視控制檯輸出,發現報錯資訊java.lang.IllegalArgumentExceptio

SSM報錯:No converter found for return value of type: class java.util.ArrayList at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageC

我使用的是SSM框架,是在編寫測試RESTFUL介面的時候出現, @RequestMapping(value = "/selectAll", method = RequestMethod.GET) @ResponseBody public ResponseEntity<List&

spring boot:No converter found for return value of type: class另類解決辦法

開發過程中遇到這個報錯:No converter found for return value of type: class  請求返回的資料無法轉換,需要新增配置: <dependency>     <groupId>com.fasterxml

解決java.lang.IllegalArgumentException: No converter found for return value of type 的問題

controller返回一個dto,並且定義了@ResponseBody註解,表示希望將這個dto物件轉換為json字串返回給前端,但是執行時報錯:nested exception is java.lang.IllegalArgumentException: No converter found for re

解決返回JSON時報錯:No converter found for return value of type:

exception org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.IllegalArgumentExc

java.lang.IllegalArgumentException: No converter found for return value of type: class java.util.Has

今天使用了一個開源專案 是基於SpringMVC架構編寫的專案  發現在Controller里加入@ResponseBody註解之後 返回的型別轉換成JSON物件會出錯  控制檯裡反饋 org.springframework.web.util.Nested

SpringBoot2.X 遭遇 No converter found for return value of type: class java.util.LinkedHashMap

前幾天,在專案上線時遭遇了 No converter found for return value of type: class java.util.LinkedHashMap 異常,異常的糟心唉。。。 場景重現: return 基本型別木有問題,但是retur

No converter found for return value of type: class com.taotao.pojo.TbItem

 1.原因:這是因為springmvc預設是沒有物件轉換成json的轉換器的,需要手動新增jackson依賴。   2.解決步驟:     手動新增jackson依賴到pom.xml檔案中 <properties> <jackson.v