Missing dependencies in codegen generated java

8 views
Skip to first unread message

Amanda Wang

unread,
Jun 12, 2018, 5:43:34 PM6/12/18
to Swagger
Used codegen to generate java-play-framework server code, which ran into this error when DefaultApiController.java tried to call SwaggerUtils.validate(user), where user is the request:
javax.validation.ValidationException: HV000183: Unable to initialize 'javax.el.ExpressionFactory'. Check that you have the EL dependencies on the classpath, or use ParameterMessageInterpolator instead

After googling that error, I added these two dependencies to the build.sbt file

libraryDependencies += "javax.el" % "el-api" % "2.2"

libraryDependencies += "org.glassfish.web" % "javax.el" % "2.2.6"
 
and then it worked, however it's not ideal to have to go in and manually add dependencies to generated code. Hoping this is something that could be fixed in the next version of codegen.
Reply all
Reply to author
Forward
0 new messages