This section describes usage error and how to fix them.
1. Annotation Processing Tool
1.1. Router Not Found
Exception:
Route not found: `...`. Make sure Jooby annotation processor is configured properly.
The cause of this error is generated when you try to use a MVC route and the annotation processing tool is not configured properly.
Maven Solution:
Java build needs the jooby-apt
dependency as annotationProcessorPaths.
Kotlin build also requires it via kapt.
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>io.jooby</groupId>
<artifactId>jooby-apt</artifactId>
<version>3.6.1</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins>
</build>
Gradle Solution:
Java build needs an annotationProcessor statement using jooby-apt
.
Kotlin builds needs a kapt dependency and statement using jooby-apt
.
dependencies {
annotationProcessor "io.jooby:jooby-apt:3.6.1"
}
IntelliJ Solution
You need to enable IntelliJ annotation processing tool. Please checkout the IntelliJ documentation to learn how to do it.
Please note that Kapt is still not supported for IntelliJ IDEA’s own build system. A simply workaround is to configure Intellij to run Maven/Gradle compilation as a build step before running your tests or application class:
-
Go to Run > Edit Configurations …
-
Select the application/test class run configuration
-
Find the Before build / Build section
-
Select Add (plus button)
-
Select Run Maven Goal or Run Gradle task
-
For Maven type
compile
ortestCompile
-
For Gradle type
classes
ortestClasses
Now whenever you run tests or the application Mvc classes will be generated at compilation time.
Alternatively, you can delegate IntelliJ build/run actions to Maven or Gradle completely:
Eclipse 4.9+
You need M2Eclipse for Maven or Gradle Buildship
2. Bean Converter
2.1. Parameter Name Missing
Exception:
Unable to provision parameter at position: '...', require by: ... Parameter's name is missing
Thrown when the bean converter has no access to a parameter name at runtime. Compilation must be
done using parameters
compiler option.
Maven Solution
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<configuration>
...
<compilerArgs>
<arg>-parameters</arg>
</compilerArgs>
</configuration>
</plugin>
</plugins>
</build>
Gradle Solution
tasks.withType(JavaCompile) {
options.compilerArgs << '-parameters'
options.debug = true
}