The problem
I'm trying to upgrade Gretty (
https://github.com/akhikhl/gretty) to
SpringBoot 1.1.7.RELEASE and face the following bug:
Compilation of class TomcatServletContainerFactory fails with error message:
<code>
Caused by: BUG! exception in phase 'semantic analysis' in source unit
'/home/ahi/Projects/gretty/libs/gretty-runner-spring-boot-tomcat/src/main/groovy/org/akhikhl/gretty/TomcatServletContainerFactory.groovy'
null
at
org.gradle.api.internal.tasks.compile.ApiGroovyCompiler.execute(ApiGroovyCompiler.java:122)
at
org.gradle.api.internal.tasks.compile.ApiGroovyCompiler.execute(ApiGroovyCompiler.java:47)
at
org.gradle.api.internal.tasks.compile.daemon.CompilerDaemonServer.execute(CompilerDaemonServer.java:53)
at
org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at
org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at
org.gradle.messaging.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:355)
at
org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:64)
Caused by: java.lang.reflect.MalformedParameterizedTypeException
... 7 more
</code>
I looked at the line 122 of ApiGroovyCompiler.java (gradle module), it
simply calls
org.codehaus.groovy.tools.javac.JavaAwareCompilationUnit.compile(). So, the
problem actually occurs in groovy, not in gradle.
Steps to reproduce the problem
1. git clone
https://github.com/akhikhl/gretty.git
2. cd gretty
3. git checkout spring-boot-1.1.7
4. gradle build
Problem isolation
The problem occurs only in one class: TomcatServletContainerFactory
<
https://github.com/akhikhl/gretty/blob/spring-boot-1.1.7/libs/gretty-runner-spring-boot-tomcat/src/main/groovy/org/akhikhl/gretty/TomcatServletContainerFactory.groovy>
.
The problem is related to inheritance from
org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.
Even if all code within TomcatServletContainerFactory, except the
inheritance, is commented out, the problem is still reproducible. As soon
as inheritance is commented out, the problem is gone.
The problem is not reproducible with SpringBoot 1.1.5.RELEASE.
The problem is not related to recent changes in Groovy - it reproduces well
on Groovy 2.3.6, 2.3.7 and 2.4.0-beta.
--
View this message in context:
http://groovy.329449.n5.nabble.com/Show-stopper-BUG-exception-in-phase-semantic-analysis-on-Gretty-SpringBoot-1-1-7-tp5721414.html
Sent from the groovy - user mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email