Gonçalo Gonçalo - 1 month ago 22
Java Question

Heroku webapp-runner --enable-naming

I've been facing with a combersome task: deploying a spring project ( using JNDI ).

Right now the problem is related to the webapp-runner option "enable-naming".
My datasources are declared by jndi - using tomcar context.xml.
When i feed webapp-runner with the option referred i get this message:

Exception in thread "main" com.beust.jcommander.ParameterException:
**Unknown option: --enable-naming**
at com.beust.jcommander.JCommander.parseValues(JCommander.java:723)
at com.beust.jcommander.JCommander.parse(JCommander.java:275)
at com.beust.jcommander.JCommander.parse(JCommander.java:258)
at com.beust.jcommander.JCommander.(JCommander.java:203)
at webapp.runner.launch.Main.main(Main.java:74)


I've been digging the webapp-runner code and saw this condition:

if (commandLineParams.enableNaming ||
commandLineParams.enableBasicAuth ||
commandLineParams.tomcatUsersLocation != null) {
tomcat.enableNaming();
}


So i've tried with --enable-basic-auth option and my app runs just fine... The problem is i don't want basic-auth in my site.

I'm using maven heroku-maven-plugin, and as
WEBAPP_RUNNER_OPTS: --context-xml tomcat-heroku-server-conf/context.xml --enable-naming

Thanks in advance.

Answer

This option was added in webapp-runner 8.0.33.1, but at the time of this writing the Heroku CLI WAR deployment plugin and the Heroku Maven plugin default to version 8.0.30.2 of webapp-runner.

You can set the version like this for the CLI:

$ heroku deploy:war --webapp-runner 8.0.33.3 path/to/app.war

Or like this for Maven:

$ mvn heroku:deploy-war -Dheroku.webappRunnerVersion=8.0.33.3

I maintain webapp-runner and those plugins, and I'll update them to use 8.0.33.3 shortly.