Repository navigation
Closed
Description
I've just updated my spring-boot 1.3.0.RC1 ( also 1.3.0.RELEASE ) app to Spring 4.2.3, and having
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.2.2</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.2.2</version>
<scope>runtime</scope>
</dependency>
in my pom.xml, used in a class
@Configuration
@EnableSwagger2
public class SwaggerConfig {
makes the application do not boot.
See error log attached :
2015-11-16 11:56:18,050 ERROR o.s.b.SpringApplication | Application startup failed
java.lang.IllegalArgumentException: interface org.springframework.core.annotation.SynthesizedAnnotation is not visible from class loader
at java.lang.reflect.Proxy$ProxyClassFactory.apply(Proxy.java:581) ~[na:1.8.0_66]
at java.lang.reflect.Proxy$ProxyClassFactory.apply(Proxy.java:557) ~[na:1.8.0_66]
at java.lang.reflect.WeakCache$Factory.get(WeakCache.java:230) ~[na:1.8.0_66]
at java.lang.reflect.WeakCache.get(WeakCache.java:127) ~[na:1.8.0_66]
at java.lang.reflect.Proxy.getProxyClass0(Proxy.java:419) ~[na:1.8.0_66]
at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:719) ~[na:1.8.0_66]
at org.springframework.core.annotation.AnnotationUtils.synthesizeAnnotation(AnnotationUtils.java:1404) ~[spring-core-4.2.3.RELEASE.jar:4.2.3.RELEASE]
at org.springframework.core.annotation.AnnotatedElementUtils.findMergedAnnotation(AnnotatedElementUtils.java:405) ~[spring-core-4.2.3.RELEASE.jar:4.2.3.RELEASE]
at org.springframework.web.method.HandlerMethod.getMethodAnnotation(HandlerMethod.java:234) ~[spring-web-4.2.3.RELEASE.jar:4.2.3.RELEASE]
at springfox.documentation.spring.web.readers.operation.OperationDeprecatedReader.apply(OperationDeprecatedReader.java:34) ~[springfox-spring-web-2.2.2.jar:2.2.2]
at springfox.documentation.spring.web.plugins.DocumentationPluginsManager.operation(DocumentationPluginsManager.java:113) ~[springfox-spring-web-2.2.2.jar:2.2.2]
at springfox.documentation.spring.web.readers.operation.ApiOperationReader.read(ApiOperationReader.java:79) ~[springfox-spring-web-2.2.2.jar:2.2.2]
at springfox.documentation.spring.web.readers.operation.ApiOperationReader$$FastClassBySpringCGLIB$$7c030d50.invoke(<generated>) ~[springfox-spring-web-2.2.2.jar:2.2.2]
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) ~[spring-core-4.2.3.RELEASE.jar:4.2.3.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:718) ~[spring-aop-4.2.3.RELEASE.jar:4.2.3.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) ~[spring-aop-4.2.3.RELEASE.jar:4.2.3.RELEASE]
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:85) ~[spring-aop-4.2.3.RELEASE.jar:4.2.3.RELEASE]
at springfox.documentation.spring.web.caching.CachingAspect.cachedValue(CachingAspect.java:86) ~[springfox-spring-web-2.2.2.jar:2.2.2]
at springfox.documentation.spring.web.caching.CachingAspect.operationsAndProperties(CachingAspect.java:69) ~[springfox-spring-web-2.2.2.jar:2.2.2]
at sun.reflect.GeneratedMethodAccessor103.invoke(Unknown Source) ~[na:na]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_66]
at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_66]
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621) ~[spring-aop-4.2.3.RELEASE.jar:4.2.3.RELEASE]
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610) ~[spring-aop-4.2.3.RELEASE.jar:4.2.3.RELEASE]
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:68) ~[spring-aop-4.2.3.RELEASE.jar:4.2.3.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:168) ~[spring-aop-4.2.3.RELEASE.jar:4.2.3.RELEASE]
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) ~[spring-aop-4.2.3.RELEASE.jar:4.2.3.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.2.3.RELEASE.jar:4.2.3.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:654) ~[spring-aop-4.2.3.RELEASE.jar:4.2.3.RELEASE]
at springfox.documentation.spring.web.readers.operation.ApiOperationReader$$EnhancerBySpringCGLIB$$c04784f2.read(<generated>) ~[springfox-spring-web-2.2.2.jar:2.2.2]
at springfox.documentation.spring.web.scanners.ApiDescriptionReader.read(ApiDescriptionReader.java:67) ~[springfox-spring-web-2.2.2.jar:2.2.2]
at springfox.documentation.spring.web.scanners.ApiListingScanner.scan(ApiListingScanner.java:92) ~[springfox-spring-web-2.2.2.jar:2.2.2]
at springfox.documentation.spring.web.scanners.ApiDocumentationScanner.scan(ApiDocumentationScanner.java:62) ~[springfox-spring-web-2.2.2.jar:2.2.2]
at springfox.documentation.spring.web.plugins.DocumentationPluginsBootstrapper.scanDocumentation(DocumentationPluginsBootstrapper.java:101) ~[springfox-spring-web-2.2.2.jar:2.2.2]
at springfox.documentation.spring.web.plugins.DocumentationPluginsBootstrapper.onApplicationEvent(DocumentationPluginsBootstrapper.java:87) ~[springfox-spring-web-2.2.2.jar:2.2.2]
at springfox.documentation.spring.web.plugins.DocumentationPluginsBootstrapper.onApplicationEvent(DocumentationPluginsBootstrapper.java:50) ~[springfox-spring-web-2.2.2.jar:2.2.2]
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:163) ~[spring-context-4.2.3.RELEASE.jar:4.2.3.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:136) ~[spring-context-4.2.3.RELEASE.jar:4.2.3.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:380) ~[spring-context-4.2.3.RELEASE.jar:4.2.3.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:334) ~[spring-context-4.2.3.RELEASE.jar:4.2.3.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:854) ~[spring-context-4.2.3.RELEASE.jar:4.2.3.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:140) ~[spring-boot-1.3.0.RC1.jar:1.3.0.RC1]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:540) ~[spring-context-4.2.3.RELEASE.jar:4.2.3.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118) ~[spring-boot-1.3.0.RC1.jar:1.3.0.RC1]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:761) [spring-boot-1.3.0.RC1.jar:1.3.0.RC1]
at org.springframework.boot.SpringApplication.doRun(SpringApplication.java:356) [spring-boot-1.3.0.RC1.jar:1.3.0.RC1]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:295) [spring-boot-1.3.0.RC1.jar:1.3.0.RC1]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1085) [spring-boot-1.3.0.RC1.jar:1.3.0.RC1]
Activity
dilipkrish commentedon Nov 16, 2015
I suspect its because of the aspectj libraries you've got in the project. This issue might be fixed in 2.2.3-SNAPSHOT. Would you be able to try it and report back?
josetesan commentedon Nov 17, 2015
I'm using
Are they the right versions ?
dilipkrish commentedon Nov 18, 2015
It sure is... Is it working for you in 2.2.3-SNAPSHOT? or is it busted there as well
josetesan commentedon Nov 18, 2015
Nope, it does not work yet, same error.
I tried snapshot from today, and got same error :
RobWin commentedon Nov 19, 2015
Same here.
lostirc commentedon Nov 19, 2015
I'm also seeing this
danwatt commentedon Nov 20, 2015
Same here, Spring Boot 1.3 / Spring * 4.2.3. Im seeing this when running via spring-boot:run in Maven, or by executing the resulting JAR/WAR file directly.
marcingrzejszczak commentedon Nov 20, 2015
Same in https://github.com/4finance/micro-infra-spring even though we're using some old version of swagger
com.mangofactory:swagger-springmvc:1.0.2A workaround I've done that sucks but makes the app work is to override the
OperationDeprecatedReaderclass with my own (it's first on the classpath). I've removed the scanning fromOperationDeprecatedReader... :/and I had to manually register this controller:
And now it's working...
Updated the dependencies
Prefer spring 3 classes for parameter names
Removed the aspecj autoproxy requirement
dilipkrish commentedon Dec 2, 2015
Anyone want to try the 2.2.3-SNAPSHOT and see if the problem is fixed?
/c @RobWin @josetesan @lostirc @danwatt @marcingrzejszczak
4 remaining items
dilipkrish commentedon Dec 2, 2015
@RobWin do you have the full stacktrace or may be a repo which reproduces the problem?
RobWin commentedon Dec 2, 2015
@dilipkrish
Yes.
https://github.com/Swagger2Markup/spring-swagger2markup-demo/tree/new_springboot
Branch
new_springbootdilipkrish commentedon Dec 2, 2015
@RobWin that was super useful... I think we can close this case. The snapshot should be available in a bit.
RobWin commentedon Dec 2, 2015
Nice :) thx!
Reverted the solution such that both 3.x and 4.2.x are happy
RobWin commentedon Dec 2, 2015
Is there a new snapshot available?
dilipkrish commentedon Dec 2, 2015
Every commit to master produces a new snapshot build 😇
RobWin commentedon Dec 2, 2015
Seems to take a while.
dilipkrish commentedon Dec 2, 2015
It has a different mvn coordinate (jfrog OSS). The docs should point u to the right url. (Sorry typing from a mobile phone). U can change it temporarily to check
RobWin commentedon Dec 2, 2015
I used http://oss.jfrog.org/artifactory/oss-snapshot-local/
dilipkrish commentedon Dec 2, 2015
Yeah yr right... its not synched up yet. I think there seems to be problem with the build
dilipkrish commentedon Dec 2, 2015
tried
gradle ... --refresh-dependencies?RobWin commentedon Dec 2, 2015
Thx. that did it.
Works now 👍 Thx!
josetesan commentedon Dec 8, 2015
With version 2.3.0 just released i can confirm it works !
Great job, guys.