@ApiOperation(value=“创建用户”, notes=“传递复杂对象,url参数拼接”,produces = “application/json”)
@RequestMapping(value="/swagger/user", method= RequestMethod.POST)
/*传递对象推荐使用ModelAttribute注解,依赖springfox-swagger2和springfox-swagger-ui更新2.7.0即可,低版本会报错/
public User postUser2(@ModelAttribute User user) {
user = new User(1,“grandhappy”,“123456”,1);
return user;
}
Error starting ApplicationContext. To display the auto-configuration report re-run your application with ‘debug’ enabled.
2019-05-10 16:02:26.107 ERROR 6684 — [ main] o.s.boot.SpringApplication : Application startup failed
org.springframework.context.ApplicationContextException: Failed to start bean ‘documentationPluginsBootstrapper’; nested exception is com.google.common.util.concurrent.ExecutionError: java.lang.StackOverflowError
at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:178) ~[spring-context-4.3.9.RELEASE.jar:4.3.9.RELEASE]
at org.springframework.context.support.DefaultLifecycleProcessor.access 200 ( D e f a u l t L i f e c y c l e P r o c e s s o r . j a v a : 50 ) [ s p r i n g − c o n t e x t − 4.3.9. R E L E A S E . j a r : 4.3.9. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . c o n t e x t . s u p p o r t . D e f a u l t L i f e c y c l e P r o c e s s o r 200(DefaultLifecycleProcessor.java:50) ~[spring-context-4.3.9.RELEASE.jar:4.3.9.RELEASE] at org.springframework.context.support.DefaultLifecycleProcessor 200(DefaultLifecycleProcessor.java:50) [spring−context−4.3.9.RELEASE.jar:4.3.9.RELEASE]atorg.springframework.context.support.DefaultLifecycleProcessorLifecycleGroup.start(DefaultLifecycleProcessor.java:348) ~[spring-context-4.3.9.RELEASE.jar:4.3.9.RELEASE]
at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:151) ~[spring-context-4.3.9.RELEASE.jar:4.3.9.RELEASE]
at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:114) ~[spring-context-4.3.9.RELEASE.jar:4.3.9.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:880) ~[spring-context-4.3.9.RELEASE.jar:4.3.9.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:144) ~[spring-boot-1.5.4.RELEASE.jar:1.5.4.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546) ~[spring-context-4.3.9.RELEASE.jar:4.3.9.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) ~[spring-boot-1.5.4.RELEASE.jar:1.5.4.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693) [spring-boot-1.5.4.RELEASE.jar:1.5.4.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360) [spring-boot-1.5.4.RELEASE.jar:1.5.4.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) [spring-boot-1.5.4.RELEASE.jar:1.5.4.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118) [spring-boot-1.5.4.RELEASE.jar:1.5.4.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107) [spring-boot-1.5.4.RELEASE.jar:1.5.4.RELEASE]
at cn.net.sexygirls.App.main(App.java:16) [classes/:na]
Caused by: com.google.common.util.concurrent.ExecutionError: java.lang.StackOverflowError
at com.google.common.cache.LocalCache S e g m e n t . g e t ( L o c a l C a c h e . j a v a : 2201 ) [ g u a v a − 18.0. j a r : n a ] a t c o m . g o o g l e . c o m m o n . c a c h e . L o c a l C a c h e . g e t ( L o c a l C a c h e . j a v a : 3937 ) [ g u a v a − 18.0. j a r : n a ] a t c o m . g o o g l e . c o m m o n . c a c h e . L o c a l C a c h e . g e t O r L o a d ( L o c a l C a c h e . j a v a : 3941 ) [ g u a v a − 18.0. j a r : n a ] a t c o m . g o o g l e . c o m m o n . c a c h e . L o c a l C a c h e Segment.get(LocalCache.java:2201) ~[guava-18.0.jar:na] at com.google.common.cache.LocalCache.get(LocalCache.java:3937) ~[guava-18.0.jar:na] at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3941) ~[guava-18.0.jar:na] at com.google.common.cache.LocalCache Segment.get(LocalCache.java:2201) [guava−18.0.jar:na]atcom.google.common.cache.LocalCache.get(LocalCache.java:3937) [guava−18.0.jar:na]atcom.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3941) [guava−18.0.jar:na]atcom.google.common.cache.LocalCacheLocalLoadingCache.get(LocalCache.java:4824) ~[guava-18.0.jar:na]
at com.google.common.cache.LocalCache L o c a l L o a d i n g C a c h e . g e t U n c h e c k e d ( L o c a l C a c h e . j a v a : 4830 ) [ g u a v a − 18.0. j a r : n a ] a t s p r i n g f o x . d o c u m e n t a t i o n . s p r i n g . w e b . s c a n n e r s . C a c h i n g O p e r a t i o n R e a d e r . r e a d ( C a c h i n g O p e r a t i o n R e a d e r . j a v a : 57 ) [ s p r i n g f o x − s p r i n g − w e b − 2.6.1. j a r : 2.6.1 ] a t s p r i n g f o x . d o c u m e n t a t i o n . s p r i n g . w e b . s c a n n e r s . A p i D e s c r i p t i o n R e a d e r . r e a d ( A p i D e s c r i p t i o n R e a d e r . j a v a : 66 ) [ s p r i n g f o x − s p r i n g − w e b − 2.6.1. j a r : 2.6.1 ] a t s p r i n g f o x . d o c u m e n t a t i o n . s p r i n g . w e b . s c a n n e r s . A p i L i s t i n g S c a n n e r . s c a n ( A p i L i s t i n g S c a n n e r . j a v a : 89 ) [ s p r i n g f o x − s p r i n g − w e b − 2.6.1. j a r : 2.6.1 ] a t s p r i n g f o x . d o c u m e n t a t i o n . s p r i n g . w e b . s c a n n e r s . A p i D o c u m e n t a t i o n S c a n n e r . s c a n ( A p i D o c u m e n t a t i o n S c a n n e r . j a v a : 70 ) [ s p r i n g f o x − s p r i n g − w e b − 2.6.1. j a r : 2.6.1 ] a t s p r i n g f o x . d o c u m e n t a t i o n . s p r i n g . w e b . p l u g i n s . D o c u m e n t a t i o n P l u g i n s B o o t s t r a p p e r . s c a n D o c u m e n t a t i o n ( D o c u m e n t a t i o n P l u g i n s B o o t s t r a p p e r . j a v a : 85 ) [ s p r i n g f o x − s p r i n g − w e b − 2.6.1. j a r : 2.6.1 ] a t s p r i n g f o x . d o c u m e n t a t i o n . s p r i n g . w e b . p l u g i n s . D o c u m e n t a t i o n P l u g i n s B o o t s t r a p p e r . s t a r t ( D o c u m e n t a t i o n P l u g i n s B o o t s t r a p p e r . j a v a : 127 ) [ s p r i n g f o x − s p r i n g − w e b − 2.6.1. j a r : 2.6.1 ] a t o r g . s p r i n g f r a m e w o r k . c o n t e x t . s u p p o r t . D e f a u l t L i f e c y c l e P r o c e s s o r . d o S t a r t ( D e f a u l t L i f e c y c l e P r o c e s s o r . j a v a : 175 ) [ s p r i n g − c o n t e x t − 4.3.9. R E L E A S E . j a r : 4.3.9. R E L E A S E ] . . . 14 c o m m o n f r a m e s o m i t t e d C a u s e d b y : j a v a . l a n g . S t a c k O v e r f l o w E r r o r : n u l l a t c o m . f a s t e r x m l . c l a s s m a t e . u t i l . R e s o l v e d T y p e C a c h e LocalLoadingCache.getUnchecked(LocalCache.java:4830) ~[guava-18.0.jar:na] at springfox.documentation.spring.web.scanners.CachingOperationReader.read(CachingOperationReader.java:57) ~[springfox-spring-web-2.6.1.jar:2.6.1] at springfox.documentation.spring.web.scanners.ApiDescriptionReader.read(ApiDescriptionReader.java:66) ~[springfox-spring-web-2.6.1.jar:2.6.1] at springfox.documentation.spring.web.scanners.ApiListingScanner.scan(ApiListingScanner.java:89) ~[springfox-spring-web-2.6.1.jar:2.6.1] at springfox.documentation.spring.web.scanners.ApiDocumentationScanner.scan(ApiDocumentationScanner.java:70) ~[springfox-spring-web-2.6.1.jar:2.6.1] at springfox.documentation.spring.web.plugins.DocumentationPluginsBootstrapper.scanDocumentation(DocumentationPluginsBootstrapper.java:85) ~[springfox-spring-web-2.6.1.jar:2.6.1] at springfox.documentation.spring.web.plugins.DocumentationPluginsBootstrapper.start(DocumentationPluginsBootstrapper.java:127) ~[springfox-spring-web-2.6.1.jar:2.6.1] at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:175) ~[spring-context-4.3.9.RELEASE.jar:4.3.9.RELEASE] ... 14 common frames omitted Caused by: java.lang.StackOverflowError: null at com.fasterxml.classmate.util.ResolvedTypeCache LocalLoadingCache.getUnchecked(LocalCache.java:4830) [guava−18.0.jar:na]atspringfox.documentation.spring.web.scanners.CachingOperationReader.read(CachingOperationReader.java:57) [springfox−spring−web−2.6.1.jar:2.6.1]atspringfox.documentation.spring.web.scanners.ApiDescriptionReader.read(ApiDescriptionReader.java:66) [springfox−spring−web−2.6.1.jar:2.6.1]atspringfox.documentation.spring.web.scanners.ApiListingScanner.scan(ApiListingScanner.java:89) [springfox−spring−web−2.6.1.jar:2.6.1]atspringfox.documentation.spring.web.scanners.ApiDocumentationScanner.scan(ApiDocumentationScanner.java:70) [springfox−spring−web−2.6.1.jar:2.6.1]atspringfox.documentation.spring.web.plugins.DocumentationPluginsBootstrapper.scanDocumentation(DocumentationPluginsBootstrapper.java:85) [springfox−spring−web−2.6.1.jar:2.6.1]atspringfox.documentation.spring.web.plugins.DocumentationPluginsBootstrapper.start(DocumentationPluginsBootstrapper.java:127) [springfox−spring−web−2.6.1.jar:2.6.1]atorg.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:175) [spring−context−4.3.9.RELEASE.jar:4.3.9.RELEASE]...14commonframesomittedCausedby:java.lang.StackOverflowError:nullatcom.fasterxml.classmate.util.ResolvedTypeCacheKey.(ResolvedTypeCache.java:99) ~[classmate-1.3.3.jar:1.3.3]
at com.fasterxml.classmate.util.ResolvedTypeCache.key(ResolvedTypeCache.java:37) ~[classmate-1.3.3.jar:1.3.3]
at com.fasterxml.classmate.TypeResolver._fromClass(TypeResolver.java:360) ~[classmate-1.3.3.jar:1.3.3]
at com.fasterxml.classmate.TypeResolver._fromAny(TypeResolver.java:312) ~[classmate-1.3.3.jar:1.3.3]
at com.fasterxml.classmate.TypeResolver._fromParamType(TypeResolver.java:466) ~[classmate-1.3.3.jar:1.3.3]
at com.fasterxml.classmate.TypeResolver._fromAny(TypeResolver.java:315) ~[classmate-1.3.3.jar:1.3.3]
at com.fasterxml.classmate.TypeResolver.resolve(TypeResolver.java:174) ~[classmate-1.3.3.jar:1.3.3]
at com.fasterxml.classmate.ResolvedTypeWithMembers.resolveField(ResolvedTypeWithMembers.java:551) ~[classmate-1.3.3.jar:1.3.3]
at com.fasterxml.classmate.ResolvedTypeWithMembers.resolveMemberFields(ResolvedTypeWithMembers.java:300) ~[classmate-1.3.3.jar:1.3.3]
at com.fasterxml.classmate.ResolvedTypeWithMembers.getMemberFields(ResolvedTypeWithMembers.java:193) ~[classmate-1.3.3.jar:1.3.3]
at springfox.documentation.schema.property.field.FieldProvider.in(FieldProvider.java:47) ~[springfox-schema-2.6.1.jar:2.6.1]
at springfox.documentation.spring.web.readers.parameter.ModelAttributeParameterExpander.expand(ModelAttributeParameterExpander.java:80) ~[springfox-spring-web-2.6.1.jar:2.6.1]
at springfox.documentation.spring.web.readers.parameter.ModelAttributeParameterExpander.expand(ModelAttributeParameterExpander.java:94) ~[springfox-spring-web-2.6.1.jar:2.6.1]
at springfox.documentation.spring.web.readers.parameter.ModelAttributeParameterExpander.expand(ModelAttributeParameterExpander.java:110) ~[springfox-spring-web-2.6.1.jar:2.6.1]
at springfox.documentation.spring.web.readers.parameter.ModelAttributeParameterExpander.expand(ModelAttributeParameterExpander.java:94) ~[springfox-spring-web-2.6.1.jar:2.6.1]
at springfox.documentation.spring.web.readers.parameter.ModelAttributeParameterExpander.expand(ModelAttributeParameterExpander.java:110) ~[springfox-spring-web-2.6.1.jar:2.6.1]
at springfox.documentation.spring.web.readers.parameter.ModelAttributeParameterExpander.expand(ModelAttributeParameterExpander.java:94) ~[springfox-spring-web-2.6.1.jar:2.6.1]
at springfox.documentation.spring.web.readers.parameter.ModelAttributeParameterExpander.expand(ModelAttributeParameterExpander.java:110) ~[springfox-spring-web-2.6.1.jar:2.6.1]
at springfox.documentation.spring.web.readers.parameter.ModelAttributeParameterExpander.expand(ModelAttributeParameterExpander.java:94) ~[springfox-spring-web-2.6.1.jar:2.6.1]
at springfox.documentation.spring.web.readers.parameter.ModelAttributeParameterExpander.expand(ModelAttributeParameterExpander.java:110) ~[springfox-spring-web-2.6.1.jar:2.6.1]
at springfox.documentation.spring.web.readers.parameter.ModelAttributeParameterExpander.expand(ModelAttributeParameterExpander.java:94) ~[springfox-spring-web-2.6.1.jar:2.6.1]
at springfox.documentation.spring.web.readers.parameter.ModelAttributeParameterExpander.expand(ModelAttributeParameterExpander.java:110) ~[springfox-spring-web-2.6.1.jar:2.6.1]
at springfox.documentation.spring.web.readers.parameter.ModelAttributeParameterExpander.expand(ModelAttributeParameterExpander.java:94) ~[springfox-spring-web-2.6.1.jar:2.6.1]
at springfox.documentation.spring.web.readers.parameter.ModelAttributeParameterExpander.expand(ModelAttributeParameterExpander.java:110) ~[springfox-spring-web-2.6.1.jar:2.6.1