Jax-rs to raml error due to spoon java 8 issue


#1

I’m experiencing an error on jax-rs to raml plugin execution. After some research I found out that Spoon doesn’t support java 8. https://github.com/INRIA/spoon/issues/147

When will I be able to generate raml from my restful web service compiled in java 8?

2015-08-04 23:19:53,041 ERROR spoon.support.compiler.jdt.JDTTreeBuilder - unconsistent message send at (/Users/gustavomunizdocarmo/NetBeansProjects/logistics-web/src/main/java/br/com/esign/logistics/web/RoutesMapWebService.java:165)
spoon.compiler.ModelBuildingException: Syntax error on token “-”, – expected at /Users/gustavomunizdocarmo/NetBeansProjects/logistics-web/src/main/java/br/com/esign/logistics/web/RoutesMapWebService.java:56
at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.report(JDTBasedSpoonCompiler.java:506)
at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.reportProblems(JDTBasedSpoonCompiler.java:521)
at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.build(JDTBasedSpoonCompiler.java:481)
at spoon.Launcher.run(Launcher.java:822)
at spoon.Launcher.run(Launcher.java:910)
at org.raml.jaxrs.codegen.maven.JaxrsRamlCodegenMojo.execute(JaxrsRamlCodegenMojo.java:135)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)


#2

Did you raise an issue on the RAML jax-rs github repo to make the developers aware?


#3

can you also check the current version, i’ve been said that it should work with java 8


#4

I added a dependency to spoon-core in my pom.xml.

                <dependency>
                    <groupId>fr.inria.gforge.spoon</groupId>
                    <artifactId>spoon-core</artifactId>
                    <version>4.2.0</version>
                </dependency>

The error previously reported occurs until the version 2.3.1.

From version 2.4 to 3.1 the error is: java.lang.NoSuchMethodError: spoon.reflect.reference.CtExecutableReference.getParameterTypes()Ljava/util/List;

From version 4.0.0 to 4.2.0 (the newest one) the error is: A required class was missing while executing org.raml.plugins:jaxrs-raml-maven-plugin:1.3.3:generate-raml: spoon/reflect/declaration/CtSimpleType

It seems it’s not possible generate raml from a java 8 compiled restful web service yet.


#5

Hii, @gustavomcarmo

4.0.0 is the mimimal version suitable for the ‘jax-rs-to-raml’.

Spoon already seems to support Java 8 in 4.x version: http://permalink.gmane.org/gmane.comp.programming.spoon/36
(4.0.0 was released April 8, 2015).

Thus, what I can do is post an issue for Spoon once I’ve got a test case reproducing the problem.

Regards,
Konstantin Sviridov